Back to Devexpress

MapControl.ZoomToRegion(CoordPoint, CoordPoint, Double) Method

wpf-devexpress-dot-xpf-dot-map-dot-mapcontrol-dot-zoomtoregion-x28-devexpress-dot-map-dot-coordpoint-devexpress-dot-map-dot-coordpoint-system-dot-double-x29.md

latest2.7 KB
Original Source

MapControl.ZoomToRegion(CoordPoint, CoordPoint, Double) Method

Zooms to the region described by its top left and bottom right points.

Namespace : DevExpress.Xpf.Map

Assembly : DevExpress.Xpf.Map.v25.2.dll

NuGet Package : DevExpress.Wpf.Map

Declaration

csharp
public void ZoomToRegion(
    CoordPoint p1,
    CoordPoint p2,
    double paddingFactor = 0.15
)
vb
Public Sub ZoomToRegion(
    p1 As CoordPoint,
    p2 As CoordPoint,
    paddingFactor As Double = 0.15
)

Parameters

NameTypeDescription
p1CoordPoint

A GeoPoint object.

| | p2 | CoordPoint |

A GeoPoint object.

|

Optional Parameters

NameTypeDefaultDescription
paddingFactorDouble0.15

A Double object, which tunes the border size around the region.

|

Remarks

Note that the padding factor is applied to the larger dimension of the region.

The following image shows an instance when the horizontal dimension is larger than the vertical. (“PF” means “Padding Factor” on an image)

When vertical dimension larger than the horizontal, the zoom appears as follows.

Note that the padding factor is divided by two for each side of the region.

In the instance of the following code

csharp
GeoPoint p1 = new GeoPoint(10, 10);
GeoPoint p2 = new GeoPoint(30, 60);
mapControl.ZoomToRegion(p1, p2, 0.3);
vb
Dim p1 As New GeoPoint(10, 10)
Dim p2 As New GeoPoint(30, 60)
map.ZoomToRegion(p1, p2, 0.3)

the result should look like the following.

See Also

MapControl Class

MapControl Members

DevExpress.Xpf.Map Namespace