PTV Developer Vector Maps and Icons...

Display geographical data on highly accurate, interactive and customizable vector maps.
Post Reply
Marko Cancar
Posts: 6
Joined: Mon Jan 11, 2021 11:47 am

PTV Developer Vector Maps and Icons...

Post by Marko Cancar »

One of my clients wants to build a web application with the PTV Vector Maps.

How can he display specific icons at geo-coordinates he just geocoded?

Thanks and regards,
Marko
Marko Cancar
Account Executive
PTV Logistics - Austria
User avatar
Bernd Welter
Site Admin
Posts: 2780
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: PTV Developer Vector Maps and Icons...

Post by Bernd Welter »

Hi Marko,

the answer to your question depends on the chosen mapping framework.
In the Developer tutorials we use the MapLibre library (a community driven fork of MapBox GL)

I just checked the Tutorials: position matching looks promising.
VectorMap-icons.png

Code: Select all

function addMarker(lngLat, textAsHtml) {
  const popup = new maplibregl.Popup({closeButton: false})
    .setHTML(textAsHtml);
  const marker = new maplibregl.Marker()
    .setLngLat(lngLat)
    .setPopup(popup)
    .addTo(map);
  mapMarker = marker;
  marker.togglePopup();
}
function clearMarker() {
  if (mapMarker) mapMarker.remove();
  mapMarker = undefined;
}
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:
Post Reply