LuciadRIA (2026.0.05)
    Preparing search index...

    This controller enables creating a new shape on the map. To specify the layer in which the object should be created, override the onChooseLayer method callback.

    If you want to change the way creation behaves, check out the Customizing creation and editing guide.

    Hierarchy (View Summary)

    Constructors

    Accessors

    • get cursor(): string | null

      The CSS cursor to use on the map, for this controller. If null, the map will fall back to the previous cursor that was set on the map.

      Note that changing this cursor will update the cursor on the map's DOM node. When using multiple controllers (e.g. in a CompositeController), the controller that updates the cursor last (to a non-null value), will override any other non-null cursors of active controllers on the map.

      Returns string | null

      2022.1

    • set cursor(cssCursor: string | null): void

      Parameters

      • cssCursor: string | null

      Returns void

    • get editor(): Editor

      Return the editor used by this controller

      Returns Editor

      2026.0.1

    • get map(): RIAMap | null

      The map on which this controller is currently active or null if this controller is not currently active. This property is read-only.

      Returns RIAMap | null

    • set map(_value: RIAMap | null): void

      Parameters

      Returns void

    Methods

    • Finishes the creation process.

      This calls the onObjectCreated hook. The creation controller stays active. To deactivate, call:

      map.controller = null.
      

      Returns void

      2024.0

    • Return the maximum number of points that should be created.

      Returns number

      The maximum number of points to create.

    • Return the minimum number of points that should be created.

      Returns number

      The minimum number of points to create.

    • Returns the settings configured on this CreateController. These settings are passed to the EditContext.settings. You can override this method to provide other custom settings to your own custom editor. Note in this case, it is important to also keep these default settings, because without them, the default editors might no longer work as expected. You can do that like this:

      getSettings(): YourCustomSettings {
      return {
      ...super.getSettings(),
      yourCustomSetting: yourCustomValue,
      }
      }

      Your own custom settings should also extend the EditSettings

      Returns EditSettings

      2022.1

    • Call this method to indicate that the controller's appearance has changed. Calling this method ensures the onDraw will be called during the next rendering pass.

      Returns void

    • Callback that is invoked when this controller is activated on a map. This method allows controller implementations to perform setup work.

      Parameters

      • map: RIAMap

        the map on which the controller has been activated

      Returns void

    • This method is called when this controller needs to determine in which layer an object should be created. This method can be overridden to choose a specific layer. If this method returns null then the object creation will not be started. This controller will remain the active controller though.

      The default implementation of this method iterates over the layers of the map view from top to bottom and returns the first layer that is an instance of FeatureLayer and that is editable and visible.

      Parameters

      Returns FeatureLayer | null

      the layer to create objects for or null

    • Callback that is invoked when this controller is deactivated on a map. This method allows controller implementations to perform cleanup work. This method must return either any resolved value or a promise to indicate completion of deactivation. This allows controller implementation to perform asynchronous deactivation work. During the period between this method being called and the resolution of the deactivation promise, this controller will no longer receive input events, but will still get the opportunity to draw itself.

      Parameters

      Returns void | Promise<void>

      a concrete value to indicate immediate deactivation or a deactivation promise.

    • Callback that allows controller implementations to perform custom drawing on the map. Controller shapes and icons are drawn on top of all other content in the map. Note that the map may perform caching which may cause this method to only be invoked once. When a controller implementation's appearance changes the implementation should call invalidate on itself.

      Parameters

      Returns void

    • Callback that allows controller implementations to draw labels on the map. Note that the map may perform caching which may cause this method to only be invoked once. When a controller implementation's appearance changes the implementation should call invalidate on itself.

      Parameters

      Returns void

    • Called when a gesture event has been received. This method must return a HandleEventResult value to indicate if the event was handled or not, If this method returns EVENT_IGNORED, the map will be given the opportunity to perform default gesture event behaviour. If default event handling is not desired, this method should return EVENT_HANDLED. (See the Controller class description for the default behavior.)

      Parameters

      Returns HandleEventResult

      the gesture event handling result.

    • Called when a key event has been received. This method must return a HandleEventResult value to indicate if the event was handled or not, If this method returns EVENT_IGNORED, the map will be given the opportunity to perform default key event behaviour. If default event handling is not desired, this method should return EVENT_HANDLED. (See the Controller class description for the default behavior.)

      Parameters

      • keyEvent: KeyEvent

        The key event to be handled. Note that this is a KeyEvent and not a DOMEvent. You can access the corresponding DOMEvent through KeyEvent.domEvent.

      Returns HandleEventResult

      The key event handling result.

    • Called when a complete object has been created.

      The default implementation of this method adds the created object to the model of the given layer. When the return is true, the controller will deactivate immediately. When the return is a Promise, the controller will deactivate when the promise is resolved or when the promise is rejected.

      Parameters

      Returns void | Promise<void>

      When a Promise is returned, the controller will deactivate when the promise is resolved or when the promise is rejected. When no Promise is returned, the controller will deactivate immediately.

    • Restarts the creation process.

      The feature that is currently being created is not added to the layer's model.

      Returns void

      2024.0

    • Set the minimum and maximum number of points that should be created using this controller. Once the maximum number of points is reached, the controller will automatically disable itself. Note that this method should be called before the creation controller is activated on the map, subsequent calls to this method will be ignored.

      Parameters

      • aMinimumPointCount: number

        The minimum number of points that should be created. Has to be positive.

      • aMaximumPointCount: number

        The maximum number of points that should be created. Set to -1 if not specified.

      Returns void

    Events

    • An event that fires whenever CreateController.restart was called.

      Parameters

      • event: "Restarted"
      • callback: () => void

      Returns Handle

      Controller.on Restarted

      2024.0

    • An event that fires whenever the user edited the shape. EditShape

      Parameters

      Returns Handle

      2022.1

    • An event that fires whenever the user edits a property of the feature.

      This event isn't fired by any of the default RIA edit handles, but a custom handle can emit an EditProperty event.

      EditProperty

      Parameters

      Returns Handle

      2026.0

    • Parameters

      • event: "Invalidated"
      • callback: () => void

      Returns Handle

      Controller.on Invalidated

    • Parameters

      • event: "Activated"
      • callback: (map: RIAMap) => void

      Returns Handle

      Controller.on Activated

    • Parameters

      • event: "Deactivated"
      • callback: (map: RIAMap) => void

      Returns Handle

      Controller.on Deactivated