]> git.openstreetmap.org Git - rails.git/commitdiff
Allow credentials to be sent with overpass calls
authorTom Hughes <tom@compton.nu>
Thu, 13 Oct 2022 18:12:07 +0000 (19:12 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 13 Oct 2022 18:12:25 +0000 (19:12 +0100)
app/assets/javascripts/index/query.js
app/assets/javascripts/osm.js.erb
config/settings.yml

index 4b58e6f935b4d513974e0d522de118de707cdb29..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;
@@ -181,6 +182,9 @@ OSM.Query = function (map) {
       data: {
         data: "[timeout:10][out:json];" + query
       },
+      xhrFields: {
+        withCredentials: credentials
+      },
       success: function (results) {
         var elements;
 
index 3290b5e2cd22d5f2892ffa0602ca4599725a0bc8..352f5d48c468e07ba282e1fdadc1017db7b97325 100644 (file)
@@ -14,6 +14,7 @@ OSM = {
   STATUS:                  <%= Settings.status.to_json %>,
   MAX_NOTE_REQUEST_AREA:   <%= Settings.max_note_request_area.to_json %>,
   OVERPASS_URL:            <%= Settings.overpass_url.to_json %>,
+  OVERPASS_CREDENTIALS:    <%= Settings.overpass_credentials.to_json %>,
   NOMINATIM_URL:           <%= Settings.nominatim_url.to_json %>,
   GRAPHHOPPER_URL:         <%= Settings.graphhopper_url.to_json %>,
   FOSSGIS_OSRM_URL:        <%= Settings.fossgis_osrm_url.to_json %>,
index 9ff8a653b7e69423fb2dff11e47dd62b1d9e381c..09672c2c3a6565748d89be6f375055dbf99b9a0b 100644 (file)
@@ -95,6 +95,7 @@ imagery_blacklist:
   - ".*\\.here\\.com[/:].*"
 # URL of Overpass instance to use for feature queries
 overpass_url: "https://overpass-api.de/api/interpreter"
+overpass_credentials: false
 # Routing endpoints
 graphhopper_url: "https://graphhopper.com/api/1/route"
 fossgis_osrm_url: "https://routing.openstreetmap.de/"