@mapvx/web-js 3.1.0-dev.2 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/cjs/controllers/routeController.js +0 -13
  2. package/dist/cjs/controllers/routeController.js.map +1 -1
  3. package/dist/cjs/domain/models/mapConfig.js +1 -13
  4. package/dist/cjs/domain/models/mapConfig.js.map +1 -1
  5. package/dist/cjs/domain/models/marker.js +82 -147
  6. package/dist/cjs/domain/models/marker.js.map +1 -1
  7. package/dist/cjs/index.js +1 -2
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/logger/sentry.js +1 -1
  10. package/dist/cjs/map/map.js +3 -41
  11. package/dist/cjs/map/map.js.map +1 -1
  12. package/dist/es/controllers/routeController.d.ts +0 -7
  13. package/dist/es/controllers/routeController.d.ts.map +1 -1
  14. package/dist/es/controllers/routeController.js +0 -13
  15. package/dist/es/controllers/routeController.js.map +1 -1
  16. package/dist/es/domain/models/mapConfig.d.ts +0 -73
  17. package/dist/es/domain/models/mapConfig.d.ts.map +1 -1
  18. package/dist/es/domain/models/mapConfig.js +0 -12
  19. package/dist/es/domain/models/mapConfig.js.map +1 -1
  20. package/dist/es/domain/models/marker.d.ts +1 -232
  21. package/dist/es/domain/models/marker.d.ts.map +1 -1
  22. package/dist/es/domain/models/marker.js +82 -146
  23. package/dist/es/domain/models/marker.js.map +1 -1
  24. package/dist/es/index.d.ts +2 -2
  25. package/dist/es/index.d.ts.map +1 -1
  26. package/dist/es/index.js +1 -1
  27. package/dist/es/index.js.map +1 -1
  28. package/dist/es/logger/sentry.js +1 -1
  29. package/dist/es/map/map.d.ts +1 -15
  30. package/dist/es/map/map.d.ts.map +1 -1
  31. package/dist/es/map/map.js +4 -42
  32. package/dist/es/map/map.js.map +1 -1
  33. package/dist/umd/index.js +130 -828
  34. package/dist/umd/index.js.map +1 -1
  35. package/dist/umd/styles.css +19 -45
  36. package/dist/umd/styles.css.map +1 -1
  37. package/package.json +1 -1
  38. package/dist/cjs/controllers/markerLayoutController.js +0 -337
  39. package/dist/cjs/controllers/markerLayoutController.js.map +0 -1
  40. package/dist/es/controllers/markerLayoutController.d.ts +0 -140
  41. package/dist/es/controllers/markerLayoutController.d.ts.map +0 -1
  42. package/dist/es/controllers/markerLayoutController.js +0 -329
  43. package/dist/es/controllers/markerLayoutController.js.map +0 -1
