Simplify overpass query for nearby objects

This commit is contained in:
Tom Hughes 2014-03-17 09:14:42 +00:00
parent d5fdc0855a
commit 03f3fd5954

View file

@ -213,8 +213,10 @@ OSM.Query = function(map) {
var latlng = L.latLng(lat, lng), var latlng = L.latLng(lat, lng),
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,
features = "(node(" + around + ");way(" + around + ");relation(" + around + "))", nodes = "node(" + around + ")",
nearby = "((" + features + ";way(bn));node(w));out;", ways = "way(" + around + ");node(w)",
relations = "relation(" + around + ")",
nearby = "(" + nodes + ";" + ways + ";" + relations + ");out;",
isin = "is_in(" + lat + "," + lng + ")->.a;(relation(pivot.a);way(pivot.a);node(w));out;"; isin = "is_in(" + lat + "," + lng + ")->.a;(relation(pivot.a);way(pivot.a);node(w));out;";
$("#sidebar_content .query-intro") $("#sidebar_content .query-intro")