ALKMaps.Layer.TrafficIncidents (Leaflet)

The ALKMaps TrafficIncidents layer.

Inherits from

  • <L.Class>
Summary
ALKMaps.Layer.TrafficIncidents (Leaflet)The ALKMaps TrafficIncidents layer.
Functions
TrafficIncidentsCreate a new ALKMaps.Layer.TrafficIncidents instance

Functions

TrafficIncidents

Create a new ALKMaps.Layer.TrafficIncidents instance

Parameters

// 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 (location) {
        // "Your code goes here."
        return;
    },
    describeIncidentTooltip: function (location) {
        // "Your code goes here."
        return;
    }
});
incidents.addTo(map);

Returns

{Object} An instance of L.ALKMaps.Layer.TrafficIncidents

Close