From: Marc Tobias Metten Date: Fri, 27 Oct 2017 20:06:48 +0000 (+0200) Subject: UI: minimap causes main map not to initialize X-Git-Tag: v3.1.0~23^2^2 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/6b994cb5ff75fed20e96ec2059ced27c3c6d273a UI: minimap causes main map not to initialize --- diff --git a/website/js/nominatim-ui.js b/website/js/nominatim-ui.js index c971d745..abb23beb 100644 --- a/website/js/nominatim-ui.js +++ b/website/js/nominatim-ui.js @@ -17,7 +17,7 @@ function parse_and_normalize_geojson_string(raw_string){ return parsed_geojson; } -jQuery(document).on('ready', function(){ +jQuery(document).ready(function(){ if ( !$('#search-page,#reverse-page').length ){ return; } @@ -37,8 +37,6 @@ jQuery(document).on('ready', function(){ attribution: (nominatim_map_init.tile_attribution || null ) //'© OpenStreetMap contributors' }).addTo(map); - map.setView([nominatim_map_init.lat, nominatim_map_init.lon], nominatim_map_init.zoom); - var osm2 = new L.TileLayer(nominatim_map_init.tile_url, {minZoom: 0, maxZoom: 13, attribution: (nominatim_map_init.tile_attribution || null )}); var miniMap = new L.Control.MiniMap(osm2, {toggleDisplay: true}).addTo(map); @@ -265,7 +263,7 @@ jQuery(document).on('ready', function(){ }); -jQuery(document).on('ready', function(){ +jQuery(document).ready(function(){ if ( !$('#details-page').length ){ return; } @@ -284,9 +282,6 @@ jQuery(document).on('ready', function(){ attribution: (nominatim_map_init.tile_attribution || null ) //'© OpenStreetMap contributors' }).addTo(map); - var osm2 = new L.TileLayer(nominatim_map_init.tile_url, {minZoom: 0, maxZoom: 13, attribution: (nominatim_map_init.tile_attribution || null )}); - var miniMap = new L.Control.MiniMap(osm2, {toggleDisplay: true}).addTo(map); - var layerGroup = new L.layerGroup().addTo(map); var circle = L.circleMarker([nominatim_result.lat,nominatim_result.lon], { radius: 10, weight: 2, fillColor: '#ff7800', color: 'blue', opacity: 0.75}); @@ -309,6 +304,8 @@ jQuery(document).on('ready', function(){ map.setView([nominatim_result.lat,nominatim_result.lon],10); } + var osm2 = new L.TileLayer(nominatim_map_init.tile_url, {minZoom: 0, maxZoom: 13, attribution: (nominatim_map_init.tile_attribution || null )}); + var miniMap = new L.Control.MiniMap(osm2, {toggleDisplay: true}).addTo(map); });