Creates a new PointListCreateHandle.
Optional
options: PointListCreateHandleConstructorOptionsProtected
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.
Whether "freehand" drawing is allowed.
The maximum point count to create a point list with.
The minimum point count to create a point list with.
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.
Returns the current cursor for this handle.
The default implementation always returns "crosshair"
.
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.
2024.0.02
Populates a context menu with entries.
For example, a handle for a point in a polyline might add a "Delete point" context menu entry.
the input event that triggered opening the context menu.
the edit context
the context menu to add entries to.
a callback that needs to be called when a menu action is performed. Call this at the end of the ContextMenuItem.action implementation.
Paints a snap icon, if there's a point to snap to.
This method allows the handle to draw labels on the map.
For example, you can use this to show coordinates of points, or the current radius of a circle on top of an edit handle.
The default implementation draws nothing.
The label canvas to draw labels on
The editing context.
Handles the given context.
The editing handle can modify the feature (or its shape) based on the type and state of the input event. For example, a drag event that moves a circle.
The default implementation ignores the event.
the gesture event.
the edit context.
Indicates whether the feature being created or edited, should be painted by the controller. The feature is painted using the layer's painter.
For handles used in editing, this is typically always true
.
For handles used in creation, this typically returns false
in the early steps of the creation process.
For example, when the user is still choosing a location for a point (before the first click).
The editing context.
2024.0
Called when (another) handle changes the feature or shape, as indicated by the "EditShape" event.
This handle can update its own state, based on the changed shape.
For example, a PointListInsertHandle just inserted a point in a polyline. The PointListTranslateHandle uses the update to recalculate new sub-handles, based on the new polyline (with the extra point).
The default implementation does nothing.
An event that is emitted whenever this handle changes the shape of a feature.
EditShape
An event that is emitted whenever this handle is invalidated.
Invalidated
A handle to create point list shapes, ie. polygons and polylines.
It supports creation of point lists for both mouse and touch input. The user can click (or tap) on the map to add points to the pointlist. Once placed, the points cannot be moved or removed by this handle.
If
freehand
istrue
, the user can start dragging the mouse near the last created point to start "freehand" drawing. While "freehand" drawing is active, points are inserted automatically under the mouse / finger.See
PointListEditor
Since
2022.1