This guide explains how you can interactively create features on a Map, and integrate this capability in an IController.

Overview

You start the process of interactive feature creation by sending input events to a creator. A feature creator creates the feature, and a geometry creator creates its geometry. The feature creator can convert the created geometries to a feature, and adds them to the model.

Programmatically creating geometries

If you want to create geometries through the API instead of creating them interactively on the map, see the related article on geometries

Configuring feature creation

To configure feature creation, you can use these classes:

Integrating a creator with a controller

You can use the Creator class as a part of an IController implementation. To integrate the feature creator:

  • Delegate the input events. The creator may or may not consume those events. Based on that information, the controller can decide to ignore the event, or use it for something else. For example, a creator can ignore mouse drag events, and use only mouse moves and click events. The controller can then still use the drag events to navigate the map.

  • Add the preview layer to the controller’s layer list. You must do that so that the map can visualize a preview of the created feature.

Setting line creation modes to define input events

The line creation mode defines how input events generate a line by placing points in sequence.

The supported line creation modes are:

You can configure the line creation mode of the following creators:

Constraining geometries during creation

The creation API supports geometry constraints out-of-the-box. You can use most IGeometryCreator implementations to configure a constraint to apply during creation. See the related article for more information.

Examples of customizations

The tutorial Creating a custom geometry creator shows how you can implement your own geometry creator.