diff --git a/app/src/main/java/de/westnordost/streetcomplete/Prefs.java b/app/src/main/java/de/westnordost/streetcomplete/Prefs.java index ed9fd28e91..60be5925d4 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/Prefs.java +++ b/app/src/main/java/de/westnordost/streetcomplete/Prefs.java @@ -16,7 +16,9 @@ public class Prefs AUTOSYNC = "autosync", KEEP_SCREEN_ON = "display.keepScreenOn", UNGLUE_HINT_TIMES_SHOWN = "unglueHint.shown", - THEME_SELECT = "theme.select"; + THEME_SELECT = "theme.select", + OVERPASS_URL = "overpass_url"; + // not shown anywhere directly public static final String diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/OsmModule.java b/app/src/main/java/de/westnordost/streetcomplete/data/OsmModule.java index 13b1fe6c94..de2cec138b 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/OsmModule.java +++ b/app/src/main/java/de/westnordost/streetcomplete/data/OsmModule.java @@ -1,9 +1,11 @@ package de.westnordost.streetcomplete.data; import android.content.Context; +import android.content.SharedPreferences; import java.io.File; +import javax.inject.Inject; import javax.inject.Named; import javax.inject.Provider; import javax.inject.Singleton; @@ -12,6 +14,7 @@ import dagger.Provides; import de.westnordost.osmapi.user.UserDao; import de.westnordost.streetcomplete.ApplicationConstants; +import de.westnordost.streetcomplete.Prefs; import de.westnordost.streetcomplete.data.osm.OsmQuestGiver; import de.westnordost.streetcomplete.data.osm.download.ElementGeometryCreator; import de.westnordost.streetcomplete.data.osm.download.OsmApiWayGeometrySource; @@ -40,7 +43,7 @@ public class OsmModule { public static final String OSM_API_URL = "https://api.openstreetmap.org/api/0.6/", - OVERPASS_API_URL = "https://overpass-api.de/api/", + OVERPASS_API_WITH_ATTIC_DATA_URL = "https://overpass-api.de/api/", ONEWAY_API_URL = "https://www.westnordost.de/streetcomplete/oneway-data-api/"; @@ -62,10 +65,10 @@ public static OsmConnection osmConnection(OAuthConsumer consumer) } @Provides public static OverpassMapDataDao overpassMapDataDao( - Provider parserProvider) + Provider parserProvider, SharedPreferences prefs) { OsmConnection overpassConnection = new OsmConnection( - OVERPASS_API_URL, ApplicationConstants.USER_AGENT, null); + prefs.getString(Prefs.OVERPASS_URL, OVERPASS_API_WITH_ATTIC_DATA_URL), ApplicationConstants.USER_AGENT, null); return new OverpassMapDataDao(overpassConnection, parserProvider); } @@ -73,7 +76,7 @@ public static OsmConnection osmConnection(OAuthConsumer consumer) Provider parserProvider, String date) { OsmConnection overpassConnection = new OsmConnection( - OVERPASS_API_URL, ApplicationConstants.USER_AGENT, null); + OVERPASS_API_WITH_ATTIC_DATA_URL, ApplicationConstants.USER_AGENT, null); return new OverpassOldMapDataDao(overpassConnection, parserProvider, date); } diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index cb682becf7..84321eefb1 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -24,4 +24,13 @@ DARK + + "https://overpass-api.de/api/" + "https://overpass.kumi.systems/api/" + + + + "https://overpass-api.de/api/" + "https://overpass.kumi.systems/api/" + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1d02a3f9df..e85444a48d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -649,6 +649,8 @@ Otherwise, you can download another keyboard in the app store. Popular keyboards Light Dark System default + Change Overpass server + may bypass censorship, for example in Russia This street was tagged as having no sidewalk on either side. In the case that there is a sidewalk after all but it is displayed as a separate way, please answer \"sidewalk\". Open location in another app No other map application installed diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index eae8c70aa8..7f08d9ca33 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -104,6 +104,15 @@ android:title="@string/pref_title_quests_restore_hidden" /> +