X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9172695f7f94bb60dd01455a922e22d181eb284e..dc8751cf7af7ce0e0033c078dac064d62ab819e6:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index d58317f63..6ea276230 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -1,6 +1,5 @@ //= require_self //= require leaflet.sidebar -//= require leaflet.customzoom //= require leaflet.locate //= require leaflet.layers //= require leaflet.key @@ -56,7 +55,7 @@ $(document).ready(function () { map.invalidateSize(); }); - L.control.customZoom({position: 'topright'}) + L.OSM.zoom({position: 'topright'}) .addTo(map); L.control.locate({position: 'topright'}) @@ -75,11 +74,6 @@ $(document).ready(function () { sidebar: sidebar }).addTo(map); - L.OSM.note({ - position: 'topright', - sidebar: sidebar - }).addTo(map); - L.OSM.share({ getShortUrl: getShortUrl, getUrl: getUrl, @@ -87,6 +81,11 @@ $(document).ready(function () { short: true }).addTo(map); + L.OSM.note({ + position: 'topright', + sidebar: sidebar + }).addTo(map); + L.control.scale() .addTo(map); @@ -169,36 +168,10 @@ $(document).ready(function () { initializeNotes(map); }); -function getMapBaseLayerId(map) { - for (var i in map._layers) { // TODO: map.eachLayer - var layer = map._layers[i]; - if (layer.options && layer.options.keyid) { - return layer.options.keyid; - } - } -} - -function getMapLayers(map) { - var layerConfig = ''; - for (var i in map._layers) { // TODO: map.eachLayer - var layer = map._layers[i]; - if (layer.options && layer.options.code) { - layerConfig += layer.options.code; - } - } - return layerConfig; -} - -// generate a cookie-safe string of map state -function cookieContent(map) { - var center = map.getCenter().wrap(); - return [center.lng, center.lat, map.getZoom(), getMapLayers(map)].join('|'); -} - function updateLocation() { updatelinks(this.getCenter().wrap(), this.getZoom(), - getMapLayers(this), + this.getLayersCode(), this.getBounds().wrap(), {}); var expiry = new Date();