android-gmaps-addons icon indicating copy to clipboard operation
android-gmaps-addons copied to clipboard

MapBoxOfflineTileProvider doesn't show any tile

Open ugochirico opened this issue 7 years ago • 3 comments

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));

ugochirico avatar Jun 10 '17 14:06 ugochirico

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?

jrejaud avatar Sep 18 '17 20:09 jrejaud

I've done some more tinkering and found that I'm getting a ton of: D/skia: --- SkAndroidCodec::NewFromStream returned null in my logs.

jrejaud avatar Sep 19 '17 00:09 jrejaud

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

edwinckc avatar Feb 06 '18 06:02 edwinckc