X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6d124f801224ee441dbb7e67b912b8689cab6dfb..996d5413d85e4d38d33ac3827a1fc853ba9d0149:/app/assets/javascripts/index/query.js diff --git a/app/assets/javascripts/index/query.js b/app/assets/javascripts/index/query.js index 9e82aa496..333fce549 100644 --- a/app/assets/javascripts/index/query.js +++ b/app/assets/javascripts/index/query.js @@ -259,8 +259,8 @@ OSM.Query = function(map) { * for each object. */ function queryOverpass(lat, lng) { - var latlng = L.latLng(lat, lng), - bounds = map.getBounds(), + var latlng = L.latLng(lat, lng).wrap(), + bounds = map.getBounds().wrap(), bbox = bounds.getSouth() + "," + bounds.getWest() + "," + bounds.getNorth() + "," + bounds.getEast(), radius = 10 * Math.pow(1.5, 19 - map.getZoom()), around = "around:" + radius + "," + lat + "," + lng, @@ -293,8 +293,9 @@ OSM.Query = function(map) { function clickHandler(e) { var precision = OSM.zoomPrecision(map.getZoom()), - lat = e.latlng.lat.toFixed(precision), - lng = e.latlng.lng.toFixed(precision); + latlng = e.latlng.wrap(), + lat = latlng.lat.toFixed(precision), + lng = latlng.lng.toFixed(precision); OSM.router.route("/query?lat=" + lat + "&lon=" + lng); }