package/dist/umd/index.js CHANGED
@@ -281,7 +281,6 @@ __webpack_require__.d(__webpack_exports__, {
281
281
  CIRCLE_DEFAULTS: () => (/* reexport */ CIRCLE_DEFAULTS),
282
282
  CacheManager: () => (/* reexport */ CacheManager),
283
283
  DEFAULT_CACHE_CONFIGS: () => (/* reexport */ DEFAULT_CACHE_CONFIGS),
284
- DEFAULT_MARKER_LAYOUT_CONFIG: () => (/* reexport */ DEFAULT_MARKER_LAYOUT_CONFIG),
285
284
  DEFAULT_MAX_STORAGE_BYTES: () => (/* reexport */ DEFAULT_MAX_STORAGE_BYTES),
286
285
  DEFAULT_TILE_CACHE_CONFIG: () => (/* reexport */ DEFAULT_TILE_CACHE_CONFIG),
287
286
  FetchHttpClient: () => (/* reexport */ FetchHttpClient),
@@ -11240,7 +11239,7 @@ const extractSafariExtensionDetails = (func, filename) => {
11240
11239
  // exists only for the type-checker, so in the ES/CJS builds the identifier is
11241
11240
  // genuinely absent and a direct comparison throws ReferenceError at module load.
11242
11241
  // `typeof` is the only safe way to probe a possibly-undeclared global.
11243
- var sentry_SDK_VERSION = false ? 0 : "3.1.0-dev.2";
11242
+ var sentry_SDK_VERSION = false ? 0 : "3.1.0";
11244
11243
  var DSN = false ? 0 : "https://872f598f020e3cd73a0933b562d24c81@sentry.mapvx.app/5";
11245
11244
 
11246
11245
  /**
@@ -11876,10 +11875,6 @@ function getBoundingBox(points) {
11876
11875
  return [southwest, northeast];
11877
11876
  }
11878
11877
  ;// ./src/domain/models/marker.ts
11879
- function marker_typeof(o) { "@babel/helpers - typeof"; return marker_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, marker_typeof(o); }
11880
- function marker_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11881
- function marker_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? marker_ownKeys(Object(t), !0).forEach(function (r) { marker_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : marker_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11882
- function marker_defineProperty(e, r, t) { return (r = marker_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
11883
11878
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
11884
11879
  function _possibleConstructorReturn(t, e) { if (e && ("object" == marker_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
11885
11880
  function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
@@ -11887,6 +11882,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
11887
11882
  function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
11888
11883
  function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
11889
11884
  function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
11885
+ function marker_typeof(o) { "@babel/helpers - typeof"; return marker_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, marker_typeof(o); }
11890
11886
  function marker_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11891
11887
  function marker_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, marker_toPropertyKey(o.key), o); } }
11892
11888
  function marker_createClass(e, r, t) { return r && marker_defineProperties(e.prototype, r), t && marker_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
@@ -11921,22 +11917,6 @@ var TextPosition = /*#__PURE__*/function (TextPosition) {
11921
11917
  return TextPosition;
11922
11918
  }({});
11923
11919
 
11924
- /**
11925
- * Fallback icon width/height, in pixels, used whenever a marker is created
11926
- * without explicit `iconProperties`.
11927
- *
11928
- * @group Markers
11929
- */
11930
- var DEFAULT_ICON_SIZE_PX = 40;
11931
-
11932
- /**
11933
- * Fallback maximum label width, in pixels, used whenever neither the marker
11934
- * nor the map's `markerLayout` configuration specifies one.
11935
- *
11936
- * @group Markers
11937
- */
11938
- var DEFAULT_MAX_LABEL_WIDTH_PX = 200;
11939
-
11940
11920
  /**
11941
11921
  * Alignment options for marker rotation and pitch behavior.
11942
11922
  * Controls how the marker responds to map rotation and pitch changes.
@@ -11981,7 +11961,6 @@ var DEFAULT_MAX_LABEL_WIDTH_PX = 200;
11981
11961
  *
11982
11962
  * @group Markers
11983
11963
  */
11984
-
11985
11964
  /**
11986
11965
  * Utility class for creating and manipulating marker elements on a map.
11987
11966
  * Provides static methods for marker element creation and styling.
@@ -12011,55 +11990,75 @@ var MarkerUtils = /*#__PURE__*/function () {
12011
11990
  var markerContainer = document.createElement("div");
12012
11991
 
12013
11992
  // Configure specific marker dimensions
12014
- var iconWidth = (_marker$iconPropertie = (_marker$iconPropertie2 = marker.iconProperties) === null || _marker$iconPropertie2 === void 0 ? void 0 : _marker$iconPropertie2.width) !== null && _marker$iconPropertie !== void 0 ? _marker$iconPropertie : DEFAULT_ICON_SIZE_PX;
12015
- var iconHeight = (_marker$iconPropertie3 = (_marker$iconPropertie4 = marker.iconProperties) === null || _marker$iconPropertie4 === void 0 ? void 0 : _marker$iconPropertie4.height) !== null && _marker$iconPropertie3 !== void 0 ? _marker$iconPropertie3 : DEFAULT_ICON_SIZE_PX;
11993
+ var iconWidth = (_marker$iconPropertie = (_marker$iconPropertie2 = marker.iconProperties) === null || _marker$iconPropertie2 === void 0 ? void 0 : _marker$iconPropertie2.width) !== null && _marker$iconPropertie !== void 0 ? _marker$iconPropertie : 40;
11994
+ var iconHeight = (_marker$iconPropertie3 = (_marker$iconPropertie4 = marker.iconProperties) === null || _marker$iconPropertie4 === void 0 ? void 0 : _marker$iconPropertie4.height) !== null && _marker$iconPropertie3 !== void 0 ? _marker$iconPropertie3 : 40;
12016
11995
 
12017
- // Apply base class. The container's own box is always the icon's box (or
12018
- // the custom `element`'s natural box) — the label is positioned
12019
- // absolutely (see .text-container in styles.css) so it never affects
12020
- // this box, which is exactly what MapLibre anchors the marker to.
11996
+ // Apply base class
12021
11997
  markerContainer.className = "mapvx-marker";
11998
+
11999
+ // Configure classes and dimensions based on text presence
12000
+ if (marker.text) {
12001
+ // If text exists, adjust layout according to position
12002
+ switch (marker.textPosition) {
12003
+ case TextPosition.top:
12004
+ case TextPosition.bottom:
12005
+ markerContainer.classList.add("text-column");
12006
+ markerContainer.style.width = "".concat(Math.max(iconWidth, 200), "px");
12007
+ markerContainer.style.height = "auto";
12008
+ break;
12009
+ case TextPosition.left:
12010
+ case TextPosition.right:
12011
+ default:
12012
+ markerContainer.classList.add("text-row");
12013
+ markerContainer.style.width = "auto";
12014
+ markerContainer.style.height = "".concat(iconHeight, "px");
12015
+ break;
12016
+ }
12017
+ } else {
12018
+ // No text, use fixed icon dimensions as in official example
12019
+ markerContainer.classList.add("no-text");
12020
+ markerContainer.style.width = "".concat(iconWidth, "px");
12021
+ markerContainer.style.height = "".concat(iconHeight, "px");
12022
+ }
12022
12023
  markerContainer.addEventListener("click", function () {
12023
12024
  var _marker$onClick;
12024
12025
  (_marker$onClick = marker.onClick) === null || _marker$onClick === void 0 || _marker$onClick.call(marker);
12025
12026
  });
12026
-
12027
- // Custom element replaces icon entirely; the label (if any) still gets
12028
- // appended, positioned absolutely relative to it.
12029
12027
  if (marker.element) {
12030
- // Only force a box when the caller declared the footprint. Otherwise
12031
- // the container is left to size itself to the custom element, and
12032
- // automatic label collision avoidance measures that real box from the
12033
- // DOM instead of assuming the default icon size — see
12034
- // {@link MarkerAttribute.measureIconFromDom}.
12035
- if (marker.iconProperties) {
12036
- markerContainer.style.width = "".concat(iconWidth, "px");
12037
- markerContainer.style.height = "".concat(iconHeight, "px");
12038
- }
12039
12028
  markerContainer.appendChild(marker.element);
12040
- return this.setAndCreateText(marker, markerContainer);
12029
+ return this.setAndCreateText(marker, markerContainer, "".concat(iconHeight, "px"), "".concat(iconWidth, "px"));
12041
12030
  }
12042
- markerContainer.style.width = "".concat(iconWidth, "px");
12043
- markerContainer.style.height = "".concat(iconHeight, "px");
12031
+
12032
+ // Create elements in correct order according to textPosition
12044
12033
  var iconElement = this.createIconElement(marker, iconWidth, iconHeight);
12045
- markerContainer.appendChild(iconElement);
12046
- return this.setAndCreateText(marker, markerContainer);
12034
+ var textElement = marker.text ? this.createTextContainer(typeof marker.text === "string" ? this.createTextElement(marker.text, marker.textProperties) : marker.text, marker.textPosition) : null;
12035
+
12036
+ // Add elements in correct order
12037
+ if (marker.textPosition === TextPosition.top || marker.textPosition === TextPosition.left) {
12038
+ if (textElement) markerContainer.appendChild(textElement);
12039
+ markerContainer.appendChild(iconElement);
12040
+ } else {
12041
+ markerContainer.appendChild(iconElement);
12042
+ if (textElement) markerContainer.appendChild(textElement);
12043
+ }
12044
+ return markerContainer;
12047
12045
  }
12048
12046
 
12049
12047
  /**
12050
- * Appends the marker's text label (if any) to the container, positioned
12051
- * around whichever element (icon or custom `element`) is already there.
12048
+ * Sets up text positioning and styling for the marker.
12052
12049
  *
12053
12050
  * @param markerConfig - Configuration object containing text properties
12054
- * @param container - Container element to append the label to
12055
- * @returns The same container, with the label appended when text is present
12051
+ * @param container - Container element where text will be added
12052
+ * @param iconHeight - Height of the icon for positioning calculations
12053
+ * @param iconWidth - Width of the icon for positioning calculations
12054
+ * @returns Container element with properly positioned text
12056
12055
  */
12057
12056
  }, {
12058
12057
  key: "setAndCreateText",
12059
- value: function setAndCreateText(markerConfig, container) {
12058
+ value: function setAndCreateText(markerConfig, container, iconHeight, iconWidth) {
12060
12059
  if (markerConfig.text) {
12061
12060
  var textElement = typeof markerConfig.text === "string" ? this.createTextElement(markerConfig.text, markerConfig.textProperties) : markerConfig.text;
12062
- var textContainer = this.createTextContainer(textElement, markerConfig.textPosition, markerConfig.maxLabelWidthPx);
12061
+ var textContainer = this.createTextContainer(textElement, markerConfig.textPosition);
12063
12062
  container.appendChild(textContainer);
12064
12063
  }
12065
12064
  return container;
@@ -12095,75 +12094,43 @@ var MarkerUtils = /*#__PURE__*/function () {
12095
12094
  }
12096
12095
 
12097
12096
  /**
12098
- * Creates a text container, absolutely positioned around the marker's icon
12099
- * via CSS (see `.text-container` in styles.css), so the label never affects
12100
- * the container's own box.
12097
+ * Creates a text container with proper positioning using CSS classes.
12098
+ * Uses natural block/flex layout without absolute positioning.
12101
12099
  *
12102
12100
  * @param textElement - The text element to contain
12103
12101
  * @param textPosition - Desired position relative to the icon
12104
- * @param maxLabelWidthPx - Maximum label width in pixels before truncation
12105
12102
  * @returns Container with text positioned using CSS classes
12106
12103
  */
12107
12104
  }, {
12108
12105
  key: "createTextContainer",
12109
- value: function createTextContainer(textElement, textPosition, maxLabelWidthPx) {
12106
+ value: function createTextContainer(textElement, textPosition) {
12110
12107
  var textContainer = document.createElement("div");
12111
12108
 
12112
12109
  // Apply base class
12113
12110
  textContainer.className = "text-container";
12114
- textContainer.style.maxWidth = "".concat(maxLabelWidthPx !== null && maxLabelWidthPx !== void 0 ? maxLabelWidthPx : DEFAULT_MAX_LABEL_WIDTH_PX, "px");
12115
- this.setTextPositionClass(textContainer, this.resolveTextPosition(textPosition));
12111
+
12112
+ // Apply position class
12113
+ switch (textPosition) {
12114
+ case TextPosition.top:
12115
+ textContainer.classList.add("top");
12116
+ break;
12117
+ case TextPosition.bottom:
12118
+ textContainer.classList.add("bottom");
12119
+ break;
12120
+ case TextPosition.left:
12121
+ textContainer.classList.add("left");
12122
+ break;
12123
+ default:
12124
+ // right
12125
+ textContainer.classList.add("right");
12126
+ break;
12127
+ }
12116
12128
  textElement.style.display = "block";
12117
12129
  textElement.style.margin = "0";
12118
12130
  textContainer.appendChild(textElement);
12119
12131
  return textContainer;
12120
12132
  }
12121
12133
 
12122
- /**
12123
- * Resolves an optional {@link TextPosition} to its default (`right`), the
12124
- * same default `createTextContainer` has always applied.
12125
- */
12126
- }, {
12127
- key: "resolveTextPosition",
12128
- value: function resolveTextPosition(textPosition) {
12129
- return textPosition !== null && textPosition !== void 0 ? textPosition : TextPosition.right;
12130
- }
12131
-
12132
- /**
12133
- * Swaps a text container's position class, keeping exactly one of
12134
- * `top|bottom|left|right` applied at a time.
12135
- */
12136
- }, {
12137
- key: "setTextPositionClass",
12138
- value: function setTextPositionClass(textContainer, position) {
12139
- textContainer.classList.remove("top", "bottom", "left", "right");
12140
- textContainer.classList.add(TextPosition[position]);
12141
- }
12142
-
12143
- /**
12144
- * Repositions (or hides) a marker's already-rendered text label at
12145
- * runtime, without rebuilding any DOM. Used both by automatic collision
12146
- * avoidance and by anything else that needs to move a label after
12147
- * creation.
12148
- *
12149
- * @param textContainer - The `.text-container` element to reposition
12150
- * @param position - Side of the icon the label should render on
12151
- * @param hidden - Whether the label should be hidden (kept measurable via
12152
- * `visibility`, never removed via `display`, so it can be measured again
12153
- * to decide whether it fits once something else changes)
12154
- *
12155
- * @example
12156
- * ```typescript
12157
- * MarkerUtils.applyTextPosition(textEl, TextPosition.left, false);
12158
- * ```
12159
- */
12160
- }, {
12161
- key: "applyTextPosition",
12162
- value: function applyTextPosition(textContainer, position, hidden) {
12163
- this.setTextPositionClass(textContainer, position);
12164
- textContainer.style.visibility = hidden ? "hidden" : "";
12165
- }
12166
-
12167
12134
  /**
12168
12135
  * Creates and returns an icon element for the marker, using the image URL
12169
12136
  * specified in the `MarkerConfig` object.
@@ -12183,8 +12150,8 @@ var MarkerUtils = /*#__PURE__*/function () {
12183
12150
  var _marker$iconPropertie5, _marker$iconPropertie6, _marker$iconPropertie7, _marker$iconPropertie8;
12184
12151
  var image = document.createElement("img");
12185
12152
  image.src = typeof marker.icon == "string" ? marker.icon : "";
12186
- image.width = (_marker$iconPropertie5 = (_marker$iconPropertie6 = marker.iconProperties) === null || _marker$iconPropertie6 === void 0 ? void 0 : _marker$iconPropertie6.width) !== null && _marker$iconPropertie5 !== void 0 ? _marker$iconPropertie5 : DEFAULT_ICON_SIZE_PX;
12187
- image.height = (_marker$iconPropertie7 = (_marker$iconPropertie8 = marker.iconProperties) === null || _marker$iconPropertie8 === void 0 ? void 0 : _marker$iconPropertie8.height) !== null && _marker$iconPropertie7 !== void 0 ? _marker$iconPropertie7 : DEFAULT_ICON_SIZE_PX;
12153
+ image.width = (_marker$iconPropertie5 = (_marker$iconPropertie6 = marker.iconProperties) === null || _marker$iconPropertie6 === void 0 ? void 0 : _marker$iconPropertie6.width) !== null && _marker$iconPropertie5 !== void 0 ? _marker$iconPropertie5 : 40;
12154
+ image.height = (_marker$iconPropertie7 = (_marker$iconPropertie8 = marker.iconProperties) === null || _marker$iconPropertie8 === void 0 ? void 0 : _marker$iconPropertie8.height) !== null && _marker$iconPropertie7 !== void 0 ? _marker$iconPropertie7 : 40;
12188
12155
  image.style.objectFit = "contain";
12189
12156
  image.style.filter = "drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25))";
12190
12157
  return image;
@@ -12223,7 +12190,6 @@ var MarkerUtils = /*#__PURE__*/function () {
12223
12190
  }
12224
12191
  }]);
12225
12192
  }();
12226
-
12227
12193
  /**
12228
12194
  * Custom implementation of a MapLibre Marker with additional functionality.
12229
12195
  * Extends the base MapLibre Marker class with MapVX-specific features.
@@ -12254,56 +12220,6 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
12254
12220
  * Used for indoor navigation and floor-specific marker management.
12255
12221
  */
12256
12222
 
12257
- /**
12258
- * Resolved icon dimensions (defaults to {@link DEFAULT_ICON_SIZE_PX} square
12259
- * when unspecified), matching whatever `MarkerUtils.createMarkerElement`
12260
- * rendered. Used by automatic label collision avoidance to compute the
12261
- * icon's on-screen rect without a DOM measurement — except when
12262
- * {@link measureIconFromDom} is set.
12263
- * @internal
12264
- */
12265
-
12266
- /**
12267
- * The `PositionAnchor` this marker was created with, needed by automatic
12268
- * label collision avoidance to translate a screen point into the icon's
12269
- * on-screen rect the same way MapLibre itself does.
12270
- * @internal
12271
- */
12272
-
12273
- /**
12274
- * The marker's preferred text position, used as the first candidate by
12275
- * automatic label collision avoidance before it tries the other sides.
12276
- * @internal
12277
- */
12278
-
12279
- /**
12280
- * Priority used to resolve label collisions; see
12281
- * {@link MarkerConfig.labelPriority}.
12282
- * @internal
12283
- */
12284
-
12285
- /**
12286
- * Cached reference to this marker's `.text-container` element, if it has
12287
- * a text label. Avoids querying the DOM on every layout pass.
12288
- * @internal
12289
- */
12290
-
12291
- /**
12292
- * True when the marker renders a caller-supplied `element` and no
12293
- * `iconProperties` declared its footprint. In that case {@link iconSize}
12294
- * is only a fallback and automatic label collision avoidance measures the
12295
- * marker element's real box from the DOM instead.
12296
- * @internal
12297
- */
12298
-
12299
- /**
12300
- * The config this marker currently renders from. {@link updateIcon} merges
12301
- * its (usually partial) config on top of this one, so an update that omits
12302
- * `iconProperties`, `textPosition` or `labelPriority` keeps whatever the
12303
- * marker already had instead of silently snapping back to the SDK defaults
12304
- * — both in the DOM it rebuilds and in the layout state derived from it.
12305
- */
12306
-
12307
12223
  /**
12308
12224
  * Constructs a new `MarkerAttribute` object with the specified properties.
12309
12225
  *
@@ -12320,7 +12236,7 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
12320
12236
  * ```
12321
12237
  */
12322
12238
  function MarkerAttribute(markerConfig) {
12323
- var _markerConfig$anchor, _markerConfig$rotatio, _markerConfig$id, _markerConfig$floorId, _markerConfig$anchor2;
12239
+ var _markerConfig$anchor, _markerConfig$rotatio, _markerConfig$id, _markerConfig$floorId;
12324
12240
  var _this;
12325
12241
  marker_classCallCheck(this, MarkerAttribute);
12326
12242
  _this = _callSuper(this, MarkerAttribute, [{
@@ -12338,78 +12254,22 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
12338
12254
  _this.id = (_markerConfig$id = markerConfig.id) !== null && _markerConfig$id !== void 0 ? _markerConfig$id : generateHexadecimalKey();
12339
12255
  _this.coordinate = markerConfig.coordinate;
12340
12256
  _this.floorId = (_markerConfig$floorId = markerConfig.floorId) !== null && _markerConfig$floorId !== void 0 ? _markerConfig$floorId : "";
12341
- // MapLibre resolves the anchor once, in the `super()` call above, and
12342
- // offers no way to change it afterwards — so this mirror is set here and
12343
- // never touched by `updateIcon`.
12344
- _this.anchorType = (_markerConfig$anchor2 = markerConfig.anchor) !== null && _markerConfig$anchor2 !== void 0 ? _markerConfig$anchor2 : "center";
12345
- _this.currentConfig = markerConfig;
12346
- _this.applyLayoutState(markerConfig);
12347
12257
  return _this;
12348
12258
  }
12349
12259
 
12350
12260
  /**
12351
- * Derives the state automatic label collision avoidance reads (icon box,
12352
- * preferred label side, priority, label element) from a fully-resolved
12353
- * config. It is what assigns the fields declared with `!` above — the
12354
- * constructor always calls it, but TypeScript can't see through the
12355
- * indirection. Shared by the constructor and {@link updateIcon} so the two can
12356
- * never drift apart.
12261
+ * Adds the marker attribute to the specified map.
12262
+ *
12263
+ * @param map - The map instance where the marker attribute will be added
12264
+ *
12265
+ * @example
12266
+ * ```typescript
12267
+ * const marker = new MarkerAttribute(markerConfig);
12268
+ * marker.addToMap(mapInstance);
12269
+ * ```
12357
12270
  */
12358
12271
  _inherits(MarkerAttribute, _Marker);
12359
12272
  return marker_createClass(MarkerAttribute, [{
12360
- key: "applyLayoutState",
12361
- value: function applyLayoutState(config) {
12362
- var _config$iconPropertie, _config$iconPropertie2, _config$iconPropertie3, _config$iconPropertie4, _config$labelPriority;
12363
- this.iconSize = {
12364
- width: (_config$iconPropertie = (_config$iconPropertie2 = config.iconProperties) === null || _config$iconPropertie2 === void 0 ? void 0 : _config$iconPropertie2.width) !== null && _config$iconPropertie !== void 0 ? _config$iconPropertie : DEFAULT_ICON_SIZE_PX,
12365
- height: (_config$iconPropertie3 = (_config$iconPropertie4 = config.iconProperties) === null || _config$iconPropertie4 === void 0 ? void 0 : _config$iconPropertie4.height) !== null && _config$iconPropertie3 !== void 0 ? _config$iconPropertie3 : DEFAULT_ICON_SIZE_PX
12366
- };
12367
- this.preferredTextPosition = MarkerUtils.resolveTextPosition(config.textPosition);
12368
- this.labelPriority = (_config$labelPriority = config.labelPriority) !== null && _config$labelPriority !== void 0 ? _config$labelPriority : 0;
12369
- this.measureIconFromDom = config.element != null && config.iconProperties == null;
12370
- this.textContainerEl = this.findTextContainerEl();
12371
- }
12372
-
12373
- /**
12374
- * Merges an update on top of the marker's current config, so a partial
12375
- * update such as `{ id, coordinate, icon }` keeps the marker's existing
12376
- * icon dimensions, label side and priority.
12377
- *
12378
- * `element` is deliberately *not* carried forward: it and `icon` are
12379
- * mutually exclusive rendering paths, and `updateIcon` has always chosen
12380
- * the path named by the update itself.
12381
- */
12382
- }, {
12383
- key: "mergeConfig",
12384
- value: function mergeConfig(update) {
12385
- return marker_objectSpread(marker_objectSpread(marker_objectSpread({}, this.currentConfig), update), {}, {
12386
- element: update.element
12387
- });
12388
- }
12389
-
12390
- /**
12391
- * Finds this marker's `.text-container` child element, if it has one.
12392
- */
12393
- }, {
12394
- key: "findTextContainerEl",
12395
- value: function findTextContainerEl() {
12396
- return Array.from(this._element.children).find(function (child) {
12397
- return child instanceof HTMLElement && child.classList.contains("text-container");
12398
- });
12399
- }
12400
-
12401
- /**
12402
- * Adds the marker attribute to the specified map.
12403
- *
12404
- * @param map - The map instance where the marker attribute will be added
12405
- *
12406
- * @example
12407
- * ```typescript
12408
- * const marker = new MarkerAttribute(markerConfig);
12409
- * marker.addToMap(mapInstance);
12410
- * ```
12411
- */
12412
- }, {
12413
12273
  key: "addToMap",
12414
12274
  value: function addToMap(map) {
12415
12275
  if (!map) return;
@@ -12419,11 +12279,6 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
12419
12279
  /**
12420
12280
  * Updates the icon of the marker attribute based on the specified marker configuration.
12421
12281
  *
12422
- * The config is merged on top of the one the marker currently renders
12423
- * from, so a partial update keeps every property it omits — passing only
12424
- * `{ icon }` no longer resets the marker's icon dimensions, preferred
12425
- * label side or label priority to their defaults.
12426
- *
12427
12282
  * @param marker - `MarkerConfig` object containing the new marker configuration
12428
12283
  *
12429
12284
  * @example
@@ -12437,13 +12292,12 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
12437
12292
  }, {
12438
12293
  key: "updateIcon",
12439
12294
  value: function updateIcon(marker) {
12440
- var _config$rotationAlign;
12441
- var config = this.mergeConfig(marker);
12442
- if (config.element) {
12295
+ var _marker$rotationAlign;
12296
+ if (marker.element) {
12443
12297
  this._element.innerHTML = "";
12444
- this._element.appendChild(config.element);
12298
+ this._element.appendChild(marker.element);
12445
12299
  } else {
12446
- var markerElement = MarkerUtils.createMarkerElement(config);
12300
+ var markerElement = MarkerUtils.createMarkerElement(marker);
12447
12301
  var oldMarkerContent = this._element.querySelector("div");
12448
12302
  var newMarkerContent = markerElement.querySelector("div");
12449
12303
  if (newMarkerContent) {
@@ -12451,13 +12305,11 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
12451
12305
  oldMarkerContent === null || oldMarkerContent === void 0 || (_oldMarkerContent$par = oldMarkerContent.parentElement) === null || _oldMarkerContent$par === void 0 || _oldMarkerContent$par.replaceChild(newMarkerContent, oldMarkerContent);
12452
12306
  }
12453
12307
  }
12454
- this.setRotationAlignment((_config$rotationAlign = config.rotationAlignment) !== null && _config$rotationAlign !== void 0 ? _config$rotationAlign : "viewport");
12308
+ this.setRotationAlignment((_marker$rotationAlign = marker.rotationAlignment) !== null && _marker$rotationAlign !== void 0 ? _marker$rotationAlign : "viewport");
12455
12309
  this.setPitchAlignment("viewport");
12456
- if (typeof config.rotation === "number") {
12457
- this.setRotation(config.rotation);
12310
+ if (typeof marker.rotation === "number") {
12311
+ this.setRotation(marker.rotation);
12458
12312
  }
12459
- this.currentConfig = config;
12460
- this.applyLayoutState(config);
12461
12313
  }
12462
12314
 
12463
12315
  /**
@@ -12534,452 +12386,6 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
12534
12386
  }
12535
12387
  }]);
12536
12388
  }(maplibre_gl.Marker);
12537
- ;// ./src/controllers/markerLayoutController.ts
12538
- function markerLayoutController_typeof(o) { "@babel/helpers - typeof"; return markerLayoutController_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, markerLayoutController_typeof(o); }
12539
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || markerLayoutController_unsupportedIterableToArray(r) || _nonIterableSpread(); }
12540
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12541
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
12542
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return markerLayoutController_arrayLikeToArray(r); }
12543
- function markerLayoutController_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = markerLayoutController_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12544
- function markerLayoutController_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return markerLayoutController_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? markerLayoutController_arrayLikeToArray(r, a) : void 0; } }
12545
- function markerLayoutController_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
12546
- function markerLayoutController_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12547
- function markerLayoutController_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, markerLayoutController_toPropertyKey(o.key), o); } }
12548
- function markerLayoutController_createClass(e, r, t) { return r && markerLayoutController_defineProperties(e.prototype, r), t && markerLayoutController_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
12549
- function markerLayoutController_defineProperty(e, r, t) { return (r = markerLayoutController_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
12550
- function markerLayoutController_toPropertyKey(t) { var i = markerLayoutController_toPrimitive(t, "string"); return "symbol" == markerLayoutController_typeof(i) ? i : i + ""; }
12551
- function markerLayoutController_toPrimitive(t, r) { if ("object" != markerLayoutController_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != markerLayoutController_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12552
-
12553
-
12554
- /** Axis-aligned box in screen (CSS pixel) space. */
12555
-
12556
- /**
12557
- * Fraction of the icon's own box, along each axis, that MapLibre's Marker
12558
- * anchor math (`translate(-x%, -y%)`) aligns to the geodetic point. Mirrors
12559
- * MapLibre's own `anchorTranslate` table so the collision math agrees with
12560
- * what's actually on screen.
12561
- */
12562
- var ANCHOR_FRACTIONS = {
12563
- center: {
12564
- fx: 0.5,
12565
- fy: 0.5
12566
- },
12567
- top: {
12568
- fx: 0.5,
12569
- fy: 0
12570
- },
12571
- bottom: {
12572
- fx: 0.5,
12573
- fy: 1
12574
- },
12575
- left: {
12576
- fx: 0,
12577
- fy: 0.5
12578
- },
12579
- right: {
12580
- fx: 1,
12581
- fy: 0.5
12582
- },
12583
- "top-left": {
12584
- fx: 0,
12585
- fy: 0
12586
- },
12587
- "top-right": {
12588
- fx: 1,
12589
- fy: 0
12590
- },
12591
- "bottom-left": {
12592
- fx: 0,
12593
- fy: 1
12594
- },
12595
- "bottom-right": {
12596
- fx: 1,
12597
- fy: 1
12598
- }
12599
- };
12600
-
12601
- /** Candidate order tried when a marker's preferred side is unavailable. */
12602
- var FALLBACK_ORDER = [TextPosition.right, TextPosition.top, TextPosition.left, TextPosition.bottom];
12603
-
12604
- /** Builds the icon's on-screen rect from its projected point, size and anchor. */
12605
- function computeIconRect(screen, iconSize, anchor) {
12606
- var _ANCHOR_FRACTIONS$anc;
12607
- var _ref = (_ANCHOR_FRACTIONS$anc = ANCHOR_FRACTIONS[anchor]) !== null && _ANCHOR_FRACTIONS$anc !== void 0 ? _ANCHOR_FRACTIONS$anc : ANCHOR_FRACTIONS.center,
12608
- fx = _ref.fx,
12609
- fy = _ref.fy;
12610
- return {
12611
- left: screen.x - fx * iconSize.width,
12612
- top: screen.y - fy * iconSize.height,
12613
- width: iconSize.width,
12614
- height: iconSize.height
12615
- };
12616
- }
12617
-
12618
- /**
12619
- * Builds a candidate label rect for one side of an icon. Mirrors the CSS in
12620
- * `styles.css` (`.text-container.right/left/top/bottom`) exactly, so a
12621
- * position the algorithm picks as collision-free renders collision-free.
12622
- */
12623
- function computeCandidateRect(iconRect, labelSize, position, gapPx, verticalGapPx) {
12624
- switch (position) {
12625
- case TextPosition.left:
12626
- return {
12627
- left: iconRect.left - gapPx - labelSize.width,
12628
- top: iconRect.top + iconRect.height / 2 - labelSize.height / 2,
12629
- width: labelSize.width,
12630
- height: labelSize.height
12631
- };
12632
- case TextPosition.top:
12633
- return {
12634
- left: iconRect.left + iconRect.width / 2 - labelSize.width / 2,
12635
- top: iconRect.top - verticalGapPx - labelSize.height,
12636
- width: labelSize.width,
12637
- height: labelSize.height
12638
- };
12639
- case TextPosition.bottom:
12640
- return {
12641
- left: iconRect.left + iconRect.width / 2 - labelSize.width / 2,
12642
- top: iconRect.top + iconRect.height + verticalGapPx,
12643
- width: labelSize.width,
12644
- height: labelSize.height
12645
- };
12646
- case TextPosition.right:
12647
- default:
12648
- return {
12649
- left: iconRect.left + iconRect.width + gapPx,
12650
- top: iconRect.top + iconRect.height / 2 - labelSize.height / 2,
12651
- width: labelSize.width,
12652
- height: labelSize.height
12653
- };
12654
- }
12655
- }
12656
-
12657
- /** Expands a rect by `padding` on every side. */
12658
- function expandRect(rect, padding) {
12659
- return {
12660
- left: rect.left - padding,
12661
- top: rect.top - padding,
12662
- width: rect.width + 2 * padding,
12663
- height: rect.height + 2 * padding
12664
- };
12665
- }
12666
-
12667
- /** Standard AABB intersection test. */
12668
- function rectsIntersect(a, b) {
12669
- return a.left < b.left + b.width && a.left + a.width > b.left && a.top < b.top + b.height && a.top + a.height > b.top;
12670
- }
12671
-
12672
- /**
12673
- * Automatic collision avoidance for marker text labels: keeps a marker's
12674
- * icon fixed while moving (or hiding) its label to avoid overlapping
12675
- * neighboring markers' icons/labels, similar to Google Maps' label
12676
- * placement. See {@link MarkerLayoutConfig}.
12677
- *
12678
- * Not part of the public SDK surface — owned and driven entirely by
12679
- * {@link InternalMapVXMap}, mirroring `RouteController`.
12680
- */
12681
- var MarkerLayoutController = /*#__PURE__*/function () {
12682
- function MarkerLayoutController(map, config) {
12683
- var _this = this;
12684
- markerLayoutController_classCallCheck(this, MarkerLayoutController);
12685
- markerLayoutController_defineProperty(this, "labelSizeCache", new WeakMap());
12686
- markerLayoutController_defineProperty(this, "iconSizeCache", new WeakMap());
12687
- markerLayoutController_defineProperty(this, "lastAppliedState", new WeakMap());
12688
- markerLayoutController_defineProperty(this, "attached", false);
12689
- this.mapvxMap = map;
12690
- this.config = config;
12691
- this.boundOnMove = function () {
12692
- return _this.scheduleRelayout();
12693
- };
12694
- }
12695
- return markerLayoutController_createClass(MarkerLayoutController, [{
12696
- key: "map",
12697
- get: function get() {
12698
- return this.mapvxMap.map;
12699
- }
12700
-
12701
- /**
12702
- * Starts listening for camera movement. Safe to call once the underlying
12703
- * MapLibre `Map` instance exists; a single `"move"` listener covers pan,
12704
- * zoom, rotate, pitch and `resize()`.
12705
- */
12706
- }, {
12707
- key: "attach",
12708
- value: function attach() {
12709
- if (this.attached) return;
12710
- this.attached = true;
12711
- this.map.on("move", this.boundOnMove);
12712
- this.remeasureWhenFontsLoad();
12713
- this.scheduleRelayout();
12714
- }
12715
-
12716
- /**
12717
- * Publishes the configured gaps and label width cap as CSS custom
12718
- * properties, which `styles.css` reads to offset labels from their icon.
12719
- * Without this the stylesheet would keep its hardcoded defaults while the
12720
- * collision math used the configured values, so any custom `gapPx` /
12721
- * `verticalGapPx` would produce placements this controller believes are
12722
- * collision-free but that visibly overlap on screen.
12723
- *
12724
- * Called with the map's own container, so every marker MapLibre mounts
12725
- * inside it inherits the values.
12726
- */
12727
- }, {
12728
- key: "applyLayoutVariables",
12729
- value: function applyLayoutVariables(container) {
12730
- container.style.setProperty("--mapvx-label-gap", "".concat(this.config.gapPx, "px"));
12731
- container.style.setProperty("--mapvx-label-vertical-gap", "".concat(this.config.verticalGapPx, "px"));
12732
- container.style.setProperty("--mapvx-label-max-width", "".concat(this.config.maxLabelWidthPx, "px"));
12733
- }
12734
-
12735
- /**
12736
- * A label measured before its web font finishes loading is measured in the
12737
- * fallback font, and that wrong footprint would otherwise be cached for
12738
- * the marker's lifetime. Drop every measurement once fonts settle.
12739
- */
12740
- }, {
12741
- key: "remeasureWhenFontsLoad",
12742
- value: function remeasureWhenFontsLoad() {
12743
- var _this2 = this;
12744
- var fonts = document.fonts;
12745
- if (!fonts) return;
12746
- fonts.ready.then(function () {
12747
- if (!_this2.attached) return;
12748
- _this2.labelSizeCache = new WeakMap();
12749
- _this2.iconSizeCache = new WeakMap();
12750
- _this2.scheduleRelayout();
12751
- })["catch"](function () {
12752
- // Font loading failing is not a layout error: the measurements
12753
- // already taken in the fallback font stay in effect.
12754
- });
12755
- }
12756
-
12757
- /** Stops listening and cancels any pending layout pass. */
12758
- }, {
12759
- key: "destroy",
12760
- value: function destroy() {
12761
- if (this.attached) {
12762
- this.map.off("move", this.boundOnMove);
12763
- this.attached = false;
12764
- }
12765
- if (this.rafHandle !== undefined) {
12766
- cancelAnimationFrame(this.rafHandle);
12767
- this.rafHandle = undefined;
12768
- }
12769
- }
12770
-
12771
- /**
12772
- * Drops everything cached for a marker, e.g. after its text/content
12773
- * changed.
12774
- *
12775
- * The last applied decision has to go too: rebuilding a marker's DOM
12776
- * replaces its `.text-container` with a fresh one carrying the preferred
12777
- * side and no `visibility`, so a decision remembered from the old element
12778
- * would make {@link applyDecisions} short-circuit and leave the new label
12779
- * on the wrong side — or visible when it should be hidden.
12780
- */
12781
- }, {
12782
- key: "invalidateMarker",
12783
- value: function invalidateMarker(marker) {
12784
- this.labelSizeCache["delete"](marker);
12785
- this.iconSizeCache["delete"](marker);
12786
- this.lastAppliedState["delete"](marker);
12787
- }
12788
-
12789
- /** Coalesces repeated calls into a single layout pass per animation frame. */
12790
- }, {
12791
- key: "scheduleRelayout",
12792
- value: function scheduleRelayout() {
12793
- var _this3 = this;
12794
- if (!this.config.enabled || this.rafHandle !== undefined) return;
12795
- this.rafHandle = requestAnimationFrame(function () {
12796
- _this3.rafHandle = undefined;
12797
- _this3.performLayout();
12798
- });
12799
- }
12800
- }, {
12801
- key: "performLayout",
12802
- value: function performLayout() {
12803
- // Guards against a relayout firing before the underlying MapLibre `map`
12804
- // exists (e.g. a marker added before the "load" event) — `attach()`
12805
- // schedules its own initial pass once it's safe to touch `this.map`.
12806
- if (!this.attached) return;
12807
- var markers = this.mapvxMap.getMarkers();
12808
- if (markers.length === 0) return;
12809
- var container = this.map.getContainer();
12810
- var viewportWidth = container.clientWidth;
12811
- var viewportHeight = container.clientHeight;
12812
- var cullMargin = this.config.maxLabelWidthPx + Math.max(this.config.gapPx, this.config.verticalGapPx);
12813
- var entries = this.readMarkers(markers, viewportWidth, viewportHeight, cullMargin);
12814
- var decisions = this.decidePlacements(entries);
12815
- this.applyDecisions(decisions);
12816
- }
12817
-
12818
- /** Read phase: project + measure, no writes. Culls markers fully outside the viewport. */
12819
- }, {
12820
- key: "readMarkers",
12821
- value: function readMarkers(markers, viewportWidth, viewportHeight, cullMargin) {
12822
- var entries = [];
12823
- var _iterator = markerLayoutController_createForOfIteratorHelper(markers),
12824
- _step;
12825
- try {
12826
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
12827
- var marker = _step.value;
12828
- if (!marker.getElement().isConnected) continue;
12829
- var screen = this.map.project(marker.getLngLat());
12830
- var iconRect = computeIconRect(screen, this.resolveIconSize(marker), marker.anchorType);
12831
- var outOfViewport = iconRect.left + iconRect.width < -cullMargin || iconRect.left > viewportWidth + cullMargin || iconRect.top + iconRect.height < -cullMargin || iconRect.top > viewportHeight + cullMargin;
12832
- if (outOfViewport) continue;
12833
- entries.push({
12834
- marker: marker,
12835
- iconRect: iconRect,
12836
- labelSize: this.resolveLabelSize(marker)
12837
- });
12838
- }
12839
- } catch (err) {
12840
- _iterator.e(err);
12841
- } finally {
12842
- _iterator.f();
12843
- }
12844
- return entries;
12845
- }
12846
- }, {
12847
- key: "resolveLabelSize",
12848
- value: function resolveLabelSize(marker) {
12849
- var textEl = marker.textContainerEl;
12850
- if (!textEl) return undefined;
12851
- return this.measureCached(this.labelSizeCache, marker, textEl);
12852
- }
12853
-
12854
- /**
12855
- * The icon's box. Markers built from a caller-supplied `element` with no
12856
- * declared `iconProperties` are measured from the DOM, since their real
12857
- * size is whatever that element renders at; everyone else's box is exactly
12858
- * what `MarkerUtils.createMarkerElement` pinned it to.
12859
- */
12860
- }, {
12861
- key: "resolveIconSize",
12862
- value: function resolveIconSize(marker) {
12863
- var _this$measureCached;
12864
- if (!marker.measureIconFromDom) return marker.iconSize;
12865
- return (_this$measureCached = this.measureCached(this.iconSizeCache, marker, marker.getElement())) !== null && _this$measureCached !== void 0 ? _this$measureCached : marker.iconSize;
12866
- }
12867
-
12868
- /**
12869
- * Measures an element once and remembers it. A zero measurement is
12870
- * returned but never cached: it means the element isn't laid out yet (a
12871
- * `display: none` ancestor, a first pass before the web font loads), and
12872
- * caching it would freeze that marker's footprint at nothing for the rest
12873
- * of its life.
12874
- */
12875
- }, {
12876
- key: "measureCached",
12877
- value: function measureCached(cache, marker, element) {
12878
- var cached = cache.get(marker);
12879
- if (cached) return cached;
12880
- var measured = {
12881
- width: element.offsetWidth,
12882
- height: element.offsetHeight
12883
- };
12884
- if (measured.width <= 0 || measured.height <= 0) return undefined;
12885
- cache.set(marker, measured);
12886
- return measured;
12887
- }
12888
-
12889
- /** Compute phase: pure, no DOM access. Icons always block; labels negotiate a side or hide. */
12890
- }, {
12891
- key: "decidePlacements",
12892
- value: function decidePlacements(entries) {
12893
- var _this4 = this;
12894
- var placedLabels = [];
12895
- var withLabel = entries.filter(hasLabelSize);
12896
- // Stable sort (spec-guaranteed): equal priority keeps insertion order.
12897
- withLabel.sort(function (a, b) {
12898
- return b.marker.labelPriority - a.marker.labelPriority;
12899
- });
12900
- var decisions = new Map();
12901
- var _iterator2 = markerLayoutController_createForOfIteratorHelper(withLabel),
12902
- _step2;
12903
- try {
12904
- var _loop = function _loop() {
12905
- var entry = _step2.value;
12906
- var order = [entry.marker.preferredTextPosition].concat(_toConsumableArray(FALLBACK_ORDER.filter(function (position) {
12907
- return position !== entry.marker.preferredTextPosition;
12908
- })));
12909
- var fit = order.map(function (position) {
12910
- return {
12911
- position: position,
12912
- rect: computeCandidateRect(entry.iconRect, entry.labelSize, position, _this4.config.gapPx, _this4.config.verticalGapPx)
12913
- };
12914
- }).find(function (_ref2) {
12915
- var rect = _ref2.rect;
12916
- return !_this4.collides(rect, entry.marker, entries, placedLabels);
12917
- });
12918
- if (fit) {
12919
- placedLabels.push(fit.rect);
12920
- decisions.set(entry.marker, {
12921
- position: fit.position,
12922
- hidden: false
12923
- });
12924
- } else {
12925
- decisions.set(entry.marker, {
12926
- position: entry.marker.preferredTextPosition,
12927
- hidden: true
12928
- });
12929
- }
12930
- };
12931
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
12932
- _loop();
12933
- }
12934
- } catch (err) {
12935
- _iterator2.e(err);
12936
- } finally {
12937
- _iterator2.f();
12938
- }
12939
- return decisions;
12940
- }
12941
-
12942
- /**
12943
- * Whether a candidate label rect clashes with any other marker's icon or
12944
- * with a label already placed this pass.
12945
- *
12946
- * A label's own icon is deliberately excluded: `gapPx`/`verticalGapPx`
12947
- * already define the spacing to it, and `paddingPx` is breathing room
12948
- * against *neighbors*. Counting the own icon here would make top/bottom
12949
- * impossible for every marker as soon as `paddingPx` exceeded
12950
- * `verticalGapPx` (4 vs 4 by default) — and at `paddingPx: 10` would hide
12951
- * every label on the map.
12952
- */
12953
- }, {
12954
- key: "collides",
12955
- value: function collides(rect, self, entries, placedLabels) {
12956
- var padded = expandRect(rect, this.config.paddingPx);
12957
- return entries.some(function (other) {
12958
- return other.marker !== self && rectsIntersect(padded, other.iconRect);
12959
- }) || placedLabels.some(function (label) {
12960
- return rectsIntersect(padded, label);
12961
- });
12962
- }
12963
-
12964
- /** Write phase: only touches the DOM for markers whose decision actually changed. */
12965
- }, {
12966
- key: "applyDecisions",
12967
- value: function applyDecisions(decisions) {
12968
- var _this5 = this;
12969
- decisions.forEach(function (decision, marker) {
12970
- var last = _this5.lastAppliedState.get(marker);
12971
- if (last && last.position === decision.position && last.hidden === decision.hidden) return;
12972
- if (marker.textContainerEl) {
12973
- MarkerUtils.applyTextPosition(marker.textContainerEl, decision.position, decision.hidden);
12974
- }
12975
- _this5.lastAppliedState.set(marker, decision);
12976
- });
12977
- }
12978
- }]);
12979
- }();
12980
- function hasLabelSize(entry) {
12981
- return entry.labelSize !== undefined;
12982
- }
12983
12389
  ;// ./src/domain/models/routeInstance.ts
12984
12390
  /**
12985
12391
  * Represents the conditions for the step animation.
@@ -13209,10 +12615,10 @@ nav_functions_defineProperty(NavFunctions, "EARTH_RADIUS", 6378000);
13209
12615
  function routeController_typeof(o) { "@babel/helpers - typeof"; return routeController_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, routeController_typeof(o); }
13210
12616
  function routeController_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13211
12617
  function routeController_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? routeController_ownKeys(Object(t), !0).forEach(function (r) { routeController_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : routeController_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13212
- function routeController_toConsumableArray(r) { return routeController_arrayWithoutHoles(r) || routeController_iterableToArray(r) || routeController_unsupportedIterableToArray(r) || routeController_nonIterableSpread(); }
13213
- function routeController_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13214
- function routeController_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
13215
- function routeController_arrayWithoutHoles(r) { if (Array.isArray(r)) return routeController_arrayLikeToArray(r); }
12618
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || routeController_unsupportedIterableToArray(r) || _nonIterableSpread(); }
12619
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12620
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
12621
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return routeController_arrayLikeToArray(r); }
13216
12622
  function routeController_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = routeController_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
13217
12623
  function routeController_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return routeController_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? routeController_arrayLikeToArray(r, a) : void 0; } }
13218
12624
  function routeController_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
@@ -13639,7 +13045,7 @@ var RouteController = /*#__PURE__*/function () {
13639
13045
  throw new Error("Error: position array has different length than colors array");
13640
13046
  }
13641
13047
  var stops = createStops(positionsToUse, colors);
13642
- var gradient = ["interpolate", ["linear"], ["line-progress"]].concat(routeController_toConsumableArray(stops));
13048
+ var gradient = ["interpolate", ["linear"], ["line-progress"]].concat(_toConsumableArray(stops));
13643
13049
  return {
13644
13050
  "line-color": null,
13645
13051
  "line-gradient": gradient,
@@ -13749,30 +13155,6 @@ var RouteController = /*#__PURE__*/function () {
13749
13155
  }
13750
13156
  }
13751
13157
 
13752
- /**
13753
- * Every active route's marker. Used by `MarkerLayoutController` so marker
13754
- * labels are never placed on top of a route's own marker.
13755
- * @internal
13756
- */
13757
- }, {
13758
- key: "getRouteMarkers",
13759
- value: function getRouteMarkers() {
13760
- var markers = [];
13761
- var _iterator6 = routeController_createForOfIteratorHelper(this.routes.values()),
13762
- _step6;
13763
- try {
13764
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
13765
- var instance = _step6.value;
13766
- if (instance.routeMarker) markers.push(instance.routeMarker);
13767
- }
13768
- } catch (err) {
13769
- _iterator6.e(err);
13770
- } finally {
13771
- _iterator6.f();
13772
- }
13773
- return markers;
13774
- }
13775
-
13776
13158
  /**
13777
13159
  * Update the visibility of route markers for all active routes.
13778
13160
  * @param floorId The floor ID to update the visibility for.
@@ -13780,18 +13162,18 @@ var RouteController = /*#__PURE__*/function () {
13780
13162
  }, {
13781
13163
  key: "updateRouteMarkerVisibility",
13782
13164
  value: function updateRouteMarkerVisibility(floorId) {
13783
- var _iterator7 = routeController_createForOfIteratorHelper(this.routes.values()),
13784
- _step7;
13165
+ var _iterator6 = routeController_createForOfIteratorHelper(this.routes.values()),
13166
+ _step6;
13785
13167
  try {
13786
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
13168
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
13787
13169
  var _instance$routeMarker, _instance$routeMarker2, _instance$routeMarker3;
13788
- var instance = _step7.value;
13170
+ var instance = _step6.value;
13789
13171
  ((_instance$routeMarker = instance.routeMarker) === null || _instance$routeMarker === void 0 ? void 0 : _instance$routeMarker.floorId) === floorId ? (_instance$routeMarker2 = instance.routeMarker) === null || _instance$routeMarker2 === void 0 ? void 0 : _instance$routeMarker2.show(this.map) : (_instance$routeMarker3 = instance.routeMarker) === null || _instance$routeMarker3 === void 0 ? void 0 : _instance$routeMarker3.hide();
13790
13172
  }
13791
13173
  } catch (err) {
13792
- _iterator7.e(err);
13174
+ _iterator6.e(err);
13793
13175
  } finally {
13794
- _iterator7.f();
13176
+ _iterator6.f();
13795
13177
  }
13796
13178
  }
13797
13179
  }, {
@@ -13911,7 +13293,7 @@ var RouteController = /*#__PURE__*/function () {
13911
13293
  this.removeSourcesAndLayersForRoute(instance);
13912
13294
  this.routes["delete"](instance.id);
13913
13295
  if (this.lastAddedRouteId === instance.id) {
13914
- var remaining = routeController_toConsumableArray(this.routes.keys());
13296
+ var remaining = _toConsumableArray(this.routes.keys());
13915
13297
  this.lastAddedRouteId = remaining.length > 0 ? remaining[remaining.length - 1] : undefined;
13916
13298
  }
13917
13299
  this.syncRouteCollision();
@@ -13923,18 +13305,18 @@ var RouteController = /*#__PURE__*/function () {
13923
13305
  }, {
13924
13306
  key: "removeAllRoutes",
13925
13307
  value: function removeAllRoutes() {
13926
- var _iterator8 = routeController_createForOfIteratorHelper(this.routes.values()),
13927
- _step8;
13308
+ var _iterator7 = routeController_createForOfIteratorHelper(this.routes.values()),
13309
+ _step7;
13928
13310
  try {
13929
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
13930
- var instance = _step8.value;
13311
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
13312
+ var instance = _step7.value;
13931
13313
  this.clearRouteInstance(instance);
13932
13314
  this.removeSourcesAndLayersForRoute(instance);
13933
13315
  }
13934
13316
  } catch (err) {
13935
- _iterator8.e(err);
13317
+ _iterator7.e(err);
13936
13318
  } finally {
13937
- _iterator8.f();
13319
+ _iterator7.f();
13938
13320
  }
13939
13321
  this.routes.clear();
13940
13322
  this.lastAddedRouteId = undefined;
@@ -13948,7 +13330,7 @@ var RouteController = /*#__PURE__*/function () {
13948
13330
  }, {
13949
13331
  key: "getRouteIds",
13950
13332
  value: function getRouteIds() {
13951
- return routeController_toConsumableArray(this.routes.keys());
13333
+ return _toConsumableArray(this.routes.keys());
13952
13334
  }
13953
13335
  }, {
13954
13336
  key: "internalPause",
@@ -15169,8 +14551,6 @@ var Loggeable = /*#__PURE__*/function () {
15169
14551
  }]);
15170
14552
  }();
15171
14553
  ;// ./src/domain/models/mapConfig.ts
15172
-
15173
-
15174
14554
  /**
15175
14555
  * Configuration options for map tile caching.
15176
14556
  * Allows controlling how map tiles are cached in memory and persisted via service worker.
@@ -15213,40 +14593,6 @@ var DEFAULT_TILE_CACHE_CONFIG = {
15213
14593
  */
15214
14594
  var MAPLIBRE_MAX_TILE_CACHE_HARD_CAP = 100000;
15215
14595
 
15216
- /**
15217
- * Configuration for automatic marker label collision avoidance.
15218
- *
15219
- * When enabled, a marker's text label (see `MarkerConfig.textPosition`) is
15220
- * treated as a preferred starting side rather than a fixed placement: the
15221
- * SDK checks it against neighboring markers' icons and labels, moves it to
15222
- * a free side (right/top/left/bottom) when its preferred side is occupied,
15223
- * and hides it entirely when no side is collision-free. The marker's icon
15224
- * itself never moves.
15225
- *
15226
- * @example
15227
- * ```typescript
15228
- * const markerLayoutConfig: MarkerLayoutConfig = {
15229
- * enabled: true,
15230
- * gapPx: 8,
15231
- * maxLabelWidthPx: 160,
15232
- * };
15233
- * ```
15234
- *
15235
- * @group Configuration
15236
- */
15237
-
15238
- /**
15239
- * Default values for marker layout configuration
15240
- * @internal
15241
- */
15242
- var DEFAULT_MARKER_LAYOUT_CONFIG = {
15243
- enabled: true,
15244
- gapPx: 8,
15245
- verticalGapPx: 4,
15246
- paddingPx: 4,
15247
- maxLabelWidthPx: DEFAULT_MAX_LABEL_WIDTH_PX
15248
- };
15249
-
15250
14596
  /**
15251
14597
  * Basic configuration for the map.
15252
14598
  * Provides essential settings for initializing and customizing map behavior.
@@ -15296,7 +14642,6 @@ var DEFAULT_MARKER_LAYOUT_CONFIG = {
15296
14642
  * @property authToken - (Optional) Authentication token for accessing protected map resources. Required for loading map related data from Portal.
15297
14643
  * @property apiUrl - (Optional) Injected by SDK when creating map; base API URL for map requests.
15298
14644
  * @property mapvxRequestContext - (Optional) Injected by SDK when creating map; context sent as headers to public-api.mapvx.com.
15299
- * @property markerLayout - (Optional) Automatic marker label collision avoidance configuration.
15300
14645
  */
15301
14646
  ;// ./node_modules/.pnpm/@googlemaps+polyline-codec@1.0.28/node_modules/@googlemaps/polyline-codec/dist/index.esm.js
15302
14647
  /**
@@ -20490,7 +19835,6 @@ function convertPaddingToPixels(padding, containerWidth, containerHeight) {
20490
19835
 
20491
19836
 
20492
19837
 
20493
-
20494
19838
  /**
20495
19839
  * @group Map
20496
19840
  */
@@ -20564,12 +19908,6 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
20564
19908
  merged.maxTiles = Math.min(merged.maxTiles, MAPLIBRE_MAX_TILE_CACHE_HARD_CAP);
20565
19909
  return merged;
20566
19910
  }();
20567
- _this.markerLayoutConfig = map_objectSpread(map_objectSpread({}, DEFAULT_MARKER_LAYOUT_CONFIG), mapConfig.markerLayout);
20568
- _this.markerLayoutController = new MarkerLayoutController(_this, _this.markerLayoutConfig);
20569
- // `container` is the very element handed to MapLibre below, and every
20570
- // marker is mounted inside it, so publishing the gap/width variables here
20571
- // covers markers added before the map's "load" event fires.
20572
- _this.markerLayoutController.applyLayoutVariables(container);
20573
19911
  if (mapConfig.parentPlaceId != null) {
20574
19912
  _this.initialPlaceDetailSetUp(mapConfig.parentPlaceId, mapConfig.authToken);
20575
19913
  }
@@ -20737,7 +20075,6 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
20737
20075
  (_mapConfig$onMapReady = mapConfig.onMapReady) === null || _mapConfig$onMapReady === void 0 || _mapConfig$onMapReady.call(mapConfig);
20738
20076
  _this6.onHover();
20739
20077
  _this6.subscribeToFailedTiles();
20740
- _this6.markerLayoutController.attach();
20741
20078
  });
20742
20079
  // Self-healing for circles: a full style reload wipes custom sources and
20743
20080
  // layers, and not every restyle path goes through whenStyleUpdates.
@@ -20845,7 +20182,6 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
20845
20182
  key: "destroyMap",
20846
20183
  value: function destroyMap() {
20847
20184
  this.circles = [];
20848
- this.markerLayoutController.destroy();
20849
20185
  this.map.remove();
20850
20186
  this.unsubscribeFromFailedTiles();
20851
20187
  }
@@ -21037,31 +20373,12 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21037
20373
  this.filterByFloorKey(this.currentFloor);
21038
20374
  (_this$scene3D4 = this.scene3D) === null || _this$scene3D4 === void 0 || _this$scene3D4.refreshOverlay(this.currentFloor);
21039
20375
  }
21040
-
21041
- /**
21042
- * Internal accessor for every marker currently on the map, used by
21043
- * {@link MarkerLayoutController} to compute collision avoidance. Not part
21044
- * of the public `MapVXMap` interface.
21045
- *
21046
- * The user-location marker and the route controller's markers live outside
21047
- * `this.markers`, but they still occupy screen space — leaving them out
21048
- * would let labels be placed straight on top of them. They carry no label
21049
- * of their own, so they only ever act as obstacles.
21050
- * @internal
21051
- */
21052
- }, {
21053
- key: "getMarkers",
21054
- value: function getMarkers() {
21055
- var unmanaged = this.routeController.getRouteMarkers();
21056
- if (this.userLocationMarker) unmanaged.push(this.userLocationMarker);
21057
- return unmanaged.length > 0 ? [].concat(map_toConsumableArray(this.markers), map_toConsumableArray(unmanaged)) : this.markers;
21058
- }
21059
20376
  }, {
21060
20377
  key: "addMarker",
21061
20378
  value: function addMarker(marker) {
21062
20379
  var _this1 = this;
21063
20380
  try {
21064
- var _marker$maxLabelWidth, _this$innerFloors$fin4, _this$innerFloors$fin5;
20381
+ var _this$innerFloors$fin4, _this$innerFloors$fin5;
21065
20382
  // Check if a marker with the same ID already exists and remove it
21066
20383
  if (marker.id) {
21067
20384
  var existingMarkerIndex = this.markers.findIndex(function (m) {
@@ -21077,15 +20394,12 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21077
20394
  });
21078
20395
  }
21079
20396
  }
21080
- var markerCreated = new MarkerAttribute(map_objectSpread(map_objectSpread({}, marker), {}, {
21081
- maxLabelWidthPx: (_marker$maxLabelWidth = marker.maxLabelWidthPx) !== null && _marker$maxLabelWidth !== void 0 ? _marker$maxLabelWidth : this.markerLayoutConfig.maxLabelWidthPx
21082
- }));
20397
+ var markerCreated = new MarkerAttribute(marker);
21083
20398
  var isOutdoor = !this.parentPlace || ((_this$innerFloors$fin4 = (_this$innerFloors$fin5 = this.innerFloors.find(function (floor) {
21084
20399
  return floor.key === _this1.currentFloor;
21085
20400
  })) === null || _this$innerFloors$fin5 === void 0 ? void 0 : _this$innerFloors$fin5.reachableFromGPS) !== null && _this$innerFloors$fin4 !== void 0 ? _this$innerFloors$fin4 : false);
21086
20401
  markerCreated.changeFloor(this.currentFloor, this.map, isOutdoor);
21087
20402
  this.markers.push(markerCreated);
21088
- this.markerLayoutController.scheduleRelayout();
21089
20403
  this.logEvent("addMarker");
21090
20404
  return markerCreated.id;
21091
20405
  } catch (error) {
@@ -21104,8 +20418,6 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21104
20418
  });
21105
20419
  if (_marker !== undefined) {
21106
20420
  _marker.updateIcon(markerConfig);
21107
- this.markerLayoutController.invalidateMarker(_marker);
21108
- this.markerLayoutController.scheduleRelayout();
21109
20421
  }
21110
20422
  this.logEvent("updateMarker");
21111
20423
  return (_marker$id = _marker === null || _marker === void 0 ? void 0 : _marker.id) !== null && _marker$id !== void 0 ? _marker$id : "";
@@ -21124,7 +20436,6 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21124
20436
  });
