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.
This commit is contained in:
Rohit Verma 2024-01-03 13:34:43 +05:30
parent 050a06b258
commit 9173d40fae

View file

@ -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(",");