Page 1 of 1

Feature Layer

Posted: Wed Oct 24, 2018 12:39 pm
by dstest
Hallo,
ich wir möchten FeatureLayers auf der Karte dynamisch zur Laufzeit ein und ausblenden. U.a. PTV_TruckAttributes,PTV_SpeedPatterns und PTV_TrafficIncidents (soll immer dann immer angezeigt werden unabhängig von routenplanung/xroute). Gibt es hierfür ein Beispiel in .NET wie dies einfach geschehen kann?
MfG
Frank

Re: Feature Layer

Posted: Wed Oct 24, 2018 3:42 pm
by Bernd Welter
Hello Frank,

please check whether this post gives answers...

https://xserver.ptvgroup.com/forum/view ... layer#p900

The colleagues usually provide samples via GITHUB and if a sample is missing they can check whether they can add one.

Best regards from LINZ AIRPORT / Austria,
Bernd

Re: Feature Layer

Posted: Fri Oct 26, 2018 2:14 pm
by dstest
Hello Bernd,
thank you for the answer.
i have seen the example. Thats exact what we need. But it doesn't work in my project with the .net mapcontrol we use.

Feature Layer Classes are the same. Call of the Procedure is the same. Only other thing is the kind of the Mapcontrol:

Private flPresenter As dsoft.logit.mgxsharp.FeatureLayer.FeatureLayerPresenter

Private Sub InitFeatureLayers()
flPresenter = New mgxsharp.FeatureLayer.FeatureLayerPresenter(pxFormsMap.WrappedMap)
flPresenter.ReferenceTime = Now
flPresenter.UseTrafficIncidents = True
flPresenter.UseRestrictionZones = False
flPresenter.UseTruckAttributes = False
flPresenter.UseSpeedPatterns = False
flPresenter.RefreshMap()
End Sub

Is there a problem with the mapcontrol we use? What do i have to change?

BR
Frank

Re: Feature Layer

Posted: Tue Oct 30, 2018 9:35 am
by Oliver Heilig
Hello Frank,

i guess you are referring to thesample "FeatureLayers" here:

https://github.com/ptv-logistics/xserver.net-bin

We have changed the sample to fit to the latest version (1.6) of the control. This has some internal interface changes regarding xMapServe-access. To make this code work you can either revert to a pre-October version

https://github.com/ptv-logistics/xserve ... rovider.cs

or use the latest version 1.6.0 (inside the lib folder) in your project. I would recommend this anyways, because this will also be next supported version, and also abailable on GitHub

https://github.com/ptv-logistics/xserver.net

Oli

Re: Feature Layer

Posted: Thu Nov 15, 2018 10:46 am
by dstest
Hallo Oliver,
leider konnte das Problem mit Komponentenupdate und Verwendung des neuen Feature-Layer Beispiels nicht behoben werden.
Die Fehlermeldung bleibt gleich. Ich habe ein Testprojekt hierzu hinzugefügt, damit Sie das Problem sehen könne.
Gruß
Frank

Re: Feature Layer

Posted: Fri Nov 16, 2018 8:05 am
by Oliver Heilig
Hello Frank,

i've reviewed the sample and found the problem is that you must initialize the map with specific providers, and not just by setting xMapUrl.

I must admit this is a bit cumbersome, but was required because the default didn't support the ReferenceTime property, which is required for FeatureLayer. I've added this property to the basic xmap-1 provider. Now the special implementation isn't needed, and you can change ReferenceTime with the standard inplementation. Take a look at the new sample.

But this requires the latest revision of the control, which is available here: https://github.com/ptv-logistics/xserve ... master/Lib

Oli

Re: Feature Layer

Posted: Mon Nov 19, 2018 12:25 pm
by dstest
Hello Oliver,

thank you for the example. Now Feature Layers Work fine in our Aplication.

But i have found another issue. The Function of Map MouseToGeo now raises an error caused by Ptv.Components.Projections. Please find attached the Screenshot. I think i need the latest Projection Component too. Can you help me with that.

BR
Frank

Re: Feature Layer

Posted: Tue Nov 20, 2018 3:08 pm
by Oliver Heilig
Hi Franke,

if you are using the transform functions with a specific coordinate system, you need to make sure you have the Ptv.Components.Projections.dll. But if you are just using standard WGS84 coordinates, you can also omit the parameter, because this is the standard format of the control.

Code: Select all

var geo = map.MouseToGeo(e);
https://github.com/ptv-logistics/xserve ... ips.cs#L39

My recommendation is to always use WGS84 (x=lng,y=lat) coordinates in you project, so

[*] Omit the coordinate format for the map control, the default is WGS
[*] For xServer-1 requests use "OG_GEODECIMAL" to use WGS
[*] For xServer-2 requests, omit the, the default is WGS

Edit by JCL: fixed spelling error in xServer-1 coordinate format