21125
20437
  if (_marker2 !== undefined) {
21126
20438
  _marker2.setLngLat(newPosition);
21127
- this.markerLayoutController.scheduleRelayout();
21128
20439
  }
21129
20440
  this.logEvent("updateMarkerPosition");
21130
20441
  } catch (error) {
@@ -21142,7 +20453,6 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21142
20453
  });
21143
20454
  if (_marker3 !== null && this.map) {
21144
20455
  _marker3 === null || _marker3 === void 0 || _marker3.show(this.map);
21145
- this.markerLayoutController.scheduleRelayout();
21146
20456
  }
21147
20457
  this.logEvent("showMarker");
21148
20458
  } catch (error) {
@@ -21158,7 +20468,6 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21158
20468
  });
21159
20469
  if (_marker4 !== null) {
21160
20470
  _marker4 === null || _marker4 === void 0 || _marker4.hide();
21161
- this.markerLayoutController.scheduleRelayout();
21162
20471
  }
21163
20472
  this.logEvent("hideMarker");
21164
20473
  } catch (error) {
@@ -21177,7 +20486,6 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21177
20486
  this.markers = this.markers.filter(function (e) {
21178
20487
  return e.id !== markerId;
21179
20488
  });
21180
- this.markerLayoutController.scheduleRelayout();
21181
20489
  }
