From 53f4378325f30728cceeae8d149d69a74ca5556e Mon Sep 17 00:00:00 2001 From: Code WvS Date: Sun, 8 Mar 2015 10:09:15 +0100 Subject: make overpass query more usable by returning the list of elements --- threads.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'threads.js') diff --git a/threads.js b/threads.js index 06644f9..f8218c3 100644 --- a/threads.js +++ b/threads.js @@ -2692,8 +2692,8 @@ Process.prototype.focusMap = function (lon, lat, zoom) { // there is a library imported that uses this function. // TODO: Improve this :) // -// returns true if there are elements returned by the overpass query -Process.prototype.overpassQuerySucceeds = function (query) { +// returns elements returned by the overpass query +Process.prototype.overpassQuery = function (query) { var url = 'overpass-api.de/api/interpreter?data=[out:json];' + query; @@ -2706,7 +2706,7 @@ Process.prototype.overpassQuerySucceeds = function (query) { response = this.httpRequest.responseText; this.httpRequest = null; console.log(response); // DEBUG - return JSON.parse(response).elements.length > 0; + return new List(JSON.parse(response).elements); } this.pushContext('doYield'); this.pushContext(); -- cgit v1.3.1