Skip to content

Mapsted Maps JavaScript API v3 — Legacy Documentation

Archived. These pages are preserved for customers migrating off v3. The current supported release is 4.0.1. Start at the current release.

Status

AspectState
v3 supportDeprecated. Final release 3.0.0 remains on CDN at mapi.mapsted.com/v3.0.0/maps.jsmapi.mapsted.com keeps serving it directly, so existing v3 integrations keep working with no action required. Security patches at Mapsted's discretion; sunset date to be announced.
Last v3 buildv3.0.0 on the maps.js CDN (/v3.0.0/maps.js?id=<propertyId>)
Current release4.0.1. Adds MapstedError, origin-validated postMessage, on/off/once typed events, async init()MapInstance, setAccessibilityMode, getState/subscribe.
Deprecation windowv3 method aliases (initialize, changeFloorById, addEventListener, setMapView, centerOnMapoverlay casing, setDefaultCustomRoutingConfig, changeLanguage, removeEventListener) remain in the current runtime shim. Aliases log console.warn on first call and will be removed in a future major release.

What this section contains

PageFor
Migrating to 4.0.1Start here if you are upgrading a v3 integration to 4.0.1. Focused shorter doc — only covers the v3 → 4.0.1 deltas (10 renames + MapstedError + SecurityConfig + typed events).
v3 legacy API referenceHistorical v3 public surface summary — 21 functions + 14 interfaces + 3 enums + 1 constant, extracted from the v3.0.0 TypeDoc bundle shipped alongside the CDN build.
v3 changelogv3's release notes (v2 → v3 ground-up rewrite).
v3 TypeDoc — full API referenceOriginal auto-generated TypeDoc tree, ported byte-for-byte from mapi.mapsted.com/v3.0.0/docs/. Renders as the v3 TypeDoc site, not inside VitePress chrome.

What v3 offered

v3 (3.x, release 3.0.0) was the ground-up TypeScript rewrite of v2. It published to npm as mapsted.maps and shipped four build formats (ESM + CJS + IIFE + .d.ts) via tsup. Key capabilities:

  • Full TypeScript types + .d.ts declarations for IntelliSense
  • mapsted.maps npm package + CDN IIFE bundle
  • v2's 21-method public API preserved with identical names (initialize, changeFloorById, addEventListener, etc.)
  • Migration shim (v2 → v3 aliases) — at v3 this shim was a no-op since names hadn't changed; it was the scaffolding the current release later used to preserve v3 names.
  • Added PRIVATE_CHILD_ACTION constant (removed in 4.0.1 per CHL-27)

v3 did not have:

  • Structured error codes / MapstedError class (added in 4.0.1)
  • Origin-validated postMessage layer (added in 4.0.1 — v3 used postMessage(..., '*') everywhere)
  • Typed event API with discriminated overloads (on/off/once added in 4.0.1; v3 used DOM-style addEventListener/removeEventListener)
  • State subscription API (getState/subscribe added in 4.0.1)
  • Accessibility mode (setAccessibilityMode added in 4.0.1)
  1. If you are still on v3 and need to operate the deployment you have, read the v3 legacy API reference or the original TypeDoc tree. Your existing <script> tags keep working — mapi.mapsted.com serves v3.0.0 directly.
  2. If you are upgrading to 4.0.1, read the migration guide, then go to Embed your first map for the 4.0.1 starter.
  3. If you are new to Mapsted Maps, ignore this /v3/ tree entirely — start at the current release.