xServer 2 Leaflet Customized Popup Content
Posted: Fri Nov 08, 2019 9:53 am
Hi,
how can I customize the popup content if I click on a TrafficIncident or TruckAttribute.
I found in the leaflet-xserver.js the buildDescription function and I wanted to overwrite it.
I tried:
But that's not working.
how can I customize the popup content if I click on a TrafficIncident or TruckAttribute.
I found in the leaflet-xserver.js the buildDescription function and I wanted to overwrite it.
I tried:
Code: Select all
var map = new L.Map('map', { center: [49.595, 6.115], zoom: 11 });
L.TileLayer.XServer.buildDescription = function (a) { return 'my own content'; }
// Add PTV tile layer to map
new L.tileLayer.xserver(urlPath + '?layers=labels,PTV_SpeedPatterns,PTV_TrafficIncidents'
+ '&timeConsideration=SNAPSHOT&referenceTime=' + encodeURIComponent(referenceTime) + '&showOnlyRelevantByTime=false'
+ '&userLanguage=' + userLanguage
+ '&contentType=JSON', {
pane: "overlayPane",
maxZoom: 20
}).addTo(map);