Skip to content

spatial-monorepo


spatial-monorepo / ui/src / useTweenedCoordinate

Function: useTweenedCoordinate()

useTweenedCoordinate(coordinate, duration, easingName, onUpdate): RefObject`<[number, number]>`

Defined in: packages/ui/src/AnimatedMapMarker.tsx:74

Returns a ref to the "current tweened coordinate" that is updated each rAF frame, and a callback to trigger the map marker to reposition.

The tween interpolates linearly between from and to over duration ms, applying the named easing function.

Parameters

coordinate

[number, number]

duration

number

easingName

EasingName

onUpdate

(coord) => void

Returns

RefObject`<[number, number]>`

Released under commercial licensing.