Hello,
The problem is probably not in the file, but how you use it. Xamarin sample as it is uses MBTiles in special way - not as map layer directly, but as part of VectorTileLayer (PackageManagerTileDataSource), and this way you can use only vector-based MBTiles files. If you look to code, then the file is imported to PackageManager. You have raster-based MBTiles, and you need it to add it to assets, and then in code to Map as a RasterTileLayer:
string importMBtilesPath = AssetUtils.CalculateResourcePath ("world_countries.mbtiles");
var mbLayer = new RasterTileLayer (new MBTilesTileDataSource (importMBtilesPath));
Map.Layers.Add(mbLayer);
This is iOS code, for Android only difference is how you find path for the file. In fact, in Andoid you would need to copy the file to device storage first, it cannot be used directly from assets as there is no random read access to it.
See my screenshot in attachment. It has another issue: sea part is not blue, but transparent. To make it nicer you would need to set map background bitmap. It can be simply totally white:
Map.Options.BackgroundBitmap = null;
Or use some image, e.g. here is 16x16 bitmap - see second attached screenshot
UnsignedCharVector backgroundWaterBytes = AssetUtils.LoadBytes("water.png");
var backgroundWater = new Bitmap (backgroundWaterBytes, true);
Map.Options.BackgroundBitmap = backgroundWater;
p.s. what do you mean by bordered/bounced .mbtiles ?
Jaak
Nutiteq
Hi Jaak,
Also a bordered/bounced .mbtiles file didn't work. Do you know any tools besides MapTiler, TileMill and MapBox Studio to create valid .mbtiles that works with NutiteqMaps? I'm trying to generate a .mbtiles file of the city Antwerp (Belgium).
Thanks!
Regards,
Yakup