X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a6ac56c5e510395d160cdb7ccc7a88d87403e687..ded28617c73090028c416e46ade69f7584536548:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index ffe12ecc6..7744b1ae4 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -81,8 +81,10 @@ $(document).ready(function () { }).addTo(map); L.OSM.share({ - getUrl: getShortUrl, - sidebar: sidebar + getShortUrl: getShortUrl, + getUrl: getUrl, + sidebar: sidebar, + short: true }).addTo(map); L.control.scale() @@ -167,36 +169,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();