Page 1 of 1

Confusion on how to use renderMap with FormsMap control

Posted: Wed Sep 30, 2015 4:32 pm
by Tom
Hi all,

I'm a little bit confused on how to get the new .net FormsMap-control to work with my existing code. So up to now I called xMap.renderMap with everything prepared, my custom layers, all points, all lines, everything and renderMap gives me back a completely rendered map. With the new control - if I understand the samples correctly - I basically give the control a bare connection to the xMap service and have to put everything else on top of it by myself using the control's objects, where I also can create layers putting shapes, lines, points, etc. If this is correct, it means to change the hole program logic as to call renderMap "naked" (or even not calling it at all, since the FormsMap control has it's own connection to xMap, enabling it to render any wanted map anytime) and drawing anything else directly into the FormsMap control. But in this case I wonder for what do I need the renderMap-function???

I hope somebody can clarify my confusion.

Thanks a lot,

regards,
Tom

Re: Confusion on how to use renderMap with FormsMap control

Posted: Fri Oct 02, 2015 8:59 am
by Bernd Welter
Hello Tom,

the .NET Control is just an alternative for those users who work with Microsoft.NET.
Other players such as
- Java
- Abap
still need the direct approach with renderMap.

And even you can still stay on the native path if you prefer this: we do not force anybody to use a specific framework.
Even if you work in the WEB it is your own choice whether you use PTV AjaxMaps, OpenLayers, Leaflet or another implementation.

But:
Yes - if you want to switch to .NET control you have to write parts of your code from scratch, at least those which refer to mapping.

Hope this info helps,

Best regards
Bernd

Re: Confusion on how to use renderMap with FormsMap control

Posted: Mon Nov 16, 2015 12:21 pm
by Tom
Hi Bernd,

Sorry, I only managed to get back to this issue now.

Thanks a lot for your clarification! But this means also, all of the map-dealing, like putting additional information on the map, e.g. addresses the user wanted to lookup (-> xLocate results) or routes (-> xRoute results) is now client-sided rather than server-sided.

Is there a way having the .net control display a server-rendered map containing already all xLocate and xRoute results?
And another question: Where can I find an API-reference-documentation of the FormsMap control?

Best regards,
Tom

Re: Confusion on how to use renderMap with FormsMap control

Posted: Fri Nov 27, 2015 8:30 am
by Oliver Heilig
Hi Tom,

there's a basic difference between the adding your xRoute result to the xMap-Request and using the xServer.NET control.

Adding the xServer route to the map request renders your route server-side, while with the xServer.NET-control the route is usually rendered client-side. For xServer.NET the xMap is used merely as "base map", while all transient object (routes, tours, locations, ...) are rendered client-side. This is done, because the .NET control is build for interaction on the client and not only rendering.

Technically it would be possible to use the FormsMap-control to render the route server-side. But this would mean you'll use it other than intended. You should check if it's possible to modify it so it uses the FormsMap/WpfMap if you want an interactive map on a windows client application.

All features showed for DemoCenter and xservernet-bin https://github.com/ptv-logistics/xservernet-bin can also be used with the FormsMap. The FormsMap is actually a wrapper around the WPF map control. The easiest way to add your content is to use the shape layer. I'll extend the samples FormsMapVB/FormsMapCS to display a route later that day.

Regards

Oliver

Re: Confusion on how to use renderMap with FormsMap control

Posted: Fri Nov 27, 2015 9:32 am
by Tom
Hi Oliver,

thanks a lot for your explanation. Is there anywhere an API-documentation of the FormsMap-control? I'm not able to find one.

Thanks again.

Regards,
Tom

Re: Confusion on how to use renderMap with FormsMap control

Posted: Fri Nov 27, 2015 3:41 pm
by Oliver Heilig
Hi Tom,

you can find the Documentation of the API at the .chm of xServer.NET SDK downloadable form the DevZone http://xserver.ptvgroup.com/en-uk/nc/de ... omer-area/.

I've added the calculation and displaying of a route to FormsMapCS and FormsMapVB at https://github.com/ptv-logistics/xservernet-bin

Image

Regards

Oliver