android-gmaps-addons
android-gmaps-addons copied to clipboard
MapBoxOfflineTileProvider doesn't show any tile
I downloaded the mbtiles from OpenMapTile: https://openmaptiles.org/downloads/ Then I used MapBoxOfflineTileProvider with such a tile database but I see a blank map. No tiles is shown even if in debug I can see that getTile is called and a valid (seems valid) byte[] for the image is returned. I'm trying with Android 7.0 on Nexus 6
This is the piece of code I used:
String dbPath = getApplicationContext().getExternalFilesDir(Environment.getDataDirectory().getAbsolutePath()).getAbsolutePath() + "/database/italy.mbtiles";
offlineTileProvider = new MapBoxOfflineTileProvider(dbPath);
mTiles = mMap.addTileOverlay(new TileOverlayOptions().tileProvider(offlineTileProvider));
Hi @ugochirico,
I've also run into this issue, with a valid byte array size for the resource that I'm accessing, have you managed to resolve the issue on your end?
I've done some more tinkering and found that I'm getting a ton of:
D/skia: --- SkAndroidCodec::NewFromStream returned null
in my logs.
In case this helps anyone... I was using this code, and also ran into the above message (NewFromStream returned null). That was using a file downloaded from OpenMapTile as well.
However, using the file provided by our client, I was able to add the tile overlay just fine, even setting transparency to overlay on the base map.
I'd guess it's a formatting issue... =/
Also see: Format issue when loading new MBTiles with ODK Collect app