Skip to main content

DrawMapItemEventArgs(MapItem) Constructor

Initializes a new instance of the DrawMapItemEventArgs class with the specified map item.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.1.dll

NuGet Package: DevExpress.Win.Map

Declaration

public DrawMapItemEventArgs(
    MapItem item
)

Parameters

Name Type Description
item MapItem

A MapItem value specifying a map item to be drawn. This value is assigned to the MapItemEventArgs.Item property.

Remarks

Instances of the DrawMapItemEventArgs class are automatically created, initialized and passed to the corresponding event handlers.

Example

This example illustrates how to customize vector items when they are drawn on a map.

To do this, it’s necessary to handle the MapControl.DrawMapItem event and provide new values for the event arguments object.

using DevExpress.XtraMap;

namespace DrawMapItemExample {

    public class MapItemFactory : DefaultMapItemFactory {

        protected override void InitializeItem(MapItem item, object obj) {
            base.InitializeItem(item, obj);
            MapRectangle rect = item as MapRectangle;
            if(rect != null) {
                rect.Width = 1000;
                rect.Height = 1000;
            }
        }
    }
}
See Also