Get view bounds of a Map

后端 未结 2 1379
無奈伤痛
無奈伤痛 2020-12-10 21:59

I\'m developing a Windows Phone 8.1 app that works with Bing Maps. During the rendering of this map I use the TrySetViewBoundsAsync to set correctly my custom

2条回答
  •  有刺的猬
    2020-12-10 22:14

    Note that rbrundritt's solution will not work for oblique (tilted) views. In that case, the visible region resembles more an inverted trapezoid than a bounding box. Also the top-left corner might not be a valid location if the horizon is visible.

    For Windows 10 Anniversary Update (version 1607), the MapControl supports a new method GetVisibleRegion() to help you with this.

    The following should return you the view bounds of the map:

    map.GetVisibleRegion(MapVisibleRegionKind.Full)
    

    See the MapControl documentation for more details.

提交回复
热议问题