Commit 4cd0cb02 authored by Evan W. Patton's avatar Evan W. Patton Committed by Jeffrey Schiller

Use per-app User-Agent for OpenStreetMap (#1582)

Change-Id: I9409f6f3f503d467b6014461d51c6f213dcb76ff
parent c98261fe
......@@ -49,6 +49,7 @@ import org.osmdroid.events.MapListener;
import org.osmdroid.events.ScrollEvent;
import org.osmdroid.events.ZoomEvent;
import org.osmdroid.tileprovider.MapTile;
import org.osmdroid.tileprovider.constants.OpenStreetMapTileProviderConstants;
import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
import org.osmdroid.util.BoundingBox;
import org.osmdroid.util.GeoPoint;
......@@ -263,6 +264,7 @@ class NativeOpenStreetMapController implements MapController, MapListener {
private final AppInventorLocationSensorAdapter locationProvider;
NativeOpenStreetMapController(final Form form) {
OpenStreetMapTileProviderConstants.setUserAgentValue(form.getApplication().getPackageName());
File osmdroid = new File(form.getCacheDir(), "osmdroid");
if (osmdroid.exists() || osmdroid.mkdirs()) {
Configuration.getInstance().setOsmdroidBasePath(osmdroid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment