如何从纬度/经度获取Windows.Point

问题描述

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

解决方法

尝试使用地图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)