Concepts
Resource Locations
The core booking resources data layer used for:- Creating map markers
- Displaying the resource booking card
- Determining availability status
Resource Map Previews
Lightweight metadata for each building map, used for:- Resource map dropdown
- Determining initial map position
- Identifying maps within the current viewport
- Referencing the GeoJSON URL for rendering
Resource Maps
Full GeoJSON + layer data for a single building floor plan. Only fetched when a map enters the viewport.Booking Previews
Partially anonymized booking data used to:- Display user avatars on the map
- Highlight resources booked by the current user
Viewport Filtering
A map-move event (throttled to 200ms) triggers viewport checks. Resource maps within the viewport are mounted; those outside are unmounted.Marker Types
Initialization Flow
1
Fetch initial data
Fetch Resource Locations (without child resources), Resource Map Previews, and the initial bounding box for the active filters — location, availability, category, and context (community / organization / customer account). Do not apply viewport filtering at this stage.
2
Determine initial map position
3
Display the Resource Map Dropdown
with all available floor plans.
4
Initialize the map
with the position from step 2.
5
On map load:
- Play the starting animation
- Mount markers (see Mounting Markers)
- Mount resource maps (see Resource Map Management) within the initial viewport
- Apply any pre-selected resource features
- Register all relevant events
Interaction Flow
Availability Filter Update Flow
On filter change:- Fetch resource locations with map previews
- Update active markers
- Fetch availability data
- Update resource feature states (section below)
- Remove active resource maps
- Re-run initialization flow from step 2
Mounting Markers
1. Add GeoJSON source:- Circle layer — clustered marker circles (maxzoom: 15)
- Symbol layer — cluster count labels (maxzoom: 15)
- Circle layer — markers for resources on a floor plan (maxzoom: 15)
- Circle layer — standalone markers (all zoom levels)
- Hover events for all marker layers
- Cluster click → decluster
- Standalone marker click → zoom to level 21 → show resource popup
- Floor-plan marker click → zoom to level 15.5
Viewport Filtering
Triggered by the mapmove event, throttled to 200ms.
Store resource map previews in an R-Tree indexed by bounding box for fast spatial lookups. Update the R-Tree whenever resource map preview data changes.
Flow:
- Get viewport bounds
- Get viewport center
- Search R-Tree for overlapping maps
- Mount maps newly within the viewport
- Unmount maps that left the viewport
- Sort overlapping maps by distance to viewport center
- Activate the layer control for the closest (focused) map
Resource Map Management
Mounting
- Add GeoJSON source (requires: GeoJSON data URL from map preview, resource map ID):
- Add style layers (minzoom: 15)
- Register events:
- Hover events (mouseenter, mouseleave, mousemove) for live resource features
- Click event → show resource popup
- Add Booking Preview data (see below)
- Fetch availability for all active resource features
- Update feature states using
map.setFeatureState():
Unmounting
- Remove Booking Preview data
- Deregister events (
map.off()) - Remove layers (
map.removeLayer()) - Remove GeoJSON source (
map.removeSource())
Updating Data
- Get the layer data source
- Get the data source (
map.getSource()) - Update with
source.setData(newData)
Shared maps (managed organizations)
A managing organization can publish a floor plan to every organization it manages. Sharing is stored on the map resource, not as a separate share object.Enable or disable sharing
sharedWithManagedOrganizations to false to stop sharing. Linked managed organizations are detached, and the map disappears from their GET /api/v1/resource-maps index.
Who can see and edit a shared map
On the owner read, JSON:API
meta.shared_organization_ids lists managed organization IDs that currently have resources assigned on the map. Managed organizations do not receive that meta.
Filter maps by the sharing flag
Booking Previews on Maps
Fetch booking previews for the resources within a mounted floor plan and overlay avatar markers on the corresponding resource features. Usemap.setFeatureState() to attach preview data to individual GeoJSON features for rendering.
Refresh booking previews whenever a booking WebSocket event is received on the resources.{resourceId} channel.