Skip to main content

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

MapEditor.SimplifyItems(IEnumerable<MapItem>, Double) Method

Reduces the number of vertices that form the vector layer’s items with specified tolerance.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

NuGet Package: DevExpress.Win.Map

#Declaration

public void SimplifyItems(
    IEnumerable<MapItem> items,
    double tolerance
)

#Parameters

Name Type Description
items IEnumerable<MapItem>

The items to be simplified.

tolerance Double

A percent of vertices that vector shapes contain after simplification. This value should be in the (0;100) range.

#Remarks

The example below demonstrates how to use TrackBarControl to change the Tolerance parameter and utilize the SimplifyItems method to simplify items:

private void Form_Load(object sender, EventArgs e) {
    trackBarControl.Properties.Maximum = 100;
    trackBarControl.Properties.Minimum = 0;
    trackBarControl.Value = 100;
    trackBarControl.EditValueChanged += trackBarControl_EditValueChanged;
}
private void trackBarControl_EditValueChanged(object sender, EventArgs e) {
    double tolerance = Convert.ToDouble(trackBarControl.EditValue);
    mapControl.MapEditor.SimplifyItems(mapLayer.Data.Items, tolerance);
}
See Also