define(['leaflet'], function(L) { // base config var attribOSM = '© OpenStreetMap contributors', OSMLayer = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: attribOSM }), scale = L.control.scale({ imperial: false }); return function(id, bounds) { var map = L.map(id, { layers: [OSMLayer] }) if (bounds) { map.fitBounds(L.latLngBounds(bounds)); } else { map.fitWorld().zoomIn(); } map.attributionControl.setPrefix(false); scale.addTo(map); return map; }; });