Wp8 maps bounding rectangle

693 Views Asked by At

I'm trying to create a mapcontrol, and I would need to split the current boundingrectangle into 25 pieces, and now I realized there is no boundingrectangle like it was in the wp7 version.

How do I solve this problem than? I would avoid using Nokia maps if possible.

1

There are 1 best solutions below

0
On
    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;
    }