From 3083a55bf537d6e75c365e4d06d30632880a4623 Mon Sep 17 00:00:00 2001 From: Nicolas Raoul Date: Wed, 3 Jan 2024 22:01:22 +0900 Subject: [PATCH] Reworded comments --- .../commons/nearby/fragments/NearbyParentFragment.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java b/app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java index 470ac1a3b..b03d693f2 100644 --- a/app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java @@ -400,12 +400,16 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment org.osmdroid.config.Configuration.getInstance().load(this.getContext(), PreferenceManager.getDefaultSharedPreferences(this.getContext())); - mapView.setTileSource(TileSourceFactory.WIKIMEDIA); // Added tileSource - WIKIMEDIA + // Use the Wikimedia tile server, rather than OpenStreetMap (Mapnik) which has various + // restrictions that we do not satisfy. + mapView.setTileSource(TileSourceFactory.WIKIMEDIA); mapView.setTilesScaledToDpi(true); + // Add referer HTTP header because the Wikimedia tile server requires it. + // This was suggested by Dmitry Brant within an email thread between us and WMF. org.osmdroid.config.Configuration.getInstance().getAdditionalHttpRequestProperties().put( "Referer", "http://maps.wikimedia.org/" - ); // Added referer in the header + ); if (applicationKvStore.getString("LastLocation") != null) { // Checking for last searched location