xMap2: how to retrieve specific layers only? (REST)

This forum covers all questions dealing with visualization of data within the native PTV xMap interface and the
PTV Developer Raster Maps API
Please remember that additional plugins such as AJAX or Leaflet may be handeled in other forums.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2703
Joined: Mon Apr 14, 2014 10:28 am
Contact:

xMap2: how to retrieve specific layers only? (REST)

Post by Bernd Welter »

Hi there,

today I got asked whether it is possible to request only the truck attributes (PTV_TruckAttributes) with a REST call so the result tile would not contain any standard layers such as label or transport.

Well: here's the solution: just do not ask for what you don't want to see ;-) Here's the same geography rendered with different layer sets:
/services/rest/XMap/tile/12/2124/1366?layers=PTV_TruckAttributes
/services/rest/XMap/tile/12/2124/1366?layers=PTV_TruckAttributes
PTV_TruckAttributes-only.png (2.11 KiB) Viewed 10465 times
/services/rest/XMap/tile/12/2124/1366?layers=PTV_TruckAttributes,labels,transport
/services/rest/XMap/tile/12/2124/1366?layers=PTV_TruckAttributes,labels,transport
PTV_TruckAttributes-labels,transport.png (9.06 KiB) Viewed 10465 times
/services/rest/XMap/tile/12/2124/1366?layers=PTV_TruckAttributes,labels,transport,background
/services/rest/XMap/tile/12/2124/1366?layers=PTV_TruckAttributes,labels,transport,background
PTV_TruckAttributes-labels,transport,background.png (14.16 KiB) Viewed 10465 times
HERE Satellite images mashed up with PTV_TrafficIncidents
HERE Satellite images mashed up with PTV_TrafficIncidents
Best regards,
Bernd
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
danper
Posts: 19
Joined: Mon Apr 28, 2014 8:16 am

Re: xMap2: how to retrieve specific layers only? (REST)

Post by danper »

Hi Bernd,
could you add the code of the xmap2 + here satellite map example?
Kind Regards,
Daniele
Daniele Perella
Solution Engineer
PTV ITALIA Logistics
User avatar
Bernd Welter
Site Admin
Posts: 2703
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xMap2: how to retrieve specific layers only? (REST)

Post by Bernd Welter »

Hello Daniele,

there's not a single call for what you need. It requires a mesh up of the
- here call to gather the satellite image
- the call to xmap2 to gather the feature layers
You then have to create the superposition of two layers with the technique that is provided by the framework you use. Which one do you need? I'd like to get one to provide it here in the forum?

We could also start some collection...
Best regards to my Italian friends!

Bernd
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
danper
Posts: 19
Joined: Mon Apr 28, 2014 8:16 am

Re: xMap2: how to retrieve specific layers only? (REST)

Post by danper »

Hi Bernd,

we are using leaflet JS on a webpage. In the meanwhile, we solved using adding an extra tile layer for the satellite HERE maps...

Kind Regards
Daniele e Fabio
Attachments
xMap2andSatelliteMap.png
Daniele Perella
Solution Engineer
PTV ITALIA Logistics
Joost
Posts: 310
Joined: Fri Apr 25, 2014 1:46 pm

Re: xMap2: how to retrieve specific layers only? (REST)

Post by Joost »

For leaflet, don't forget the code Oliver put on github to give examples:

https://github.com/ptv-logistics/xserve ... oilerplate
Joost Claessen
Senior Technical Consultant
PTV Benelux
Post Reply