【问题标题】:Wp8 maps bounding rectangleWp8映射边界矩形
【发布时间】:2026-02-23 17:15:01
【问题描述】:

我正在尝试创建一个地图控件,我需要将当前的boundingrectangle分成25块,现在我意识到没有像wp7版本那样的boundingrectangle。

我该如何解决这个问题呢?如果可能,我会避免使用诺基亚地图。

【问题讨论】:

    标签: windows-phone-8 maps rectangles bounding-box bounding


    【解决方案1】:
        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;
        }
    

    【讨论】: