Skip to content

Boost and Deep-Linking

Boosts are pre-configured map states that can be applied at init or runtime.

Boost Types

TypePurposeExample
FloorBoostNavigate to a floor{ floor: 184 }
SelectEntityBoostSelect a specific entity{ type: 'SELECT', floor: 184, entity: 81 }
RoutingBoostShow routing between entities{ type: 'ROUTING', routing: '95:2936,95:71' }

Creating Boosts

javascript
// From URL query string
const boost = mapsted.maps.createBoostSelect('building=95&floor=184&entity=81');

// From RoutingConfig
const routeBoost = mapsted.maps.createBoostRouting({
  routing: '95:2936,95:71',
  routeOptions: 'IncludeElevators,IncludeRamps'
});

Applying Boosts

javascript
// At init time
await mapsted.maps.init({ element: '#map', boost });

// At runtime
await mapsted.maps.applyBoost(boost);

Deep-Linking

Combine boosts with URL parameters for shareable map states:

javascript
const params = new URLSearchParams(window.location.search);
const boostString = params.get('boost');
if (boostString) {
  const boost = mapsted.maps.createBoostSelect(boostString);
  await mapsted.maps.applyBoost(boost);
}

Knowing when a boost has finished

applyBoost() resolves as soon as the API dispatches the APPLY_BOOST message to the iframe — not when the underlying action (floor change, entity select, itinerary creation) has actually settled. For that, subscribe to the boostComplete event:

javascript
mapsted.maps.on('boostComplete', ({ type }) => {
  console.log(`boost finished: ${type}`); // 'FLOOR' | 'SELECT' | 'ROUTING'
  // hide a spinner, chain a follow-up action, etc.
});

await mapsted.maps.applyBoost(boost);
// `boostComplete` fires shortly afterward with the matching type.

Fires exactly once per boost lifecycle. The type payload mirrors the BoostTypes enum value that drove the action.

See also: Deep-Linking How-to | API Reference