spatial-monorepo / core/src / SpatialPlugin
Interface: SpatialPlugin
Defined in: packages/core/src/plugins/types.ts:36
Contract every SpatialPlugin must implement.
Example
ts
const myPlugin: SpatialPlugin = {
id: '@acme/my-plugin',
install(store, map) {
const sub = store.subscribe(s => s.floorOrdinal, floor => { ... });
return { destroy: () => sub() };
},
};Properties
id
id:
string
Defined in: packages/core/src/plugins/types.ts:38
Unique plugin identifier — used for deduplication and error messages.
Methods
install()
install(
store,map):PluginController
Defined in: packages/core/src/plugins/types.ts:44
Called once after the MapLibre map fires its 'load' event. Receives the full Zustand store and the live MapLibre map instance. Must return a PluginController with a destroy() method.
Parameters
store
StoreApi
map
Map$1
