Camera (ICamera) controls for the map.
Export controller for the map.
Controls for the map's labels *ILabels).
Controls for the map's markers (IMarkers).
Navigation (INavigation) controls for the map.
Controls for the map's (IPaths).
Creates a Coordinate on the map.
The latitude of the coordinate.
The longitude of the coordinate.
Optional floor information if applicable.
The created coordinate object.
// Create a coordinate at the CN Tower.
const coord = map.createCoordinate(43.642567, -79.387054);
Optional
floor: FloorRetrieves Directions from one navigatable point TNavigationTarget to another TNavigationTarget on the map.
The starting point for navigation.
The destination point.
Optional
options: TGetDirectionsOptionsOptional parameters for getting directions.
Directions from the start to the destination point.
// Get directions from space1 to space2.
const directions = await map.getDirections(space1, space2);
Unsubscribe a function previously subscribed with on
An event name to which the provided function was previously subscribed.
A function that was previously passed to on. The function must have the same reference as the function that was subscribed.
// Unsubscribe from the 'click' event
const handler = (event) => {
console.log('Map was clicked', event);
};
map.off('click', handler);
Subscribe a function to an event.
An event name which, when fired, will call the provided function.
A callback that gets called when the corresponding event is fired. The callback will get passed an argument with a type that's one of event payloads.
// Subscribe to the 'click' event
const handler = (event) => {
const { coordinate } = event;
const { latitude, longitude } = coordinate;
console.log(`Map was clicked at ${latitude}, ${longitude}`);
};
map.on('click', handler);
Sets the current floor of the map.
Updates the state TUpdateState of a given target on the map.
The following table maps targets to states.
target | state |
---|---|
Label | TLabelState |
MapObject | TGeometryState |
Space | TGeometryState |
The target to update.
The new state to apply to the target.
// Update the color of a space to red.
map.updateState(space, { color: 'red' });
Represents a map with all the interactive features, controls, and actions.