blob: f54060d412e831f9e113aafa9c0d1551c455448e (
plain)
- define(['leaflet'], function(L) {
- // base config
- var attribOSM = '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
- attribCarto = '© <a href="http://cartodb.com/attributions">CartoDB</a>',
- TileLayer = L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', {
- attribution: 'Imagery ' + attribCarto + ' — Map data ' + attribOSM,
- subdomains: 'abcd',
- maxZoom: 19
- }),
- scale = L.control.scale({
- imperial: false
- });
- return function(id, bounds) {
- var map = L.map(id, {
- layers: [TileLayer]
- })
- if (bounds) {
- map.fitBounds(L.latLngBounds(bounds));
- } else {
- map.fitWorld().zoomIn();
- }
- map.attributionControl.setPrefix(false);
- scale.addTo(map);
- return map;
- };
- });
|