From: John Firebaugh Date: Fri, 8 Nov 2013 21:42:06 +0000 (-0800) Subject: Fix order of initialization X-Git-Tag: live~5173^2~137 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/8b5e0d024813e38bc207f4f7b703ed53111a88a3 Fix order of initialization initializeNotes needs to be called after L.OSM.note. --- diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 7c9d255bb..816bb4e8f 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -102,18 +102,6 @@ $(document).ready(function () { map.dataLayer = new L.OSM.DataLayer(null); map.dataLayer.options.code = 'D'; - if (OSM.STATUS != 'api_offline' && OSM.STATUS != 'database_offline') { - initializeNotes(map); - if (params.layers.indexOf(map.noteLayer.options.code) >= 0) { - map.addLayer(map.noteLayer); - } - - initializeBrowse(map); - if (params.layers.indexOf(map.dataLayer.options.code) >= 0) { - map.addLayer(map.dataLayer); - } - } - var position = $('html').attr('dir') === 'rtl' ? 'topleft' : 'topright'; L.OSM.zoom({position: position}) @@ -155,6 +143,18 @@ $(document).ready(function () { L.control.scale() .addTo(map); + if (OSM.STATUS != 'api_offline' && OSM.STATUS != 'database_offline') { + initializeNotes(map); + if (params.layers.indexOf(map.noteLayer.options.code) >= 0) { + map.addLayer(map.noteLayer); + } + + initializeBrowse(map); + if (params.layers.indexOf(map.dataLayer.options.code) >= 0) { + map.addLayer(map.dataLayer); + } + } + $('.leaflet-control .control-button').tooltip({placement: 'left', container: 'body'}); map.on('moveend layeradd layerremove', function() {