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.
Protected
activeThe index of the active handle.
Only relevant when cascading is false
.
-1 if no handle should be active.
Protected
eventedThe 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.
Protected
handlesThe list of handles that this CompositeEditHandle delegates to.
Note that the setter has side effects. Do not modify the list of handles in-place (e.g. push()
new
handles to the array after the setter has been called).
Protected
emitEmits 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 IN_PROGRESS while the handle is being dragged / changed, and EditShapeStatus.FINISHED when the drag ends.
Finds the handles to interact with, based on a given input event.
Note that this is only used if cascading is false
.
The event to find handles for
The edit context
handles that are close to the mouse cursor / finger.
Returns the mouse cursor to show.
In cascading mode, this returns the cursor of the active cascading handle.
If there is an active handle, its cursor is returned. Otherwise, the first interaction handle's cursor is used.
Called when a ContextMenu is populated.
EditHandle in the list of handles.
Draws handle shapes on the map.
Draws handle labels on the map.
EditHandle in the list of handles.
Handles the given context.
In cascading mode, it forwards the event to the active cascading handle.
In non-cascading mode, it forwards the event to all interaction handles. If one the interaction handles then handles the event, that handle becomes the active handle until it deactivates (returns HandleEventResult.REQUEST_DEACTIVATION or ignores an event).
Called when (another) handle changes the feature or shape, as indicated by the "EditShape" event.
EditHandle in the list of handles.
An event that is emitted whenever this handle changes the shape of a feature.
EditShape
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
applyTemplate
function. 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