flexmeasures/ui/static/js/map-init.js
// Useful functions for our asset-specific Leaflet code
Useful functions for our asset-specific Leaflet code
Useful functions for our asset - specific Leaflet code
function addTileLayer(leafletMap, mapboxAccessToken) {
    var tileLayer = new L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
        attribution: '© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map</a></strong>',
        tileSize: 512,
        maxZoom: 18,
        zoomOffset: -1,
        id: 'mapbox/streets-v11',
        accessToken: mapboxAccessToken
    });
    tileLayer.addTo(leafletMap);
    $("#" + leafletMap._container.id).append(
        '<a href="https://mapbox.com/about/maps" class="mapbox-logo" target="_blank">Mapbox</a>'
    );
}
function addTileLayer ( leafletMap , mapboxAccessToken ) { var tileLayer = new L . tileLayer ( 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}' , { attribution : '© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map</a></strong>', tileSize : 512 , maxZoom : 18 , zoomOffset : - 1 , id : 'mapbox/streets-v11' , accessToken : mapboxAccessToken } ) ; tileLayer . addTo ( leafletMap ) ; $ ( "#" + leafletMap . _container . id ) . append ( '<a href="https://mapbox.com/about/maps" class="mapbox-logo" target="_blank">Mapbox</a>' ) ; }
Useful functions for our asset-specific Leaflet code
Useful functions for our asset - specific Leaflet code
/*
    Add the tile layer for FlexMeasures.
    Configure tile size, Mapbox API access and attribution.
    */ // add link for Mapbox logo (logo added via CSS)