X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/b5800b4c2f51e265b51f6b0cd45728b8d7db86aa..f9d714dfd36fa56ced4c0a99a6e59c945ff89cca:/app/assets/javascripts/index.js?ds=sidebyside diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 452cc0bca..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(); @@ -161,8 +164,8 @@ $(document).ready(function () { } initializeExport(map); - initializeBrowse(map); - initializeNotes(map); + initializeBrowse(map, params); + initializeNotes(map, params); }); function updateLocation() { @@ -174,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) {