Context object providing access to configuration, state, and services. This object is passed to various callbacks and components throughout the application.
Type: Object
Application configuration passed to the InteractiveMap constructor.
Type: Object
Current application state, including:
{
breakpoint: 'mobile' | 'tablet' | 'desktop',
interfaceType: 'mouse' | 'touch' | 'keyboard',
// ... other app state
}Type: Object
Registry of icons available for use in buttons and controls.
Type: MapProvider
The map provider instance. Provides methods to interact with the underlying map engine.
// Example usage
const center = context.mapProvider.getCenter()
context.mapProvider.setView({ zoom: 10 })Type: Object
Current map state, including:
{
zoom: 8,
center: [-1.5, 52.5],
bounds: [...],
// ... other map state
}Type: Object
Core services for interacting with the application.
Updates the map's aria-live region with a screen reader announcement. Use this to communicate important state changes to assistive technology users.
Note
This will override any pending core messages, so be sure to include necessary context. This function is experimental and subject to change.
context.services.announce('3 results found')Returns a location description for the given coordinates. Uses the reverseGeocodeProvider if configured in options.
const description = await context.services.reverseGeocode(zoom, center)
// e.g. "Manchester, Greater Manchester"Note
Further work is planned to provide richer results with optional detail levels and zoom-dependent descriptions.
Closes the map if in fullscreen mode and returns to the previous page. Use this when your interaction needs to exit the map entirely.
context.services.closeApp()Pub/sub event bus for communication within the application.
const { eventBus, events } = context.services
// Subscribe to an event
eventBus.on(events.APP_PANEL_OPENED, ({ panelId }) => {
console.log('Panel opened:', panelId)
})
// Unsubscribe from an event
eventBus.off(events.APP_PANEL_OPENED, handler)
// Emit an event
eventBus.emit(events.MY_CUSTOM_EVENT, { data: 'value' })Event name constants for use with eventBus. See Events for available events.