xamarin.formsmapsui

Mapsui adding map pins in Xamarin Forms



I need to add a bunch of pins on a MapsUI map control that uses OpenStreetMap tiles.

The problem is I cant find anything mentioning pins in their documentation so my question is:

Are there any pins available but have different names or i have to draw pins myself (using Geometry and Points as in some examples i found) and if so how do i keep them the same size when zooming the map ?

Maybe someone can point out where should i look in their documentation in case I'm blind and missed it.

Thanks!


Solution

  • The idea is that you use your own bitmaps to draw as 'pins'.

    Mapsui has features. A feature has a geometry which can be a point, linestring and polygon (and some others). A feature is drawn with some kind of style. What you need to do is create features with point geometry and use a symbolstyle with a bitmap as symbol. You need to register your bitmap and use the bitmapId in the symbol. See the sample here:

    https://github.com/Mapsui/Mapsui/blob/master/Samples/Mapsui.Samples.Common/Maps/PointsSample.cs