From 9173d40faed95b7fa08177d9d691a09aa20792e5 Mon Sep 17 00:00:00 2001 From: Rohit Verma Date: Wed, 3 Jan 2024 13:34:43 +0530 Subject: [PATCH] NearbyParentFragment : added referer In file NearbyParentFragment.java, I added header property, i.e., the referer - http://maps.wikimedia.org/ and set tile source to wikimedia. --- .../commons/nearby/fragments/NearbyParentFragment.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 0389a7358..470ac1a3b 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 @@ -125,6 +125,7 @@ import org.osmdroid.events.MapEventsReceiver; import org.osmdroid.events.MapListener; import org.osmdroid.events.ScrollEvent; import org.osmdroid.events.ZoomEvent; +import org.osmdroid.tileprovider.tilesource.TileSourceFactory; import org.osmdroid.util.GeoPoint; import org.osmdroid.util.constants.GeoConstants; import org.osmdroid.views.CustomZoomButtonsController; @@ -398,7 +399,14 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment presenter.setActionListeners(applicationKvStore); org.osmdroid.config.Configuration.getInstance().load(this.getContext(), PreferenceManager.getDefaultSharedPreferences(this.getContext())); + + mapView.setTileSource(TileSourceFactory.WIKIMEDIA); // Added tileSource - WIKIMEDIA mapView.setTilesScaledToDpi(true); + + 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 String[] locationLatLng = applicationKvStore.getString("LastLocation").split(",");