From 6a60e51477ae17a1306c307c7550664ec181ef85 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Mon, 16 Mar 2015 20:29:12 +0100 Subject: Change the way Level0 editor is called. We used to call the Overpass API and get all object IDs and then send those object IDs to Level0. But Level0 can directly use an Overpass URL. This removes an extra step and makes everything faster. Fixes #118. --- web/public/js/taginfo.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/web/public/js/taginfo.js b/web/public/js/taginfo.js index 8a5894e..22cb324 100644 --- a/web/public/js/taginfo.js +++ b/web/public/js/taginfo.js @@ -573,15 +573,9 @@ function level0_editor(overpass_url_prefix, level0_url_prefix, filter, key, valu query = '(node' + query + 'way' + query + 'rel' + query + ');'; } - var overpass_url = overpass_url_prefix + 'data=[out:json];' + query + 'out body;'; - - jQuery.getJSON(overpass_url, function(data) { - var objects = jQuery.map(data.elements, function(el) { - return el.type.substr(0,1) + el.id + (el.type == 'way' ? '!' : ''); - }); - var level0_url = level0_url_prefix + 'url=' + objects.join(','); - window.open(level0_url, '_blank'); - }); + var overpass_url = overpass_url_prefix + 'data=' + encodeURIComponent('[out:xml];' + query + 'out meta;'); + var level0_url = level0_url_prefix + 'url=' + encodeURIComponent(overpass_url); + window.open(level0_url, '_blank'); return false; } -- cgit v1.2.3