SelectDragCallback

User-input callbacks dispatched by SelectDragDetector for taps, drags and context gestures on the globe.

The userObject parameter every recognised-object callback receives is the earth.worldwind.PickedObject.userObject of the top picked object. It is typically a earth.worldwind.render.Renderable (Polygon/Path/Placemark) — but may be any payload registered via earth.worldwind.PickedObject.fromUserObject (for example an earth.worldwind.layer.buildings.OsmBuilding surfaced from a batched buildings tile).

position carries the depth-tested geographic point on the picked surface, so it includes altitude for non-terrain picks. Consumers that propagate the click as a cursor placemark or hit-location should respect that altitude rather than clamping back to ground.

Every method has a default no-op implementation; implementers only override the gestures they care about.

Functions

Link copied to clipboard
open fun canMoveObjects(userObject: Any): Boolean

Filter for which picked objects this callback wants to drag. The detector arms the drag gesture only when this returns true. The drag plumbing later casts userObject to earth.worldwind.shape.Movable internally before invoking moveTo, so returning true for a non-Movable simply yields a no-op drag (no error).

Link copied to clipboard
open fun canPickObjects(userObject: Any): Boolean

Filter for which picked objects this callback wants. The detector calls onObjectPicked / onObjectContext / onObjectDoubleTap only when this returns true.

Link copied to clipboard
open fun onNothingContext()

Context-click landed off the globe.

Link copied to clipboard
open fun onNothingPicked()

Tap landed off the globe (no terrain or shape under the pick point).

Link copied to clipboard
open fun onObjectContext(userObject: Any, position: Position)

Long-press / right-click on a recognised object.

Link copied to clipboard
open fun onObjectDoubleTap(userObject: Any, position: Position)

Double-tap / double-click on a recognised object.

Link copied to clipboard
open fun onObjectMoved(userObject: Any, fromPosition: Position, toPosition: Position)

One step of an in-progress drag gesture on a recognised object.

Link copied to clipboard
open fun onObjectMovingFinished(userObject: Any, position: Position)

The drag gesture on a recognised object has finished (finger lifted or pointer released).

Link copied to clipboard
open fun onObjectPicked(userObject: Any, position: Position)

Tap on a recognised object.

Link copied to clipboard
open fun onTerrainContext(position: Position)

Long-press / right-click on bare terrain.

Link copied to clipboard
open fun onTerrainDoubleTap(position: Position)

Double-tap / double-click on bare terrain.

Link copied to clipboard
open fun onTerrainPicked(position: Position)

Tap on bare terrain — no shape under the pixel.