Skip to main content
A newer version of this page is available. .

MapControl.SetMapItemFactory(IMapItemFactory) Method

Assigns the specified map item factory to the MapControl.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v19.2.dll

Declaration

public void SetMapItemFactory(
    IMapItemFactory factory
)

Parameters

Name Type Description
factory IMapItemFactory

An object that implements the IMapItemFactory interface.

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;
            }
        }
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SetMapItemFactory(IMapItemFactory) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also