Creates a new PointCreateHandle.
Protected
activeIndicates whether the handle is 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.
The point to snap to.
This is used to paint a snap icon.
Typically, this is set by subclasses, for example in PointDragHandle.drag.
Called when handle goes from inactive to active state.
The event that triggered the activation
The edit context
Called whenever the point is dragged to a new location.
By default, this delegates to the drag
function that was passed into the constructor.
The new location of the point, in model coordinates.
The gesture event that caused the drag.
The edit context
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 cursor for this point handle.
Returns the default handle icon style.
This is the handle icon style that is used if no handleIconStyle
was passed into the constructor.
The edit context
The context's handle icon style.
Returns the drape target for this point handle.
This will make sure point handles with z=0 are correctly draped or not, and on the correct DrapeTarget (terrain or a 3D Tiles mesh). Icons for handles at an altitude are never draped.
In detail, this uses the following heuristics to determine a DrapeTarget: By default, this uses the drapeTarget of getHandleIconStyle. If that is not defined, this looks at the DrapeTarget.NOT_DRAPED. If it is zero, this looks for a 3D Tiles mesh layer on the map that has isDrapeTarget set. If a 3D tiles mesh layer is found, this returns DrapeTarget.ALL so the handles are draped on the mesh (and terrain, in case the data lies outside the mesh). If no mesh layer is found, this returns DrapeTarget.NOT_DRAPED.
The edit context
Returns the handle icon style, to be used for visualizing point handles in onDraw.
This returns the handle icon style that was passed into the constructor. If no handle icon style was passed into the constructor, this returns the context's handle icon style.
The edit context
Checks whether the given input event interacts with the point handle.
By default, this returns true
if the mouse or finger is within a
certain distance of the point. A larger distance is used for touch events than for mouse events.
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.
Called when this handle should draw shapes on the map.
By default, the implementation draws:
null
null
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.
Processes an event.
It checks if a there's a point to snap to, and sets snapPoint accordingly. After that, it calls drag with the model point under the mouse or finger.
Returns true
for DOWN events that interacts with
the point handle.
Returns true
on DRAG_END or
CONTEXT_MENU events.
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
Returns true
for GestureEventType.DRAG events.
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.
Transform a view point to model coordinates.
The default implementation transforms the view point to a model coordinate on terrain. It also moves the point's Z to 0.
The view point to transform to model coordinates
The edit context
2023.1
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 that is used to create a single Point.
After clicking or tapping once, the Point is moved to the clicked location.
See
PointEditor
Since
2022.1