X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ef73cc1f574124b10cda75188aa542d9f4d802bb..a6ac56c5e510395d160cdb7ccc7a88d87403e687:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 184b57419..ffe12ecc6 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -1,12 +1,13 @@ //= require_self +//= require leaflet.sidebar +//= require leaflet.customzoom +//= require leaflet.locate //= require leaflet.layers -//= require leaflet.share +//= require leaflet.key //= require leaflet.note -//= require leaflet.locate -//= require leaflet.customzoom +//= require leaflet.share //= require index/browse //= require index/export -//= require index/key //= require index/notes $(document).ready(function () { @@ -48,6 +49,9 @@ $(document).ready(function () { layers[0].addTo(map); + map.noteLayer = new L.LayerGroup({code: 'N'}); + map.dataLayer = new L.OSM.DataLayer(null); + $("#map").on("resized", function () { map.invalidateSize(); }); @@ -55,22 +59,34 @@ $(document).ready(function () { L.control.customZoom({position: 'topright'}) .addTo(map); - var uiPane = $('#map-ui')[0]; + L.control.locate({position: 'topright'}) + .addTo(map); + + var sidebar = L.OSM.sidebar('#map-ui'); L.OSM.layers({ position: 'topright', layers: layers, - uiPane: uiPane + sidebar: sidebar }).addTo(map); - L.control.share({ + L.OSM.key({ + position: 'topright', + sidebar: sidebar + }).addTo(map); + + L.OSM.note({ + position: 'topright', + sidebar: sidebar + }).addTo(map); + + L.OSM.share({ getUrl: getShortUrl, - uiPane: uiPane + sidebar: sidebar }).addTo(map); - L.control.note({ position: 'topright' }).addTo(map); - L.control.locate({ position: 'topright' }).addTo(map); - L.control.scale().addTo(map); + L.control.scale() + .addTo(map); map.on('moveend layeradd layerremove', updateLocation); @@ -145,6 +161,10 @@ $(document).ready(function () { if (!("autofocus" in document.createElement("input"))) { $("#query").focus(); } + + initializeExport(map); + initializeBrowse(map); + initializeNotes(map); }); function getMapBaseLayerId(map) {