Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

MapControl.ZoomToFitLayerItems(Boolean) Method

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

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

NuGet Package: DevExpress.Win.Map

#Declaration

public void ZoomToFitLayerItems(
    bool roundZoomLevel
)

#Parameters

Name Type Description
roundZoomLevel Boolean

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:

using DevExpress.XtraMap;

private void OnVectorLayerDataLoaded(object sender, DataLoadedEventArgs e) {
    mapControl1.ZoomToFitLayerItems(roundZoomLevel:true);
}
See Also