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.v20.1.dll
NuGet Packages: DevExpress.WindowsDesktop.Wpf.Map, DevExpress.Wpf.Map
Declaration
public void ZoomToRegion(
CoordPoint p1,
CoordPoint p2,
double paddingFactor = 0.15000000596046448
)
Parameters
Name | Type | Description |
---|---|---|
p1 | CoordPoint | A GeoPoint object. |
p2 | CoordPoint | A GeoPoint object. |
Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
paddingFactor | Double | 0.150000005960464 | 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
GeoPoint p1 = new GeoPoint(10, 10);
GeoPoint p2 = new GeoPoint(30, 60);
mapControl.ZoomToRegion(p1, p2, 0.3);
the result should look like the following.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ZoomToRegion(CoordPoint, CoordPoint, Double) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.