Mapsui Offline Map
See original GitHub issueHi pauldendulk,
first of all i would like to for your amazing job with Mapsui. I succesfully implemented your Mapsui in my project and everything is working fine. But my question is, and the next step in development of my App, is there possibility to load offline Map (is it mbtiles?) in Mapsui? I downloaded my mbtiles and succesfully loaded these mbtiles with “MbTilesTileSource” from Brutile and than created “VectorTileLayer” with this mbtile Source and added this Layer to the map. In Debug is everything fine. Mbtile has been loaded, layer created, datas are there but on the screen I see nothing. Just the white background screen and when I zoom it multiple times it crashes with unhandled exception. Am I doing it right ? Or if not can you give example, sample or anything how to load offline map in Mapsui? Here my code to create layer:
public static ILayer CreateTileLayer(string path) { var tileSource = new MbTilesTileSource(new SQLiteConnectionString(path, false), type: MbTilesType.BaseLayer); return new VectorTileLayer(tileSource) { Name = "MbTiles" }; }
Thank you for your time and answer.
Michal
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (10 by maintainers)
Top Related StackOverflow Question
You can also get a certain map extent offline programmatically. The basic approach is (in C#):
Basically you use the same methods that are normally used under the bonnet while zooming and panning a map. Therefore, compatability of the data is self-evident and you don’t need external tools. To use this correctly, you need to know the bounding box of the map area you need and the zoom level you want, so maybe you need some others websites or tools to determine these values in the language that Mapsui expects.
I haven’t been working on my app the last few weeks, so not really paying much attention to github, sorry for that. I use OpenStreetMap and basically get the tile layer with this code (step 1 of my previous post):
using Mapsui.Layers;using Mapsui.Utilities;…TileLayer tileLayer = OpenStreetMap.CreateTileLayer();HttpTileSource tileSource = tileLayer.TileSource as HttpTileSource;