X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6d124f801224ee441dbb7e67b912b8689cab6dfb..7dbf8d83369cb73929080c4ba23fdd7dcd0184df:/app/assets/javascripts/leaflet.layers.js diff --git a/app/assets/javascripts/leaflet.layers.js b/app/assets/javascripts/leaflet.layers.js index d2928068d..a465e1449 100644 --- a/app/assets/javascripts/leaflet.layers.js +++ b/app/assets/javascripts/leaflet.layers.js @@ -49,8 +49,8 @@ L.OSM.layers = function(options) { .appendTo(item); map.whenReady(function() { - var miniMap = L.map(div[0], {attributionControl: false, zoomControl: false}) - .addLayer(new layer.constructor()); + var miniMap = L.map(div[0], {attributionControl: false, zoomControl: false, keyboard: false}) + .addLayer(new layer.constructor({ apikey: layer.options.apikey })); miniMap.dragging.disable(); miniMap.touchZoom.disable(); @@ -101,6 +101,8 @@ L.OSM.layers = function(options) { map.fire('baselayerchange', {layer: layer}); }); + item.on('dblclick', toggle); + map.on('layeradd layerremove', function() { item.toggleClass('active', map.hasLayer(layer)); input.prop('checked', map.hasLayer(layer)); @@ -174,6 +176,7 @@ L.OSM.layers = function(options) { addOverlay(map.noteLayer, 'notes', OSM.MAX_NOTE_REQUEST_AREA); addOverlay(map.dataLayer, 'data', OSM.MAX_REQUEST_AREA); + addOverlay(map.gpsLayer, 'gps', Number.POSITIVE_INFINITY); } options.sidebar.addPane($ui);