0

I have a requirement where I need to highlight the buildings around my current location on a map. I am using Xamarin and was wondering if anyone can point me to a correct library or control that can fulfill my requirement. I am currently using Mapsui for Xamarin but I don't think it has the feature I am looking for.

  • Mapsui seems to only work with tiles, so highlighting the buildings would have to be done by the server. No fun. – JRE Jan 06 '20 at 16:49
  • Can Idea which library or feature can do that? – Bryan Noronha Jan 06 '20 at 19:06
  • @Bryan, highlight the buildings around my current location on a map, I don't find a way to do this, as JRE said that highlighting the buildings would have to be done by the server, but you can add a circular overlay to a map, to highlight a circular area of the map, there is one article that you can take a look:https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/map/circle-map-overlay – Cherry Bu - MSFT Jan 07 '20 at 02:40
  • @JRE Mapsui has support for geometries as well. Raster tiles are just one possible data type. – pauldendulk Jan 08 '20 at 08:11

1 Answers1

1

If you have access to the geometries of the buildings there are many ways you could implement highlighting.

One way that comes to mind. Create a layer on top of your background layer with the same geometries as data source. Use a ThemeStyle to show only the selected geometry. The ThemeStyle class is created with a callback method which determines the style. In that method you should return no style unless the feature id is the same as selected feature id.

You can take a look at the ThemeStyle sample for a more general use of themes (no highlighting).

Also you could look at Mapsui.Sample.Wpf.Editing. Here is a screenshot of that sample: enter image description here

pauldendulk
  • 1,378
  • 12
  • 23