Skip to content

Function: getShareUrl()

ts
function getShareUrl(): Promise<string | null>;

Build a share URL for the current map state from the init-time shareUrl base plus any currently known state (propertyId, floor, selected entity).

The URL follows the Mapsted deep-link convention documented on SetOptions.shareUrl: <shareUrl>/map/select?property=<id>&floor=<id>&entity=<id>.

Returns null when the API was initialised without shareUrl — there is no server-side base to build against; a factory without a base returns null rather than guessing a domain.

buildingId is not in the API-tracked state snapshot (the iframe owns it), so this helper omits building=… from the constructed URL. Consumers that need building-level share links should append &building=<id> themselves.

Throws MAPSTED-1090 if called before the API is READY.

Returns

Promise<string | null>