unable to load offline map using Mapsui, using world.mbtiles

835 Views Asked by At

var layer = new TileLayer(new MbTilesTileSource(new SQLiteConnectionString(dbPath,true), null, MbTilesType.None, true, true)); and adding this layer to map

1

There are 1 best solutions below

0
On

The Mapsui repository has a working sample that shows the world.mbtiles. You could start from that working sample and work towards your own application in steps.

Clone the Mapsui repository. Set Mapsui.Samples.Wpf (or one of the other sample projects) as startup project. Run, select the 'Data' category at the top left, and it will show the mbtiles map.

Note, that the wpf sample has the world.mbtiles included with Build Action as 'Content' and Copy to Output Directory as 'Copy if Newer'. Deployment of the mbtiles file to the right location could be your problem.