Skip to content

v3 Changelog

Archived. v3 is no longer the current release. See the current changelog for 4.0.1 release notes.

v3.0.0

Ground-up TypeScript rewrite of the v2 UMD bundle.

New in v3

Distribution

  • Published to npm as mapsted.maps (v2 was CDN-only via <script src>).
  • Build pipeline switched from tsdx to tsup, producing four formats in dist/:
    • index.js — ESM (modern bundlers: Vite, Webpack 5, Rollup)
    • index.cjs — CJS (require())
    • index.min.js — IIFE (CDN <script> tag)
    • index.d.ts — TypeScript declarations (IntelliSense)

Types

  • Full TypeScript types with .d.ts declarations for every public method and interface.
  • 14 public interfaces: CalculationRequest, CalculationResult, CoordinateData, DefaultCustomRoutingConfig, EntityData, FeatureFlagSet, FloorBoost, HighlightStyle, initializeOptions (note the lowercase i — preserved from the v2 type name; renamed to InitOptions in 4.0.1), Location, MapOverlayData, RoutingBoost, SelectEntityBoost, SetOptions.
  • 3 enums: ActionTypes, Loader, RouteOptions.
  • 1 constant: PRIVATE_CHILD_ACTION (removed in 4.0.1 per CHL-27 security review).

Public API

21 functions preserved from v2 under unchanged names: initialize, set, setEntityData, setEntityDataById, setEntityDefaults, selectEntity, setFeatureFlags, changeFloorById, changeFloorByName, getFloors, createBoostSelect, createBoostRouting, setCoordsData, applyBoost, setIdleTime, setMapOverlayMarkers, centerOnMapoverlay (lowercase o), changeLanguage, setDefaultCustomRoutingConfig, setMapView, calculateDistance. Plus status singleton, addEventListener/removeEventListener from the emitter module, and PARENT_ACTION/CHILD_ACTION/PRIVATE_CHILD_ACTION/FEATURE_FLAG_SETS constants.

Known issues in v3 (addressed in 4.0.1)

  • postMessage uses wildcard '*' target origin — any parent/child frame can read map postMessage traffic. 4.0.1 introduces origin-validated postMessage via the security/ subsystem.
  • highlightStyle() is dead code — the feature was never implemented. v3 keeps it as a no-op stub; 4.0.1 makes it throw MAPSTED-1093 loudly. Note: the HighlightStyle TypeScript interface (type-only, used in entityDefaults.highlight and MapEntity.highlight fields) is still exported and remains valid — only the function highlightStyle() is permanently removed. See the v3 TypeDoc reference for full type details.
  • No structured error codes — errors are untyped strings. 4.0.1 introduces MapstedError + 34 MAPSTED-1xxx codes.
  • centerOnMapoverlay has inconsistent casing (o should be O). 4.0.1 renames to centerOnMapOverlay.
  • PRIVATE_CHILD_ACTION is exposed in the public API by accident. 4.0.1 removes it (CHL-27).

Upgrading

To upgrade from v3 to 4.0.1, follow the migration guide. Every v3 method name still works in 4.0.1 via the runtime shim; opt into strict mode during the migration audit (setStrictMode(true)) to catch every remaining call site.


See also: v3 legacy API reference | v3 TypeDoc | Current changelog (4.0.1)