define(['leaflet'], function(L) { // base config var attribOSM = '© OpenStreetMap contributors'; var attribCarto = '© CARTO'; var licenseODbL ='under the ODbL 1.0 license'; var TileLayer = L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', { attribution: 'Imagery ' + attribCarto + ' — Map data ' + attribOSM + ' ' + licenseODbL, 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; }; });