X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ce53e510adb1baed6cc8f27e48d810a586853e55..6dcd087abcf718fcaf9aca9283b6b39b9dbbcdcb:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 2f0c16097..19e1f16de 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -19,7 +19,7 @@ $(document).ready(function () { map.attributionControl.setPrefix(''); - new L.Hash(map); + map.hash = L.hash(map); var layers = [ new L.OSM.Mapnik({ @@ -50,8 +50,11 @@ $(document).ready(function () { layers[0].addTo(map); - map.noteLayer = new L.LayerGroup({code: 'N'}); + map.noteLayer = new L.LayerGroup(); + map.noteLayer.options = {code: 'N'}; + map.dataLayer = new L.OSM.DataLayer(null); + map.dataLayer.options.code = 'D'; $("#sidebar").on("opened closed", function () { map.invalidateSize(); @@ -81,8 +84,6 @@ $(document).ready(function () { L.OSM.share({ position: position, - getShortUrl: getShortUrl, - getUrl: getUrl, sidebar: sidebar, short: true }).addTo(map); @@ -163,8 +164,8 @@ $(document).ready(function () { } initializeExport(map); - initializeBrowse(map); - initializeNotes(map); + initializeBrowse(map, params); + initializeNotes(map, params); }); function updateLocation() { @@ -176,6 +177,9 @@ function updateLocation() { var expiry = new Date(); expiry.setYear(expiry.getFullYear() + 10); $.cookie("_osm_location", cookieContent(this), { expires: expiry }); + + // Trigger hash update on layer changes. + this.hash.onMapMove(); } function setPositionLink(map) {