TilesOverlay showing tiles at wrong positions when scrolling the map
See original GitHub issueIssue Type
[x] Bug
Description and/or steps/code to reproduce the problem
I have written an app with a map component, based on osmdroid 6.1.2. As long as I use only one “basic map” (e.g. MAPNIK, HIKEBIKEMAP, OpenTopo, etc) everything is OK. But as soon as an additional TilesOverlay comes into play (e.g. PUBLIC_TRANSPORT) there is a very strange effect: When the map is zoomed or scrolled, suddenly appears a wild mixture of tiles from MAPNIK and PUBLIC_TRANSPORT at wrong positions, mainly on more or less empty regions, like the sea area. With every movement of the map, the picture changes unpredictable.
Here is a screenshot (North Sea area close to the coasts of the Netherlands and Germany), which demonstrates the effect. The dynamic behaviour during the scroll process can’t be visualized here, but the static conditions are clearly visible in the upper left region of the screen.
This effect remains, even after all tiles are downloaded completely - checked with TileStates.getUpToDate(); mapView.invalidate(); doesn’t help either.
Code snippets:
// create background map
mapView = (MapView) findViewById(R.id.mapview);
mapView.setTileSource(TileSourceFactory.MAPNIK);
// create overlay map
MapTileProviderBasic tileProvider = new MapTileProviderBasic(getApplicationContext());
tileProvider.setTileSource(TileSourceFactory.PUBLIC_TRANSPORT);
TilesOverlay tilesOverlay = new TilesOverlay(tileProvider, this.getBaseContext());
tilesOverlay.setLoadingBackgroundColor(Color.TRANSPARENT);
mapView.getOverlays().add(tilesOverlay);
// enable zoom
mapView.setMultiTouchControls(true);
mapView.setBuiltInZoomControls(false);
// initialize position + zoom level
IMapController mapController = mapView.getController();
GeoPoint geoPoint = new GeoPoint(53.6, 5.3); // north sea
mapController.setCenter(geoPoint);
mapController.setZoom(8.0);
and in the related layout.xml:
<org.osmdroid.views.MapView
android:id="@+id/mapview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Btw: Other overlay types, such as Copyright, ScaleBar, Grid, Compass, MiniMap, etc. don’t cause these problems.
Any ideas, where this effect comes from and how to repair it?
Environment
Tested on different devices with android versions from 4.0.3, 4.1.2, 4.4.2, 8.0 up to 9.0, no difference concerning the effect
Version of osmdroid the issue relates to:
6.1.2
Issue Analytics
- State:
- Created 4 years ago
- Comments:36 (2 by maintainers)
@spyhunter99 Thank you for release 6.1.6! @mikebravoyes Please test and close the issue if relevant.
I can cut one today
On Sat, Mar 7, 2020, 11:41 AM Michael L. Braun notifications@github.com wrote: