The ALKMaps TrafficIncidents layer.
ALKMaps. | The ALKMaps TrafficIncidents layer. |
Functions | |
TrafficIncidents | Create a new ALKMaps.Layer.TrafficIncidents instance |
Create a new ALKMaps.Layer.TrafficIncidents instance
// https://github.com/Leaflet/Leaflet.markercluster
L.ALKMaps.setApiKey("");
var map = L.map('map').setView([51.61, 0.07], 8);
var baseLayer = L.ALKMaps.Layer.baseMap({
region: "EU",
dataset: "Current"
});
map.addLayer(baseLayer);
var incidents = L.ALKMaps.Layer.trafficIncidents({
language: "fr",
iconCreateFunction: function (cluster) {
var childCount = cluster.getChildCount();
return L.divIcon({ html: '<b>' + cluster.getChildCount() + '</b>' });
},
chunkProgress: function (processed, total, elapsed, layersArray) {
// https://github.com/Leaflet/Leaflet.markercluster
console.log("to implement a progress indicator");
},
describeIncidentPopup: function (abb) {
// "Your code goes here."
return {
"content": abb[0].content,
"options": customOptions
};
},
describeIncidentTooltip: function (location) {
// "Your code goes here."
return;
}
});
incidents.addTo(map);
{Object} An instance of L.ALKMaps.Layer.TrafficIncidents