2016-01-08 47 views
0

根据this MSDN页面,有一种很好的方法可以找到Bing地图的边界框的边角坐标,直到Windows 8为止。链接中提到的函数是LocationRectangleBing地图UWP的边界框

我们正在开发适用于Windows 10的通用应用程序,似乎无法获得边界框。有没有使我们能够这样做的图书馆或插件?还是有一个我们失踪的功能?

回答

1

您可以使用GetLocationFromOffset函数。使用这个视图的每个角落将给你相同的结果。

MSDN link

+0

我会如何找到角落?另外,文档没有多少解释;你能详细说明吗? – Ranveer

+1

偏移距离地图中心点的偏移量。例如,您可以通过调用map.GetLocationFromOffset(new Point(-map.width/2,-map.height/2,out yourGeoPoint)和bottomRight通过调用map.GetLocationFromOffset(new Point(map.width/2,map.height/2,out yourGeoPoint) –

+0

另请参阅这些问题和答案: http://stackoverflow.com/questions/24468236/get-view-bounds-of-a-map http:// stackoverflow.com/questions/34688496/get-distance-of-mapcontrol-border-in-degrees –

-1

有什么不对下面? (区域由GeoBoundingBox

area.NorthwestCorner.Latitude, 
area.NorthwestCorner.Longitude, 
area.SoutheastCorner.Latitude, 
area.SoutheastCorner.Longitude 

https://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.geolocation.geoboundingbox.northwestcorner.aspx

还是不够?

+0

你是如何计算'area'变量的? – Ranveer

+0

以为你有这个;)但也许这可以帮助https:// github。 com/LocalJoost/WpWinNl/blob/uwp/uap10.0/WpWinNl.Maps/MapExtensions.cs – Depechie

+0

等等,GeoBoundingBox是一个内置的类,我想不是。 – Ranveer