Detect if the OSM Mapview is still loading or not in android
Take a look at TilesOverlay
and the TileLooper
implementation. This is what we use to load and then draw each tile on the screen. In handleTile(...)
we attempt to get the tile from the tile provider mTileProvider.getMapTile(pTile)
. If that returns a Drawable
then the tile is loaded, if not it will return null
.
A simple way to do this is to extend TilesOverlay
, override drawTiles(...)
and call your own TileLooper
before calling super.drawTiles(...)
that will check to see if all the tiles that get passed to handleTile(...)
are not null. To use your TilesOverlay call mMapView.getOverlayManager().setTilesOverlay(myTilesOverlay)
.