21182
20490
  this.logEvent("removeMarker");
21183
20491
  } catch (error) {
@@ -21194,7 +20502,6 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21194
20502
  marker.remove();
21195
20503
  });
21196
20504
  this.markers = [];
21197
- this.markerLayoutController.scheduleRelayout();
21198
20505
  this.logEvent("removeAllMarkers");
21199
20506
  } catch (error) {
21200
20507
  throw new Error("Failed to remove all markers", {
@@ -21628,7 +20935,6 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21628
20935
  this.markers.forEach(function (e) {
21629
20936
  e.changeFloor(floorId, _this10.map, isOutdoor);
21630
20937
  });
21631
- this.markerLayoutController.scheduleRelayout();
21632
20938
  }
21633
20939
  }, {
21634
20940
  key: "updateFiltersTo",
@@ -22702,7 +22008,6 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22702
22008
  }, {
22703
22009
  key: "addUserLocationTracking",
22704
22010
  value: function addUserLocationTracking(enableHighAccuracy, geoLocation, icon) {
22705
- var _this14 = this;
22706
22011
  var initialCoordinate = {
22707
22012
  lat: 0.0,
22708
22013
  lng: 0.0
@@ -22723,10 +22028,8 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22723
22028
  var marker = new MarkerAttribute(markerConfig);
22724
22029
  marker.addToMap(this.map);
22725
22030
  this.userLocationMarker = marker;
22726
- this.markerLayoutController.scheduleRelayout();
22727
22031
  var updateMarker = function updateMarker(position) {
22728
22032
  marker.setLngLat([position.coords.longitude, position.coords.latitude]);
22729
- _this14.markerLayoutController.scheduleRelayout();
22730
22033
  };
22731
22034
  this.geoLocation = geoLocation !== null && geoLocation !== void 0 ? geoLocation : navigator.geolocation;
22732
22035
  this.watchPositionID = this.geoLocation.watchPosition(updateMarker, function (error) {
@@ -22741,7 +22044,6 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22741
22044
  if (this.userLocationMarker !== undefined) {
22742
22045
  this.userLocationMarker.remove();
22743
22046
  this.userLocationMarker = undefined;
22744
- this.markerLayoutController.scheduleRelayout();
22745
22047
 
22746
22048
  // Check if watchPosition ID is valid and stop tracking
22747
22049
  if (this.watchPositionID) {
@@ -22810,7 +22112,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22810
22112
  key: "onWebGLContextLost",
22811
22113
  value: function onWebGLContextLost(e) {
22812
22114
  var _this$map,
22813
- _this15 = this;
22115
+ _this14 = this;
22814
22116
  e.originalEvent.preventDefault();
22815
22117
  console.warn("Contexto WebGL perdido 😢");
22816
22118
 
@@ -22821,8 +22123,8 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22821
22123
  var _ext$restoreContext;
22822
22124
  canvas.addEventListener("webglcontextrestored", function () {
22823
22125
  console.debug("Contexto WebGL restaurado, forzando re-render");
22824
- _this15.map.triggerRepaint(); // forzar repaint
22825
- _this15.failedTiles.clear();
22126
+ _this14.map.triggerRepaint(); // forzar repaint
22127
+ _this14.failedTiles.clear();
22826
22128
  }, {
22827
22129
  once: true
22828
22130
  });
@@ -22862,7 +22164,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22862
22164
  }, {
22863
22165
  key: "subscribeToFailedTiles",
22864
22166
  value: function subscribeToFailedTiles() {
22865
- var _this16 = this;
22167
+ var _this15 = this;
22866
22168
  if (this.retryTimer) return;
22867
22169
 
22868
22170
  // Store bound functions for proper cleanup
@@ -22871,20 +22173,20 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22871
22173
  this.boundOnWebGLContextLost = this.onWebGLContextLost.bind(this);
22872
22174
  this.boundOnWebGLContextRestored = this.onWebGLContextRestored.bind(this);
22873
22175
  this.retryTimer = setInterval(function () {
22874
- if (!_this16.map.getSource("indoorequal")) {
22875
- _this16.failedTiles.clear();
22176
+ if (!_this15.map.getSource("indoorequal")) {
22177
+ _this15.failedTiles.clear();
22876
22178
  return;
22877
22179
  }
22878
- var source = _this16.map.getSource("indoorequal");
22180
+ var source = _this15.map.getSource("indoorequal");
22879
22181
  if (!source || source.type !== "vector") {
22880
- _this16.failedTiles.clear();
22182
+ _this15.failedTiles.clear();
22881
22183
  return;
22882
22184
  }
22883
22185
 
22884
22186
  // Process tiles and remove invalid ones
22885
22187
  var tilesToRetry = [];
22886
22188
  var tilesToRemove = [];
22887
- _this16.failedTiles.forEach(function (tile) {
22189
+ _this15.failedTiles.forEach(function (tile) {
22888
22190
  // Check if tile is still valid before attempting reload
22889
22191
  if (!tile || tile.state === "unloaded" || tile.state === "loading") {
22890
22192
  tilesToRemove.push(tile);
@@ -22902,14 +22204,14 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22902
22204
 
22903
22205
  // Remove invalid tiles from the set
22904
22206
  tilesToRemove.forEach(function (tile) {
22905
- return _this16.failedTiles["delete"](tile);
22207
+ return _this15.failedTiles["delete"](tile);
22906
22208
  });
22907
22209
 
22908
22210
  // Attempt to reload valid failed tiles
22909
22211
  var now = Date.now();
22910
22212
  tilesToRetry.forEach(function (tile) {
22911
- var _this16$tileRetryStat;
22912
- var retry = (_this16$tileRetryStat = _this16.tileRetryState.get(tile)) !== null && _this16$tileRetryStat !== void 0 ? _this16$tileRetryStat : {
22213
+ var _this15$tileRetryStat;
22214
+ var retry = (_this15$tileRetryStat = _this15.tileRetryState.get(tile)) !== null && _this15$tileRetryStat !== void 0 ? _this15$tileRetryStat : {
22913
22215
  attempts: 0,
22914
22216
  nextAttemptAt: 0,
22915
22217
  pending: false
@@ -22920,16 +22222,16 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22920
22222
  var onFailure = function onFailure(error) {
22921
22223
  var attempts = retry.attempts + 1;
22922
22224
  if (attempts >= MAX_TILE_RETRIES) {
22923
- _this16.debugLog("Tile reload failed ".concat(attempts, " times, dropping it from the retry queue"), error);
22924
- _this16.failedTiles["delete"](tile);
22925
- _this16.tileRetryState["delete"](tile);
22225
+ _this15.debugLog("Tile reload failed ".concat(attempts, " times, dropping it from the retry queue"), error);
22226
+ _this15.failedTiles["delete"](tile);
22227
+ _this15.tileRetryState["delete"](tile);
22926
22228
  return;
22927
22229
  }
22928
22230
 
22929
22231
  // Stay in the queue and try again once the backoff has elapsed.
22930
22232
  var backoffMs = TILE_RETRY_BASE_DELAY_MS * Math.pow(2, attempts - 1);
22931
- _this16.debugLog("Tile reload failed (attempt ".concat(attempts, "/").concat(MAX_TILE_RETRIES, "), retrying in ").concat(backoffMs, "ms"), error);
22932
- _this16.tileRetryState.set(tile, {
22233
+ _this15.debugLog("Tile reload failed (attempt ".concat(attempts, "/").concat(MAX_TILE_RETRIES, "), retrying in ").concat(backoffMs, "ms"), error);
22234
+ _this15.tileRetryState.set(tile, {
22933
22235
  attempts: attempts,
22934
22236
  nextAttemptAt: Date.now() + backoffMs,
22935
22237
  pending: false
@@ -22938,7 +22240,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22938
22240
  try {
22939
22241
  // Verify tile still exists and is in a retryable state
22940
22242
  if (tile && (tile.state === "errored" || tile.state === "expired")) {
22941
- _this16.tileRetryState.set(tile, map_objectSpread(map_objectSpread({}, retry), {}, {
22243
+ _this15.tileRetryState.set(tile, map_objectSpread(map_objectSpread({}, retry), {}, {
22942
22244
  pending: true
22943
22245
  }));
22944
22246
  // loadTile is async, so a rejection escapes this try/catch and has to be handled
@@ -22948,7 +22250,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22948
22250
  // Loaded: forget the attempt history so a later failure starts from zero. The
22949
22251
  // tile leaves the queue through the tilesToRemove branch on the next tick,
22950
22252
  // once its state is no longer errored/expired.
22951
- _this16.tileRetryState["delete"](tile);
22253
+ _this15.tileRetryState["delete"](tile);
22952
22254
  })["catch"](onFailure);
22953
22255
  }
22954
22256
  } catch (error) {