From 5f970fe334c7c1bddd31b8098828df2c4174023c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 13 Mar 2014 19:28:45 +0000 Subject: [PATCH] Make overpass server URL configurable --- app/assets/javascripts/index/query.js | 2 +- app/assets/javascripts/osm.js.erb | 1 + config/example.application.yml | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/index/query.js b/app/assets/javascripts/index/query.js index 1a91c202c..bc4c26771 100644 --- a/app/assets/javascripts/index/query.js +++ b/app/assets/javascripts/index/query.js @@ -177,7 +177,7 @@ OSM.Query = function(map) { }); $.ajax({ - url: "http://overpass-api.de/api/interpreter", + url: OSM.OVERPASS_URL, method: "POST", data: { data: "[timeout:5][out:json];" + query, diff --git a/app/assets/javascripts/osm.js.erb b/app/assets/javascripts/osm.js.erb index 719c6b832..15c1682d5 100644 --- a/app/assets/javascripts/osm.js.erb +++ b/app/assets/javascripts/osm.js.erb @@ -8,6 +8,7 @@ OSM = { API_VERSION: <%= API_VERSION.to_json %>, STATUS: <%= STATUS.to_json %>, MAX_NOTE_REQUEST_AREA: <%= MAX_NOTE_REQUEST_AREA.to_json %>, + OVERPASS_URL: <%= OVERPASS_URL.to_json %>, apiUrl: function (object) { var url = "/api/" + OSM.API_VERSION + "/" + object.type + "/" + object.id; diff --git a/config/example.application.yml b/config/example.application.yml index d6a855ef5..702d411ba 100644 --- a/config/example.application.yml +++ b/config/example.application.yml @@ -84,6 +84,8 @@ defaults: &defaults require_terms_seen: false # Whether to require users to agree to the CTs before editing require_terms_agreed: false + # URL of Overpass instance to use for feature queries + overpass_url: http://overpass-api.de/api/interpreter development: <<: *defaults -- 2.43.2