Back to Devexpress

MapControl.ZoomToFitLayerItems(Boolean) Method

windowsforms-devexpress-dot-xtramap-dot-mapcontrol-dot-zoomtofitlayeritems-x28-system-dot-boolean-x29.md

latest1.7 KB
Original Source

MapControl.ZoomToFitLayerItems(Boolean) Method

Zooms the map to fit items that all map layers contain.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
public void ZoomToFitLayerItems(
    bool roundZoomLevel
)
vb
Public Sub ZoomToFitLayerItems(
    roundZoomLevel As Boolean
)

Parameters

NameTypeDescription
roundZoomLevelBoolean

Specifies whether to round the zoom level value.

|

Remarks

The following code zooms a map so that it displays all items that are contained in map layers:

csharp
using DevExpress.XtraMap;

private void OnVectorLayerDataLoaded(object sender, DataLoadedEventArgs e) {
    mapControl1.ZoomToFitLayerItems(roundZoomLevel:true);
}
vb
Imports DevExpress.XtraMap

Private Sub OnVectorLayerDataLoaded(ByVal sender As Object, ByVal e As DataLoadedEventArgs)
    mapControl1.ZoomToFitLayerItems(roundZoomLevel:=True)
End Sub

See Also

MapControl Class

MapControl Members

DevExpress.XtraMap Namespace