Options
All
  • Public
  • Public/Protected
  • All
Menu

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.

Hierarchy

Implements

Overview

Constructors

Protected constructor

Events

on

  • (event: "Invalidated", callback: (...args: any[]) => void, context?: object): Handle
  • An event indicating that this Controller is invalidated. Invalidated means that the Controller requests for its onDraw to be called during the next rendering pass (because its appearance has changed). This event fires when invalidate is called.

    Parameters

    • event: "Invalidated"
    • callback: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: object

    Returns Handle

Accessors

map

  • get map(): Map | null
  • set map(value: Map | null): void
  • The map on which this controller is currently active or null if this controller is not currently active. This property is read-only.

    Returns Map | null

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

    Parameters

    • value: Map | null

    Returns any

Methods

getMaximumPointCount

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

    Returns number

    The maximum number of points to create.

getMinimumPointCount

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

    Returns number

    The minimum number of points to create.

invalidate

  • (): void
  • 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

onActivate

  • (aMapView: Map): void

onChooseLayer

  • This methods 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

    • aMapView: Map

      the map view

    Returns Layer | null

    the layer to create objects for or null

onCreateNewObject

  • Called when a new object instance needs to be created.

    Parameters

    • aMapView: Map

      the map view

    • aLayer: Layer

      the layer

    Returns void

    a new object

onDeactivate

  • (aMapView: Map): boolean | any

onDraw

onDrawLabel

onGestureEvent

onKeyEvent

  • 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.

onObjectCreated

  • (aMapView: Map, aLayer: Layer, aObject: object): boolean | Promise<boolean>
  • 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

    • aMapView: Map

      the map view

    • aLayer: Layer

      the layer

    • aObject: object

      the object that was created

    Returns boolean | Promise<boolean>

    true or a Promise. 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.

setPointCount

  • (aMinimumPointCount: number, aMaximumPointCount: number): void
  • 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

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method