From 03f3fd59540ae27b862df02dcc71d38e6e70ef94 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 17 Mar 2014 09:14:42 +0000 Subject: [PATCH] Simplify overpass query for nearby objects --- app/assets/javascripts/index/query.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/index/query.js b/app/assets/javascripts/index/query.js index f2281d007..8e0e0dae5 100644 --- a/app/assets/javascripts/index/query.js +++ b/app/assets/javascripts/index/query.js @@ -213,8 +213,10 @@ OSM.Query = function(map) { var latlng = L.latLng(lat, lng), radius = 10 * Math.pow(1.5, 19 - map.getZoom()), around = "around:" + radius + "," + lat + "," + lng, - features = "(node(" + around + ");way(" + around + ");relation(" + around + "))", - nearby = "((" + features + ";way(bn));node(w));out;", + nodes = "node(" + around + ")", + 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;"; $("#sidebar_content .query-intro") -- 2.43.2