2013-07-31 188 views
1

我想創建一個mapcontrol,我需要將當前的boundingrectangle拆分爲25塊,現在我意識到沒有像wp7版本那樣的boundingrectangle。Wp8地圖邊界矩形

我該如何解決這個問題?如果可能,我會避免使用諾基亞地圖。

回答

0
private LocationRectangle GetMapBounds() 
    { 
     GeoCoordinate topLeft = mapControl.ConvertViewportPointToGeoCoordinate(new Point(0, 0)); 
     GeoCoordinate bottomRight = mapControl.ConvertViewportPointToGeoCoordinate(new Point(mapControl.ActualWidth, mapControl.ActualHeight)); 

     if (topLeft != null && bottomRight != null) 
     { 
      return LocationRectangle.CreateBoundingRectangle(new[] { topLeft, bottomRight }); 
     } 

     return null; 
    }