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
onUpdate
(coord) => void
Returns
RefObject`<[number, number]>`
