ChapterActionSchema
constChapterActionSchema:ZodObject<{action:ZodEnum<["setFilter","setPaintProperty","setLayoutProperty","flyTo","easeTo","fitBounds","custom"]>;bounds:ZodOptional<ZodArray<ZodNumber,"many">>;filter:ZodOptional<ZodNullable<ZodType<any[],ZodTypeDef,any[]>>>;layer:ZodOptional<ZodString>;options:ZodOptional<ZodRecord<ZodString,ZodAny>>;property:ZodOptional<ZodString>;value:ZodOptional<ZodAny>; },"strip",ZodTypeAny, {action:"custom"|"fitBounds"|"flyTo"|"easeTo"|"setFilter"|"setPaintProperty"|"setLayoutProperty";bounds?:number[];filter?:any[] |null;layer?:string;options?:Record<string,any>;property?:string;value?:any; }, {action:"custom"|"fitBounds"|"flyTo"|"easeTo"|"setFilter"|"setPaintProperty"|"setLayoutProperty";bounds?:number[];filter?:any[] |null;layer?:string;options?:Record<string,any>;property?:string;value?:any; }>
Defined in: packages/core/src/schemas/scrollytelling.schema.ts:63
Chapter action for map state changes.
Remarks
Section titled “Remarks”Actions are triggered when entering or exiting a chapter. They can modify layer properties, filters, or trigger animations.
Action Types:
setFilter- Update layer filtersetPaintProperty- Update layer paint propertysetLayoutProperty- Update layer layout propertyflyTo- Fly to location (handled by chapter config)easeTo- Ease to location (handled by chapter config)fitBounds- Fit to boundscustom- Custom action (handled by application)
Examples
Section titled “Examples”Set Filter
onChapterEnter: - action: setFilter layer: earthquakes filter: [">=", ["get", "magnitude"], 5]Set Paint Property
onChapterEnter: - action: setPaintProperty layer: buildings property: fill-extrusion-height value: ["get", "height"]Fit Bounds
onChapterEnter: - action: fitBounds bounds: [-74.3, 40.5, -73.7, 40.9] options: padding: 50 duration: 1000