]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/query.js
Merge remote-tracking branch 'upstream/pull/3770'
[rails.git] / app / assets / javascripts / index / query.js
index b64bccd6464eddd6ee0397f53aa0b67b60575f4e..d1668f247351fd5d1fa5d77496eb56119d55c122 100644 (file)
@@ -3,6 +3,7 @@
 
 OSM.Query = function (map) {
   var url = OSM.OVERPASS_URL,
+      credentials = OSM.OVERPASS_CREDENTIALS,
       queryButton = $(".control-query .control-button"),
       uninterestingTags = ["source", "source_ref", "source:ref", "history", "attribution", "created_by", "tiger:county", "tiger:tlid", "tiger:upload_uuid", "KSJ2:curve_id", "KSJ2:lat", "KSJ2:lon", "KSJ2:coordinate", "KSJ2:filename", "note:ja"],
       marker;
@@ -103,8 +104,8 @@ OSM.Query = function (map) {
         value = tags[key];
 
         if (prefixes[key]) {
-          var first = value.substr(0, 1).toUpperCase(),
-              rest = value.substr(1).replace(/_/g, " ");
+          var first = value.slice(0, 1).toUpperCase(),
+              rest = value.slice(1).replace(/_/g, " ");
 
           return first + rest;
         }
@@ -181,6 +182,9 @@ OSM.Query = function (map) {
       data: {
         data: "[timeout:10][out:json];" + query
       },
+      xhrFields: {
+        withCredentials: credentials
+      },
       success: function (results) {
         var elements;