1

For a project, i'd like to save a part of a map and use it when i'm offline.

I'd like to know if it is possible to save a part of map using Mapsui ?

I already search but I didn't found something good..

Alex
  • 15
  • 4

1 Answers1

1

If it is just the image of the map you could look at the test file 'MapRendererTests.cs'. It shows how you can save a map extent as an image.

var bitmap = new MapRenderer().RenderToBitmapStream(viewport, map.Layers, map.BackColor);

There is no support for saving the geometries themselves.

pauldendulk
  • 1,378
  • 12
  • 23
  • Is there a way to save polygons drawn over the map. I used the Polygons contained in Mapsui.UI.Forms namespace. – Bryan Noronha Jan 10 '20 at 19:19
  • @BryanNoronha You are trying to save the map view as image and the forms' polygons are missing? – pauldendulk Jan 11 '20 at 06:39
  • I believe Mapsui doesn't save the polygons drawn on top of the map. I was reading the docs and I came across a comment that said Mapsui doesnt support saving polygons and other shapes drawn on top of the map. – Bryan Noronha Jan 13 '20 at 13:45
  • The shapes drawn on top of the map with XF elements are not but it is also possible to draw points lines and polygons with 'native' Mapsui geometries. – pauldendulk Jan 13 '20 at 13:50