]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/query.js
Work around upcoming minitest insanity
[rails.git] / app / assets / javascripts / index / query.js
index 1e1dc2ed1b4c35cf7ade2ded44e760be3182a86d..023e2a7f22069bba02babd5542246f0e711f0228 100644 (file)
@@ -179,7 +179,7 @@ OSM.Query = function(map) {
       url: url,
       method: "POST",
       data: {
-        data: "[timeout:5][out:json];" + query,
+        data: "[timeout:10][out:json];" + query,
       },
       success: function(results) {
         var elements;
@@ -189,6 +189,9 @@ OSM.Query = function(map) {
         if (merge) {
           elements = results.elements.reduce(function (hash, element) {
             var key = element.type + element.id;
+            if ("geometry" in element) {
+              delete element.bounds;
+            }
             hash[key] = $.extend({}, hash[key], element);
             return hash;
           }, {});
@@ -223,6 +226,12 @@ OSM.Query = function(map) {
           }
         }
 
+        if (results.remark) {
+          $("<li>")
+            .text(I18n.t("javascripts.query.error", { server: url, error: results.remark }))
+            .appendTo($ul);
+        }
+
         if ($ul.find("li").length === 0) {
           $("<li>")
             .text(I18n.t("javascripts.query.nothing_found"))