Skip to main content

Interface: FitFeatureAction

Defined in: runtime/action.ts:111

Frames one feature: the camera ends up showing that feature's own extent, with the zoom worked out from its size rather than chosen in advance.

Carries no geometry, like every other action — featureId is the same stable id mapData rows, clicks and select-feature already key on. The bounds are read from the source the layer draws, so what the caller needs to know is which feature it means, not where that feature is.

Compiles to runtime.setView() with bounds, so it moves the camera without the spec being rebuilt, exactly as set-view-preset does.

Properties​

animation?​

optional animation?: ViewAnimation

Defined in: runtime/action.ts:123

How the camera travels there. Left out, the engine flies its own way — and cuts instead for a viewer who asked for reduced motion.


featureId​

featureId: string | number

Defined in: runtime/action.ts:116

Feature id to frame — the same id select-feature takes.


layerId​

layerId: string

Defined in: runtime/action.ts:114

Id of the layer the feature is drawn on — must match spec.layers[].id.


padding?​

optional padding?: number

Defined in: runtime/action.ts:118

Pixels of breathing room around the feature. Defaults to 40.


rationale?​

optional rationale?: string

Defined in: runtime/action.ts:125

Optional free-text reason, preserved on the action log entry for audit.


type​

type: "fit-feature"

Defined in: runtime/action.ts:112