Page 1 of 1

xMap2-preferredRouteTypes in .NET and Xmap2LayerFactory

Posted: Tue Feb 07, 2023 10:33 am
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.

Re: xMap2-preferredRouteTypes in .NET and Xmap2LayerFactory

Posted: Tue Feb 07, 2023 11:02 am
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

Re: xMap2-preferredRouteTypes in .NET and Xmap2LayerFactory

Posted: Wed Feb 08, 2023 5:46 pm
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!

Re: xMap2-preferredRouteTypes in .NET and Xmap2LayerFactory

Posted: Thu Feb 09, 2023 7:54 am
by CAPcargo
Hi,

Thank you for your quick response and support.

Irena