Creates a new CreateByTemplateHandle
The edit context
The edit handle to delegate editing to
A function that is called when the user clicks a point. This function should move the shape to the clicked point, and resize it to an appropriate size. You can use getDefaultSize and getDefaultPoint to help resize the shape.
Optionaloptions: PointCreateHandleConstructorOptionsOptional constructor options
ProtectedeventedThe EventedSupport used to emit events.
Typically, handles use emitEditShapeEvent to emit "EditShape" events. This is only used in advanced cases, for example when compositing multiple handles.
ProtectedhandlesThe list of handles that this CascadingEditHandle delegates to.
ProtectedemitEmits an "EditProperty" event.
Typically, a handle emits this right after changing one or more properties.
The list of changes to emit an edit event for. A handle can change multiple related properties at the same time, for example a handle in a corner could change the width and height of a rectangle-like feature together. Each property should only appear once in the list.
The status of the edit. Typically, this is EditPropertyStatus.IN_PROGRESS while the handle is being dragged / changed, and EditPropertyStatus.FINISHED when the drag ends.
ProtectedemitEmits an "EditShape" event.
Typically, a handle emits this right after changing the shape.
The shape to emit an edit event for
The status of the edit. Typically, this is EditShapeStatus.IN_PROGRESS while the handle is being dragged / changed, and EditShapeStatus.FINISHED when the drag ends.
Delegates to the currently active handle's getCursor.
Invalidates this edit handle.
This will cause onDraw and onDrawLabel to be called again.
Use this if you need to update the visualization of the handle. For example, the handle has changed style and onDraw needs to be re-evaluated.
Delegates to the currently active handle's onCreateContextMenu.
Delegates to the currently active handle's onDraw.
Delegates to the currently active handle's onDrawLabel.
Delegates to the currently active handle's onGestureEvent.
Once the currently active handle finishes, the next handle becomes active.
Delegates to the currently active handle's shouldPaintFeature.
Delegates to all handles' update.
An event that is emitted whenever this handle changes the shape of a feature.
EditShape
An event that is emitted whenever this handle changes a property of a feature.
EditProperty
An event that is emitted whenever this handle is invalidated.
Invalidated
Creates a shape "by template".
After creation is started, the user clicks (or taps) once on the map to place the shape. The clicked (or tapped) point is passed into the
applyTemplatefunction. That function moves the shape to the clicked point, and also changes its size so it fits the current view. You can use getDefaultSize and getDefaultPoint to easily determine an appropriate size and points for the shape.Finally, the edit handles become active. When the user is done editing the shape (by double clicking outside the shape, or a single click if finishOnSingleClick), the creation finishes.
Since
2022.1