Skip to main content
All docs
V20.2

MapControl.ZoomToFit(MapBounds, Double) Method

Zooms a map to fit the area containing items sent as a parameter.

Namespace: DevExpress.Xpf.Map

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

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Map, DevExpress.Wpf.Map

Declaration

public void ZoomToFit(
    MapBounds bounds,
    double paddingFactor = 0.15000000596046448
)

Parameters

Name Type Description
bounds MapBounds

A bounding box around map items.

Optional Parameters

Name Type Default Description
paddingFactor Double 0.150000005960464

A Double object that tunes the border size around visible map items.

Remarks

The padding factor is applied to the larger dimension of the bounding box.

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

WpfMapControl_ZoomToFit_VerticalFitting

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

WpfMapControl_ZoomToFit_HorizontalFitting

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

See Also