I am using osmdroid version 5.6.5 (the latest version), and the tiles of the map (MAPNIK) loads extremely slowly.
This happens on two devices I tried the app on, both with high-speed internet connection (both cellular and WIFI).
It seems like a problem somewhere because there is no way the loading should be that slow
This is the code snippet with the map in the Activity:
@Override
protected void onCreate( Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
appContext = getApplicationContext();
//important! set your user agent to prevent getting banned from the osm servers
Configuration.getInstance().load(appContext, PreferenceManager.getDefaultSharedPreferences(appContext));
setContentView(R.layout.navigation);
mMapView = (MapView) findViewById(map);
mMapView.setTileSource(TileSourceFactory.MAPNIK);
mMapView.setMultiTouchControls(true);
mMapView.setBuiltInZoomControls(true);
// add rotation gesture
mRotationGestureOverlay = new RotationGestureOverlay(this, mMapView);
mRotationGestureOverlay.setEnabled(true);
mMapView.setMultiTouchControls(true);
mMapView.getOverlays().add(this.mRotationGestureOverlay);
// Set to default location
IMapController mapController = mMapView.getController();
mapController.setZoom(15);
GeoPoint startPoint = new GeoPoint(48.8589654,2.2926013);
mapController.setCenter(startPoint);
}
I can't seem to find the reason for this slow load. Is there an option to use a simpler map? will that help? Are there any other solutions, something I'm doing wrong?
Thanks.
Try to set the userAgentValue in your Application:
Configuration.getInstance().setUserAgentValue(BuildConfig.APPLICATION_ID);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With