Overpass query to use map precision
This commit is contained in:
parent
06957c3479
commit
549be4adba
1 changed files with 5 additions and 1 deletions
|
@ -284,7 +284,11 @@ OSM.Query = function (map) {
|
||||||
function queryOverpass(lat, lng) {
|
function queryOverpass(lat, lng) {
|
||||||
var latlng = L.latLng(lat, lng).wrap(),
|
var latlng = L.latLng(lat, lng).wrap(),
|
||||||
bounds = map.getBounds().wrap(),
|
bounds = map.getBounds().wrap(),
|
||||||
bbox = bounds.getSouth() + "," + bounds.getWest() + "," + bounds.getNorth() + "," + bounds.getEast(),
|
precision = OSM.zoomPrecision(map.getZoom()),
|
||||||
|
bbox = bounds.getSouth().toFixed(precision) + "," +
|
||||||
|
bounds.getWest().toFixed(precision) + "," +
|
||||||
|
bounds.getNorth().toFixed(precision) + "," +
|
||||||
|
bounds.getEast().toFixed(precision),
|
||||||
radius = 10 * Math.pow(1.5, 19 - map.getZoom()),
|
radius = 10 * Math.pow(1.5, 19 - map.getZoom()),
|
||||||
around = "around:" + radius + "," + lat + "," + lng,
|
around = "around:" + radius + "," + lat + "," + lng,
|
||||||
nodes = "node(" + around + ")",
|
nodes = "node(" + around + ")",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue