Skip to content

Commit 3083a55

Browse files
Reworded comments
1 parent 9173d40 commit 3083a55

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

+6-2
Original file line numberDiff line numberDiff line change
@@ -400,12 +400,16 @@ public void onViewCreated(@NonNull final View view, @Nullable final Bundle saved
400400
org.osmdroid.config.Configuration.getInstance().load(this.getContext(),
401401
PreferenceManager.getDefaultSharedPreferences(this.getContext()));
402402

403-
mapView.setTileSource(TileSourceFactory.WIKIMEDIA); // Added tileSource - WIKIMEDIA
403+
// Use the Wikimedia tile server, rather than OpenStreetMap (Mapnik) which has various
404+
// restrictions that we do not satisfy.
405+
mapView.setTileSource(TileSourceFactory.WIKIMEDIA);
404406
mapView.setTilesScaledToDpi(true);
405407

408+
// Add referer HTTP header because the Wikimedia tile server requires it.
409+
// This was suggested by Dmitry Brant within an email thread between us and WMF.
406410
org.osmdroid.config.Configuration.getInstance().getAdditionalHttpRequestProperties().put(
407411
"Referer", "http://maps.wikimedia.org/"
408-
); // Added referer in the header
412+
);
409413

410414
if (applicationKvStore.getString("LastLocation")
411415
!= null) { // Checking for last searched location

0 commit comments

Comments
 (0)