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.Xpf.Map

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

NuGet Package: DevExpress.Wpf.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.

#Example

This example demonstrates how to reduce the number of vertices that form vector layer items.

To do this, use the MapEditor.SimplifyItems(IEnumerable<MapItem>, Double) method.

The TrackBarEdit component is used to change the Tolerance parameter. The tolerance defines the percent of vertices that vector shapes should contain after simplification.

using System;
using System.Windows;
namespace SvgDataAdapterSample {
    public partial class MainWindow : Window {        
        public MainWindow() {
            InitializeComponent();            
        }
        private void OnTrackbarEditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e) {
            double tolerance = Convert.ToDouble(toleranceTrackbar.EditValue);
            mapControl.MapEditor.SimplifyItems(adapter.DisplayItems, tolerance);
        }
    }
}
See Also