blob: 8d8bb0e230103fc6ad656e2d3414dcd9d7a044be (
plain)
- define(['leaflet'], function(L) {
- // base config
- var attribOSM = '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> 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;
- };
- });
|