Skip to content

Commit 9173d40

Browse files
committed
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.
1 parent 050a06b commit 9173d40

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java

+8
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
import org.osmdroid.events.MapListener;
126126
import org.osmdroid.events.ScrollEvent;
127127
import org.osmdroid.events.ZoomEvent;
128+
import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
128129
import org.osmdroid.util.GeoPoint;
129130
import org.osmdroid.util.constants.GeoConstants;
130131
import org.osmdroid.views.CustomZoomButtonsController;
@@ -398,7 +399,14 @@ public void onViewCreated(@NonNull final View view, @Nullable final Bundle saved
398399
presenter.setActionListeners(applicationKvStore);
399400
org.osmdroid.config.Configuration.getInstance().load(this.getContext(),
400401
PreferenceManager.getDefaultSharedPreferences(this.getContext()));
402+
403+
mapView.setTileSource(TileSourceFactory.WIKIMEDIA); // Added tileSource - WIKIMEDIA
401404
mapView.setTilesScaledToDpi(true);
405+
406+
org.osmdroid.config.Configuration.getInstance().getAdditionalHttpRequestProperties().put(
407+
"Referer", "http://maps.wikimedia.org/"
408+
); // Added referer in the header
409+
402410
if (applicationKvStore.getString("LastLocation")
403411
!= null) { // Checking for last searched location
404412
String[] locationLatLng = applicationKvStore.getString("LastLocation").split(",");

0 commit comments

Comments
 (0)