如何从 Lat/Long 获取 Windows.Point

How to get Windows.Point from Lat/Long

我在 Windows 10 上使用 wpf 的 Bing 地图控件。给定一个 Lat/Long 位置,我需要获取该位置的 Windows.Point 值。它应该相对于地图本身,即左上角(0,0)。我使用 Map.ViewportPointToLocation 从鼠标位置转到相应的 Lat/Long。现在我需要反函数;我无法通过网络搜索找到任何内容。

试试地图 TryLocationToViewportPointLocationToViewportPoint 方法。

https://docs.microsoft.com/en-us/previous-versions/bing/wpf-control/hh709346(v=msdn.10)

https://docs.microsoft.com/en-us/previous-versions/bing/wpf-control/hh709336(v=msdn.10)