mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
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:
parent
050a06b258
commit
9173d40fae
1 changed files with 8 additions and 0 deletions
|
|
@ -125,6 +125,7 @@ import org.osmdroid.events.MapEventsReceiver;
|
||||||
import org.osmdroid.events.MapListener;
|
import org.osmdroid.events.MapListener;
|
||||||
import org.osmdroid.events.ScrollEvent;
|
import org.osmdroid.events.ScrollEvent;
|
||||||
import org.osmdroid.events.ZoomEvent;
|
import org.osmdroid.events.ZoomEvent;
|
||||||
|
import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
|
||||||
import org.osmdroid.util.GeoPoint;
|
import org.osmdroid.util.GeoPoint;
|
||||||
import org.osmdroid.util.constants.GeoConstants;
|
import org.osmdroid.util.constants.GeoConstants;
|
||||||
import org.osmdroid.views.CustomZoomButtonsController;
|
import org.osmdroid.views.CustomZoomButtonsController;
|
||||||
|
|
@ -398,7 +399,14 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
presenter.setActionListeners(applicationKvStore);
|
presenter.setActionListeners(applicationKvStore);
|
||||||
org.osmdroid.config.Configuration.getInstance().load(this.getContext(),
|
org.osmdroid.config.Configuration.getInstance().load(this.getContext(),
|
||||||
PreferenceManager.getDefaultSharedPreferences(this.getContext()));
|
PreferenceManager.getDefaultSharedPreferences(this.getContext()));
|
||||||
|
|
||||||
|
mapView.setTileSource(TileSourceFactory.WIKIMEDIA); // Added tileSource - WIKIMEDIA
|
||||||
mapView.setTilesScaledToDpi(true);
|
mapView.setTilesScaledToDpi(true);
|
||||||
|
|
||||||
|
org.osmdroid.config.Configuration.getInstance().getAdditionalHttpRequestProperties().put(
|
||||||
|
"Referer", "http://maps.wikimedia.org/"
|
||||||
|
); // Added referer in the header
|
||||||
|
|
||||||
if (applicationKvStore.getString("LastLocation")
|
if (applicationKvStore.getString("LastLocation")
|
||||||
!= null) { // Checking for last searched location
|
!= null) { // Checking for last searched location
|
||||||
String[] locationLatLng = applicationKvStore.getString("LastLocation").split(",");
|
String[] locationLatLng = applicationKvStore.getString("LastLocation").split(",");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue