xMap2-preferredRouteTypes in .NET and Xmap2LayerFactory

Within this forum we want to offer discussions all around our .NET based Map control including all .Net-language specific questions concerning calls of the xServer-API. Attention: xServer-relevant concepts can be found in further forums such as xRoute or xTour.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

xMap2-preferredRouteTypes in .NET and Xmap2LayerFactory

Post by Bernd Welter »

Hello Oliver,

one of my partners approached me with this tricky challenge about xServer.NET in combination with xMap2.

Could you help us with that?

Bernd
Hello Bernd,

I have one question related to the preferredRouteTypes - xMap2.
Currently we're using .NET and Xmap2LayerFactory property to show map and interacting with it in WPFMap form (latest version of the Ptv.XServer.Controls.Map.dll).
It seems that there isn't any property for the preferredRouteTypes, I tried to analyze and find a way how to send the preferredRouteTypes which should be visible on the map, but I cannot provide this info from our c# code.
About the Feature layers it is ok, and it works correctly, the PTV_PreferredRoutes layer is enabled but all preferredRouteTypes are visible.

I can see that this property is part of the mapOptions but I cannot find this one in Xmap2LayerFactory and in the other options that I have from this dll.
preferredroutes.png

Do you have any idea to share with me, how to enhance the request with this property and how to provide additional information about the preferredRouteTypes that we want to see on the map?
I know that when we use REST API to build a tiled map if we want to display only a subset of types - the parameter preferredRouteTypes has to be specified in the URL and the types have to be included with comma separator.
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
User avatar
Oliver Heilig
Posts: 160
Joined: Tue May 13, 2014 12:10 pm
Location: Karlsruhe, Germany
Contact:

Re: xMap2-preferredRouteTypes in .NET and Xmap2LayerFactory

Post by Oliver Heilig »

Hey Bernd,

looks like the preferredRouteTypes cannot be set by the layerFactory. Though there's a ModifyRequest event, but this is more intended to add http headers.

I have added a new property, so you can set it like.

Code: Select all

layerFactory.PreferredRouteTypes.Add("BK_2");
If you want it as new nuget update, this would require a new release.

OLI
Oliver Heilig
Chief Developer Logistic Services
PTV GROUP - Germany

https://github.com/oliverheilig/
User avatar
Bernd Welter
Site Admin
Posts: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xMap2-preferredRouteTypes in .NET and Xmap2LayerFactory

Post by Bernd Welter »

New version 1.7.10 is available per nuget ;-)
https://www.nuget.org/packages/Ptv.XServer.Net.
Thanks to Oliver for the quick release!
Attachments
Success ;-)
Success ;-)
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
CAPcargo
Posts: 34
Joined: Tue May 19, 2015 12:53 pm

Re: xMap2-preferredRouteTypes in .NET and Xmap2LayerFactory

Post by CAPcargo »

Hi,

Thank you for your quick response and support.

Irena
Post Reply