突出显示地图中的建筑物。

huangapple go评论70阅读模式
英文:

Highlight buildings in a map

问题

我有一个需求,需要在地图上突出显示我当前位置周围的建筑物。我正在使用Xamarin,并想知道是否有人可以指向一个正确的库或控件,可以满足我的需求。
我目前正在使用Xamarin的Mapsui,但我不认为它具备我正在寻找的功能。

英文:

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.

答案1

得分: 1

如果您可以访问建筑物的几何信息,有多种方法可以实现高亮显示。

一种方法是创建一个位于背景图层之上的图层,其几何与数据源相同。使用ThemeStyle来仅显示选定的几何图形。ThemeStyle类是使用回调方法创建的,该方法确定样式。在该方法中,除非要素ID与选定要素ID相同,否则应返回无样式。

您可以查看ThemeStyle示例以了解主题的更一般用途(无高亮显示)。

此外,您可以查看Mapsui.Sample.Wpf.Editing。以下是该示例的屏幕截图:

突出显示地图中的建筑物。

英文:

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:
突出显示地图中的建筑物。

huangapple
  • 本文由 发表于 2020年1月6日 23:24:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/59614689.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定