blob: 4802f50b0e05f91ae54d94d8ac9ec89ef4e262bc (
plain)
- define(['leaflet'], function(L) {
- // base config
- var attribOSM = '© <a href="https://www.openstreetmap.org/">OpenStreetMap-bidragydere</a>';
- var licenseCcBySa2 = 'under en <a href="https://creativecommons.org/licenses/by-sa/2.0/">Creative Commons Kreditering-DelPåSammeVilkår</a> licens.';
- var licenseODbL ='under licensen <a href="https://opendatacommons.org/licenses/odbl/1.0/">ODbL 1.0</a>';
- var TileLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: attribOSM + ', kartografi ' + licenseCcBySa2 + ', kortdata ' + licenseODbL
- }),
- 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;
- };
- });
|