@mapvx/web-js 3.1.0 → 3.2.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.
- package/dist/cjs/controllers/markerLayoutController.js +359 -0
- package/dist/cjs/controllers/markerLayoutController.js.map +1 -0
- package/dist/cjs/controllers/routeController.js +13 -0
- package/dist/cjs/controllers/routeController.js.map +1 -1
- package/dist/cjs/domain/models/mapConfig.js +14 -1
- package/dist/cjs/domain/models/mapConfig.js.map +1 -1
- package/dist/cjs/domain/models/marker.js +147 -82
- package/dist/cjs/domain/models/marker.js.map +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/logger/sentry.js +1 -1
- package/dist/cjs/map/map.js +41 -3
- package/dist/cjs/map/map.js.map +1 -1
- package/dist/cjs/utils/mapvxHostname.js +4 -3
- package/dist/cjs/utils/mapvxHostname.js.map +1 -1
- package/dist/es/config/sdkConfig.d.ts +1 -1
- package/dist/es/controllers/markerLayoutController.d.ts +148 -0
- package/dist/es/controllers/markerLayoutController.d.ts.map +1 -0
- package/dist/es/controllers/markerLayoutController.js +351 -0
- package/dist/es/controllers/markerLayoutController.js.map +1 -0
- package/dist/es/controllers/routeController.d.ts +7 -0
- package/dist/es/controllers/routeController.d.ts.map +1 -1
- package/dist/es/controllers/routeController.js +13 -0
- package/dist/es/controllers/routeController.js.map +1 -1
- package/dist/es/domain/models/mapConfig.d.ts +96 -0
- package/dist/es/domain/models/mapConfig.d.ts.map +1 -1
- package/dist/es/domain/models/mapConfig.js +13 -0
- package/dist/es/domain/models/mapConfig.js.map +1 -1
- package/dist/es/domain/models/marker.d.ts +232 -1
- package/dist/es/domain/models/marker.d.ts.map +1 -1
- package/dist/es/domain/models/marker.js +146 -82
- package/dist/es/domain/models/marker.js.map +1 -1
- package/dist/es/index.d.ts +2 -2
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/logger/sentry.js +1 -1
- package/dist/es/map/map.d.ts +15 -1
- package/dist/es/map/map.d.ts.map +1 -1
- package/dist/es/map/map.js +42 -4
- package/dist/es/map/map.js.map +1 -1
- package/dist/es/utils/mapvxHostname.d.ts +3 -2
- package/dist/es/utils/mapvxHostname.d.ts.map +1 -1
- package/dist/es/utils/mapvxHostname.js +4 -3
- package/dist/es/utils/mapvxHostname.js.map +1 -1
- package/dist/umd/index.js +867 -133
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/styles.css +45 -19
- package/dist/umd/styles.css.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MarkerAttribute = exports.TextPosition = void 0;
|
|
3
|
+
exports.MarkerAttribute = exports.MarkerUtils = exports.DEFAULT_MAX_LABEL_WIDTH_PX = exports.DEFAULT_ICON_SIZE_PX = exports.TextPosition = void 0;
|
|
4
4
|
const maplibre_gl_1 = require("maplibre-gl");
|
|
5
5
|
const utils_1 = require("../../utils/utils");
|
|
6
6
|
/**
|
|
@@ -29,6 +29,20 @@ var TextPosition;
|
|
|
29
29
|
/** Text positioned below the icon */
|
|
30
30
|
TextPosition[TextPosition["bottom"] = 3] = "bottom";
|
|
31
31
|
})(TextPosition || (exports.TextPosition = TextPosition = {}));
|
|
32
|
+
/**
|
|
33
|
+
* Fallback icon width/height, in pixels, used whenever a marker is created
|
|
34
|
+
* without explicit `iconProperties`.
|
|
35
|
+
*
|
|
36
|
+
* @group Markers
|
|
37
|
+
*/
|
|
38
|
+
exports.DEFAULT_ICON_SIZE_PX = 40;
|
|
39
|
+
/**
|
|
40
|
+
* Fallback maximum label width, in pixels, used whenever neither the marker
|
|
41
|
+
* nor the map's `markerLayout` configuration specifies one.
|
|
42
|
+
*
|
|
43
|
+
* @group Markers
|
|
44
|
+
*/
|
|
45
|
+
exports.DEFAULT_MAX_LABEL_WIDTH_PX = 200;
|
|
32
46
|
/**
|
|
33
47
|
* Utility class for creating and manipulating marker elements on a map.
|
|
34
48
|
* Provides static methods for marker element creation and styling.
|
|
@@ -51,78 +65,52 @@ class MarkerUtils {
|
|
|
51
65
|
var _a, _b, _c, _d;
|
|
52
66
|
const markerContainer = document.createElement("div");
|
|
53
67
|
// Configure specific marker dimensions
|
|
54
|
-
const iconWidth = (_b = (_a = marker.iconProperties) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b :
|
|
55
|
-
const iconHeight = (_d = (_c = marker.iconProperties) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d :
|
|
56
|
-
// Apply base class
|
|
68
|
+
const iconWidth = (_b = (_a = marker.iconProperties) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : exports.DEFAULT_ICON_SIZE_PX;
|
|
69
|
+
const iconHeight = (_d = (_c = marker.iconProperties) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : exports.DEFAULT_ICON_SIZE_PX;
|
|
70
|
+
// Apply base class. The container's own box is always the icon's box (or
|
|
71
|
+
// the custom `element`'s natural box) — the label is positioned
|
|
72
|
+
// absolutely (see .text-container in styles.css) so it never affects
|
|
73
|
+
// this box, which is exactly what MapLibre anchors the marker to.
|
|
57
74
|
markerContainer.className = "mapvx-marker";
|
|
58
|
-
// Configure classes and dimensions based on text presence
|
|
59
|
-
if (marker.text) {
|
|
60
|
-
// If text exists, adjust layout according to position
|
|
61
|
-
switch (marker.textPosition) {
|
|
62
|
-
case TextPosition.top:
|
|
63
|
-
case TextPosition.bottom:
|
|
64
|
-
markerContainer.classList.add("text-column");
|
|
65
|
-
markerContainer.style.width = `${Math.max(iconWidth, 200)}px`;
|
|
66
|
-
markerContainer.style.height = "auto";
|
|
67
|
-
break;
|
|
68
|
-
case TextPosition.left:
|
|
69
|
-
case TextPosition.right:
|
|
70
|
-
default:
|
|
71
|
-
markerContainer.classList.add("text-row");
|
|
72
|
-
markerContainer.style.width = "auto";
|
|
73
|
-
markerContainer.style.height = `${iconHeight}px`;
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
// No text, use fixed icon dimensions as in official example
|
|
79
|
-
markerContainer.classList.add("no-text");
|
|
80
|
-
markerContainer.style.width = `${iconWidth}px`;
|
|
81
|
-
markerContainer.style.height = `${iconHeight}px`;
|
|
82
|
-
}
|
|
83
75
|
markerContainer.addEventListener("click", () => {
|
|
84
76
|
var _a;
|
|
85
77
|
(_a = marker.onClick) === null || _a === void 0 ? void 0 : _a.call(marker);
|
|
86
78
|
});
|
|
79
|
+
// Custom element replaces icon entirely; the label (if any) still gets
|
|
80
|
+
// appended, positioned absolutely relative to it.
|
|
87
81
|
if (marker.element) {
|
|
82
|
+
// Only force a box when the caller declared the footprint. Otherwise
|
|
83
|
+
// the container is left to size itself to the custom element, and
|
|
84
|
+
// automatic label collision avoidance measures that real box from the
|
|
85
|
+
// DOM instead of assuming the default icon size — see
|
|
86
|
+
// {@link MarkerAttribute.measureIconFromDom}.
|
|
87
|
+
if (marker.iconProperties) {
|
|
88
|
+
markerContainer.style.width = `${iconWidth}px`;
|
|
89
|
+
markerContainer.style.height = `${iconHeight}px`;
|
|
90
|
+
}
|
|
88
91
|
markerContainer.appendChild(marker.element);
|
|
89
|
-
return this.setAndCreateText(marker, markerContainer
|
|
92
|
+
return this.setAndCreateText(marker, markerContainer);
|
|
90
93
|
}
|
|
91
|
-
|
|
94
|
+
markerContainer.style.width = `${iconWidth}px`;
|
|
95
|
+
markerContainer.style.height = `${iconHeight}px`;
|
|
92
96
|
const iconElement = this.createIconElement(marker, iconWidth, iconHeight);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
? this.createTextElement(marker.text, marker.textProperties)
|
|
96
|
-
: marker.text, marker.textPosition)
|
|
97
|
-
: null;
|
|
98
|
-
// Add elements in correct order
|
|
99
|
-
if (marker.textPosition === TextPosition.top || marker.textPosition === TextPosition.left) {
|
|
100
|
-
if (textElement)
|
|
101
|
-
markerContainer.appendChild(textElement);
|
|
102
|
-
markerContainer.appendChild(iconElement);
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
markerContainer.appendChild(iconElement);
|
|
106
|
-
if (textElement)
|
|
107
|
-
markerContainer.appendChild(textElement);
|
|
108
|
-
}
|
|
109
|
-
return markerContainer;
|
|
97
|
+
markerContainer.appendChild(iconElement);
|
|
98
|
+
return this.setAndCreateText(marker, markerContainer);
|
|
110
99
|
}
|
|
111
100
|
/**
|
|
112
|
-
*
|
|
101
|
+
* Appends the marker's text label (if any) to the container, positioned
|
|
102
|
+
* around whichever element (icon or custom `element`) is already there.
|
|
113
103
|
*
|
|
114
104
|
* @param markerConfig - Configuration object containing text properties
|
|
115
|
-
* @param container - Container element
|
|
116
|
-
* @
|
|
117
|
-
* @param iconWidth - Width of the icon for positioning calculations
|
|
118
|
-
* @returns Container element with properly positioned text
|
|
105
|
+
* @param container - Container element to append the label to
|
|
106
|
+
* @returns The same container, with the label appended when text is present
|
|
119
107
|
*/
|
|
120
|
-
static setAndCreateText(markerConfig, container
|
|
108
|
+
static setAndCreateText(markerConfig, container) {
|
|
121
109
|
if (markerConfig.text) {
|
|
122
110
|
const textElement = typeof markerConfig.text === "string"
|
|
123
111
|
? this.createTextElement(markerConfig.text, markerConfig.textProperties)
|
|
124
112
|
: markerConfig.text;
|
|
125
|
-
const textContainer = this.createTextContainer(textElement, markerConfig.textPosition);
|
|
113
|
+
const textContainer = this.createTextContainer(textElement, markerConfig.textPosition, markerConfig.maxLabelWidthPx);
|
|
126
114
|
container.appendChild(textContainer);
|
|
127
115
|
}
|
|
128
116
|
return container;
|
|
@@ -157,37 +145,62 @@ class MarkerUtils {
|
|
|
157
145
|
}
|
|
158
146
|
}
|
|
159
147
|
/**
|
|
160
|
-
* Creates a text container
|
|
161
|
-
*
|
|
148
|
+
* Creates a text container, absolutely positioned around the marker's icon
|
|
149
|
+
* via CSS (see `.text-container` in styles.css), so the label never affects
|
|
150
|
+
* the container's own box.
|
|
162
151
|
*
|
|
163
152
|
* @param textElement - The text element to contain
|
|
164
153
|
* @param textPosition - Desired position relative to the icon
|
|
154
|
+
* @param maxLabelWidthPx - Maximum label width in pixels before truncation
|
|
165
155
|
* @returns Container with text positioned using CSS classes
|
|
166
156
|
*/
|
|
167
|
-
static createTextContainer(textElement, textPosition) {
|
|
157
|
+
static createTextContainer(textElement, textPosition, maxLabelWidthPx) {
|
|
168
158
|
const textContainer = document.createElement("div");
|
|
169
159
|
// Apply base class
|
|
170
160
|
textContainer.className = "text-container";
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
case TextPosition.top:
|
|
174
|
-
textContainer.classList.add("top");
|
|
175
|
-
break;
|
|
176
|
-
case TextPosition.bottom:
|
|
177
|
-
textContainer.classList.add("bottom");
|
|
178
|
-
break;
|
|
179
|
-
case TextPosition.left:
|
|
180
|
-
textContainer.classList.add("left");
|
|
181
|
-
break;
|
|
182
|
-
default: // right
|
|
183
|
-
textContainer.classList.add("right");
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
161
|
+
textContainer.style.maxWidth = `${maxLabelWidthPx !== null && maxLabelWidthPx !== void 0 ? maxLabelWidthPx : exports.DEFAULT_MAX_LABEL_WIDTH_PX}px`;
|
|
162
|
+
this.setTextPositionClass(textContainer, this.resolveTextPosition(textPosition));
|
|
186
163
|
textElement.style.display = "block";
|
|
187
164
|
textElement.style.margin = "0";
|
|
188
165
|
textContainer.appendChild(textElement);
|
|
189
166
|
return textContainer;
|
|
190
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Resolves an optional {@link TextPosition} to its default (`right`), the
|
|
170
|
+
* same default `createTextContainer` has always applied.
|
|
171
|
+
*/
|
|
172
|
+
static resolveTextPosition(textPosition) {
|
|
173
|
+
return textPosition !== null && textPosition !== void 0 ? textPosition : TextPosition.right;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Swaps a text container's position class, keeping exactly one of
|
|
177
|
+
* `top|bottom|left|right` applied at a time.
|
|
178
|
+
*/
|
|
179
|
+
static setTextPositionClass(textContainer, position) {
|
|
180
|
+
textContainer.classList.remove("top", "bottom", "left", "right");
|
|
181
|
+
textContainer.classList.add(TextPosition[position]);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Repositions (or hides) a marker's already-rendered text label at
|
|
185
|
+
* runtime, without rebuilding any DOM. Used both by automatic collision
|
|
186
|
+
* avoidance and by anything else that needs to move a label after
|
|
187
|
+
* creation.
|
|
188
|
+
*
|
|
189
|
+
* @param textContainer - The `.text-container` element to reposition
|
|
190
|
+
* @param position - Side of the icon the label should render on
|
|
191
|
+
* @param hidden - Whether the label should be hidden (kept measurable via
|
|
192
|
+
* `visibility`, never removed via `display`, so it can be measured again
|
|
193
|
+
* to decide whether it fits once something else changes)
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```typescript
|
|
197
|
+
* MarkerUtils.applyTextPosition(textEl, TextPosition.left, false);
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
static applyTextPosition(textContainer, position, hidden) {
|
|
201
|
+
this.setTextPositionClass(textContainer, position);
|
|
202
|
+
textContainer.style.visibility = hidden ? "hidden" : "";
|
|
203
|
+
}
|
|
191
204
|
/**
|
|
192
205
|
* Creates and returns an icon element for the marker, using the image URL
|
|
193
206
|
* specified in the `MarkerConfig` object.
|
|
@@ -205,8 +218,8 @@ class MarkerUtils {
|
|
|
205
218
|
var _a, _b, _c, _d;
|
|
206
219
|
const image = document.createElement("img");
|
|
207
220
|
image.src = typeof marker.icon == "string" ? marker.icon : "";
|
|
208
|
-
image.width = (_b = (_a = marker.iconProperties) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b :
|
|
209
|
-
image.height = (_d = (_c = marker.iconProperties) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d :
|
|
221
|
+
image.width = (_b = (_a = marker.iconProperties) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : exports.DEFAULT_ICON_SIZE_PX;
|
|
222
|
+
image.height = (_d = (_c = marker.iconProperties) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : exports.DEFAULT_ICON_SIZE_PX;
|
|
210
223
|
image.style.objectFit = "contain";
|
|
211
224
|
image.style.filter = "drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25))";
|
|
212
225
|
return image;
|
|
@@ -242,6 +255,7 @@ class MarkerUtils {
|
|
|
242
255
|
return textElement;
|
|
243
256
|
}
|
|
244
257
|
}
|
|
258
|
+
exports.MarkerUtils = MarkerUtils;
|
|
245
259
|
/**
|
|
246
260
|
* Custom implementation of a MapLibre Marker with additional functionality.
|
|
247
261
|
* Extends the base MapLibre Marker class with MapVX-specific features.
|
|
@@ -273,7 +287,7 @@ class MarkerAttribute extends maplibre_gl_1.Marker {
|
|
|
273
287
|
* ```
|
|
274
288
|
*/
|
|
275
289
|
constructor(markerConfig) {
|
|
276
|
-
var _a, _b, _c, _d;
|
|
290
|
+
var _a, _b, _c, _d, _e;
|
|
277
291
|
super({
|
|
278
292
|
element: MarkerUtils.createMarkerElement(markerConfig),
|
|
279
293
|
draggable: false,
|
|
@@ -289,6 +303,49 @@ class MarkerAttribute extends maplibre_gl_1.Marker {
|
|
|
289
303
|
this.id = (_c = markerConfig.id) !== null && _c !== void 0 ? _c : (0, utils_1.generateHexadecimalKey)();
|
|
290
304
|
this.coordinate = markerConfig.coordinate;
|
|
291
305
|
this.floorId = (_d = markerConfig.floorId) !== null && _d !== void 0 ? _d : "";
|
|
306
|
+
// MapLibre resolves the anchor once, in the `super()` call above, and
|
|
307
|
+
// offers no way to change it afterwards — so this mirror is set here and
|
|
308
|
+
// never touched by `updateIcon`.
|
|
309
|
+
this.anchorType = (_e = markerConfig.anchor) !== null && _e !== void 0 ? _e : "center";
|
|
310
|
+
this.currentConfig = markerConfig;
|
|
311
|
+
this.applyLayoutState(markerConfig);
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Derives the state automatic label collision avoidance reads (icon box,
|
|
315
|
+
* preferred label side, priority, label element) from a fully-resolved
|
|
316
|
+
* config. It is what assigns the fields declared with `!` above — the
|
|
317
|
+
* constructor always calls it, but TypeScript can't see through the
|
|
318
|
+
* indirection. Shared by the constructor and {@link updateIcon} so the two can
|
|
319
|
+
* never drift apart.
|
|
320
|
+
*/
|
|
321
|
+
applyLayoutState(config) {
|
|
322
|
+
var _a, _b, _c, _d, _e;
|
|
323
|
+
this.iconSize = {
|
|
324
|
+
width: (_b = (_a = config.iconProperties) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : exports.DEFAULT_ICON_SIZE_PX,
|
|
325
|
+
height: (_d = (_c = config.iconProperties) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : exports.DEFAULT_ICON_SIZE_PX,
|
|
326
|
+
};
|
|
327
|
+
this.preferredTextPosition = MarkerUtils.resolveTextPosition(config.textPosition);
|
|
328
|
+
this.labelPriority = (_e = config.labelPriority) !== null && _e !== void 0 ? _e : 0;
|
|
329
|
+
this.measureIconFromDom = config.element != null && config.iconProperties == null;
|
|
330
|
+
this.textContainerEl = this.findTextContainerEl();
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Merges an update on top of the marker's current config, so a partial
|
|
334
|
+
* update such as `{ id, coordinate, icon }` keeps the marker's existing
|
|
335
|
+
* icon dimensions, label side and priority.
|
|
336
|
+
*
|
|
337
|
+
* `element` is deliberately *not* carried forward: it and `icon` are
|
|
338
|
+
* mutually exclusive rendering paths, and `updateIcon` has always chosen
|
|
339
|
+
* the path named by the update itself.
|
|
340
|
+
*/
|
|
341
|
+
mergeConfig(update) {
|
|
342
|
+
return Object.assign(Object.assign(Object.assign({}, this.currentConfig), update), { element: update.element });
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Finds this marker's `.text-container` child element, if it has one.
|
|
346
|
+
*/
|
|
347
|
+
findTextContainerEl() {
|
|
348
|
+
return Array.from(this._element.children).find((child) => child instanceof HTMLElement && child.classList.contains("text-container"));
|
|
292
349
|
}
|
|
293
350
|
/**
|
|
294
351
|
* Adds the marker attribute to the specified map.
|
|
@@ -309,6 +366,11 @@ class MarkerAttribute extends maplibre_gl_1.Marker {
|
|
|
309
366
|
/**
|
|
310
367
|
* Updates the icon of the marker attribute based on the specified marker configuration.
|
|
311
368
|
*
|
|
369
|
+
* The config is merged on top of the one the marker currently renders
|
|
370
|
+
* from, so a partial update keeps every property it omits — passing only
|
|
371
|
+
* `{ icon }` no longer resets the marker's icon dimensions, preferred
|
|
372
|
+
* label side or label priority to their defaults.
|
|
373
|
+
*
|
|
312
374
|
* @param marker - `MarkerConfig` object containing the new marker configuration
|
|
313
375
|
*
|
|
314
376
|
* @example
|
|
@@ -321,23 +383,26 @@ class MarkerAttribute extends maplibre_gl_1.Marker {
|
|
|
321
383
|
*/
|
|
322
384
|
updateIcon(marker) {
|
|
323
385
|
var _a, _b;
|
|
324
|
-
|
|
386
|
+
const config = this.mergeConfig(marker);
|
|
387
|
+
if (config.element) {
|
|
325
388
|
this._element.innerHTML = "";
|
|
326
|
-
this._element.appendChild(
|
|
389
|
+
this._element.appendChild(config.element);
|
|
327
390
|
}
|
|
328
391
|
else {
|
|
329
|
-
const markerElement = MarkerUtils.createMarkerElement(
|
|
392
|
+
const markerElement = MarkerUtils.createMarkerElement(config);
|
|
330
393
|
const oldMarkerContent = this._element.querySelector("div");
|
|
331
394
|
const newMarkerContent = markerElement.querySelector("div");
|
|
332
395
|
if (newMarkerContent) {
|
|
333
396
|
(_a = oldMarkerContent === null || oldMarkerContent === void 0 ? void 0 : oldMarkerContent.parentElement) === null || _a === void 0 ? void 0 : _a.replaceChild(newMarkerContent, oldMarkerContent);
|
|
334
397
|
}
|
|
335
398
|
}
|
|
336
|
-
this.setRotationAlignment((_b =
|
|
399
|
+
this.setRotationAlignment((_b = config.rotationAlignment) !== null && _b !== void 0 ? _b : "viewport");
|
|
337
400
|
this.setPitchAlignment("viewport");
|
|
338
|
-
if (typeof
|
|
339
|
-
this.setRotation(
|
|
401
|
+
if (typeof config.rotation === "number") {
|
|
402
|
+
this.setRotation(config.rotation);
|
|
340
403
|
}
|
|
404
|
+
this.currentConfig = config;
|
|
405
|
+
this.applyLayoutState(config);
|
|
341
406
|
}
|
|
342
407
|
/**
|
|
343
408
|
* Sets the current floor ID for the marker.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marker.js","sourceRoot":"","sources":["../../../../src/domain/models/marker.ts"],"names":[],"mappings":";;;AAAA,6CAAmE;AACnE,6CAA0D;AAG1D;;;;;;;;;;;;;;GAcG;AACH,IAAY,YASX;AATD,WAAY,YAAY;IACtB,8CAA8C;IAC9C,+CAAI,CAAA;IACJ,+CAA+C;IAC/C,iDAAK,CAAA;IACL,qCAAqC;IACrC,6CAAG,CAAA;IACH,qCAAqC;IACrC,mDAAM,CAAA;AACR,CAAC,EATW,YAAY,4BAAZ,YAAY,QASvB;
|
|
1
|
+
{"version":3,"file":"marker.js","sourceRoot":"","sources":["../../../../src/domain/models/marker.ts"],"names":[],"mappings":";;;AAAA,6CAAmE;AACnE,6CAA0D;AAG1D;;;;;;;;;;;;;;GAcG;AACH,IAAY,YASX;AATD,WAAY,YAAY;IACtB,8CAA8C;IAC9C,+CAAI,CAAA;IACJ,+CAA+C;IAC/C,iDAAK,CAAA;IACL,qCAAqC;IACrC,6CAAG,CAAA;IACH,qCAAqC;IACrC,mDAAM,CAAA;AACR,CAAC,EATW,YAAY,4BAAZ,YAAY,QASvB;AAED;;;;;GAKG;AACU,QAAA,oBAAoB,GAAG,EAAE,CAAA;AAEtC;;;;;GAKG;AACU,QAAA,0BAA0B,GAAG,GAAG,CAAA;AAwN7C;;;GAGG;AACH,MAAa,WAAW;IACtB;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,mBAAmB,CAAC,MAAoB;;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;QACH,CAAC;QACD,IAAI,CAAC,oBAAoB,CAAC,MAAA,MAAM,CAAC,iBAAiB,mCAAI,UAAU,CAAC,CAAA;QACjE,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAA;QAClC,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACxC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QACnC,CAAC;QACD,IAAI,CAAC,aAAa,GAAG,MAAM,CAAA;QAC3B,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC/B,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,OAAgB;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI;QACF,IAAI,CAAC,MAAM,EAAE,CAAA;IACf,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,GAAQ;QACX,IAAI,CAAC,GAAG;YAAE,OAAM;QAChB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACjB,CAAC;IAED;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,OAAkC,EAAE,GAAQ,EAAE,YAAqB,KAAK;QAClF,IAAI,OAAO,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAChB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,EAAE,CAAA;QACb,CAAC;IACH,CAAC;CACF;AArRD,0CAqRC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadStyles = exports.MAPVX_DEFAULT_PRECONNECT_HOSTS = exports.injectPreconnects = exports.isMapVxRequestHostname = exports.OpeningHoursHelper = exports.loadCustomization = exports.MVXTransport = exports.UnitSystem = exports.TransportationMode = exports.AnnounceFormat = exports.MVXRouteStep = exports.MVXRouteLeg = exports.MVXRoute = exports.MVXPlace = exports.TextPosition = exports.MAPLIBRE_MAX_TILE_CACHE_HARD_CAP = exports.DEFAULT_TILE_CACHE_CONFIG = exports.Institution = exports.isValidCircleConfig = exports.MAPVX_BRAND_COLOR = exports.CIRCLE_DEFAULTS = exports.circleRing = exports.isBasicWithLogo = exports.isBasicWithImageUrl = exports.isBasicWithIcon = exports.Banner = exports.createRouteAnimationIconDataUrl = exports.initializeSDK = exports.MVXLogger = exports.FetchHttpClient = exports.DEFAULT_MAX_STORAGE_BYTES = exports.DEFAULT_CACHE_CONFIGS = exports.CacheManager = exports.PersistentCache = exports.LRUCache = void 0;
|
|
3
|
+
exports.loadStyles = exports.MAPVX_DEFAULT_PRECONNECT_HOSTS = exports.injectPreconnects = exports.isMapVxRequestHostname = exports.OpeningHoursHelper = exports.loadCustomization = exports.MVXTransport = exports.UnitSystem = exports.TransportationMode = exports.AnnounceFormat = exports.MVXRouteStep = exports.MVXRouteLeg = exports.MVXRoute = exports.MVXPlace = exports.TextPosition = exports.MAPLIBRE_MAX_TILE_CACHE_HARD_CAP = exports.DEFAULT_TILE_CACHE_CONFIG = exports.DEFAULT_MARKER_LAYOUT_CONFIG = exports.Institution = exports.isValidCircleConfig = exports.MAPVX_BRAND_COLOR = exports.CIRCLE_DEFAULTS = exports.circleRing = exports.isBasicWithLogo = exports.isBasicWithImageUrl = exports.isBasicWithIcon = exports.Banner = exports.createRouteAnimationIconDataUrl = exports.initializeSDK = exports.MVXLogger = exports.FetchHttpClient = exports.DEFAULT_MAX_STORAGE_BYTES = exports.DEFAULT_CACHE_CONFIGS = exports.CacheManager = exports.PersistentCache = exports.LRUCache = void 0;
|
|
4
4
|
// ─── Infrastructure: Cache ───────────────────────────────────────────────────
|
|
5
5
|
var LRUCache_1 = require("./infrastructure/cache/LRUCache");
|
|
6
6
|
Object.defineProperty(exports, "LRUCache", { enumerable: true, get: function () { return LRUCache_1.LRUCache; } });
|
|
@@ -42,6 +42,7 @@ var institution_1 = require("./domain/models/institution");
|
|
|
42
42
|
Object.defineProperty(exports, "Institution", { enumerable: true, get: function () { return institution_1.Institution; } });
|
|
43
43
|
// ─── Domain Models: Map Config ───────────────────────────────────────────────
|
|
44
44
|
var mapConfig_1 = require("./domain/models/mapConfig");
|
|
45
|
+
Object.defineProperty(exports, "DEFAULT_MARKER_LAYOUT_CONFIG", { enumerable: true, get: function () { return mapConfig_1.DEFAULT_MARKER_LAYOUT_CONFIG; } });
|
|
45
46
|
Object.defineProperty(exports, "DEFAULT_TILE_CACHE_CONFIG", { enumerable: true, get: function () { return mapConfig_1.DEFAULT_TILE_CACHE_CONFIG; } });
|
|
46
47
|
Object.defineProperty(exports, "MAPLIBRE_MAX_TILE_CACHE_HARD_CAP", { enumerable: true, get: function () { return mapConfig_1.MAPLIBRE_MAX_TILE_CACHE_HARD_CAP; } });
|
|
47
48
|
// ─── Domain Models: Marker ───────────────────────────────────────────────────
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAKA,gFAAgF;AAChF,4DAA0D;AAAjD,oGAAA,QAAQ,OAAA;AACjB,0EAAwE;AAA/D,kHAAA,eAAe,OAAA;AACxB,oEAAkE;AAAzD,4GAAA,YAAY,OAAA;AAErB,kEAG2C;AAFzC,oHAAA,qBAAqB,OAAA;AACrB,wHAAA,yBAAyB,OAAA;AAG3B,gFAAgF;AAChF,yEAAuE;AAA9D,kHAAA,eAAe,OAAA;AAExB,gFAAgF;AAChF,gEAA8D;AAArD,sGAAA,SAAS,OAAA;AAKlB,gFAAgF;AAChF,6BAAqC;AAA5B,oGAAA,aAAa,OAAA;AAatB,gFAAgF;AAChF,wCAAgE;AAAvD,wHAAA,+BA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B"}
|
|
@@ -14,7 +14,7 @@ const browser_1 = require("@sentry/browser");
|
|
|
14
14
|
// exists only for the type-checker, so in the ES/CJS builds the identifier is
|
|
15
15
|
// genuinely absent and a direct comparison throws ReferenceError at module load.
|
|
16
16
|
// `typeof` is the only safe way to probe a possibly-undeclared global.
|
|
17
|
-
const SDK_VERSION = typeof VERSION === "undefined" ? "3.
|
|
17
|
+
const SDK_VERSION = typeof VERSION === "undefined" ? "3.2.0" : VERSION;
|
|
18
18
|
const DSN = typeof SENTRY_DSN !== "undefined" && SENTRY_DSN
|
|
19
19
|
? SENTRY_DSN
|
|
20
20
|
: "https://872f598f020e3cd73a0933b562d24c81@sentry.mapvx.app/5";
|
package/dist/cjs/map/map.js
CHANGED
|
@@ -176,6 +176,7 @@ function convertPaddingToPixels(padding, containerWidth, containerHeight) {
|
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
178
|
const icons_1 = require("../assets/icons");
|
|
179
|
+
const markerLayoutController_1 = require("../controllers/markerLayoutController");
|
|
179
180
|
const routeController_1 = require("../controllers/routeController");
|
|
180
181
|
const _rtl_1 = require("../domain/models/_rtl");
|
|
181
182
|
const animation_1 = require("../domain/models/animation");
|
|
@@ -253,6 +254,12 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
253
254
|
merged.maxTiles = Math.min(merged.maxTiles, mapConfig_1.MAPLIBRE_MAX_TILE_CACHE_HARD_CAP);
|
|
254
255
|
return merged;
|
|
255
256
|
})();
|
|
257
|
+
this.markerLayoutConfig = Object.assign(Object.assign({}, mapConfig_1.DEFAULT_MARKER_LAYOUT_CONFIG), mapConfig.markerLayout);
|
|
258
|
+
this.markerLayoutController = new markerLayoutController_1.MarkerLayoutController(this, this.markerLayoutConfig);
|
|
259
|
+
// `container` is the very element handed to MapLibre below, and every
|
|
260
|
+
// marker is mounted inside it, so publishing the gap/width variables here
|
|
261
|
+
// covers markers added before the map's "load" event fires.
|
|
262
|
+
this.markerLayoutController.applyLayoutVariables(container);
|
|
256
263
|
if (mapConfig.parentPlaceId != null) {
|
|
257
264
|
this.initialPlaceDetailSetUp(mapConfig.parentPlaceId, mapConfig.authToken);
|
|
258
265
|
}
|
|
@@ -393,6 +400,7 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
393
400
|
(_b = mapConfig.onMapReady) === null || _b === void 0 ? void 0 : _b.call(mapConfig);
|
|
394
401
|
this.onHover();
|
|
395
402
|
this.subscribeToFailedTiles();
|
|
403
|
+
this.markerLayoutController.attach();
|
|
396
404
|
});
|
|
397
405
|
// Self-healing for circles: a full style reload wipes custom sources and
|
|
398
406
|
// layers, and not every restyle path goes through whenStyleUpdates.
|
|
@@ -522,6 +530,7 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
522
530
|
}
|
|
523
531
|
destroyMap() {
|
|
524
532
|
this.circles = [];
|
|
533
|
+
this.markerLayoutController.destroy();
|
|
525
534
|
this.map.remove();
|
|
526
535
|
this.unsubscribeFromFailedTiles();
|
|
527
536
|
}
|
|
@@ -670,8 +679,25 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
670
679
|
this.filterByFloorKey(this.currentFloor);
|
|
671
680
|
(_a = this.scene3D) === null || _a === void 0 ? void 0 : _a.refreshOverlay(this.currentFloor);
|
|
672
681
|
}
|
|
682
|
+
/**
|
|
683
|
+
* Internal accessor for every marker currently on the map, used by
|
|
684
|
+
* {@link MarkerLayoutController} to compute collision avoidance. Not part
|
|
685
|
+
* of the public `MapVXMap` interface.
|
|
686
|
+
*
|
|
687
|
+
* The user-location marker and the route controller's markers live outside
|
|
688
|
+
* `this.markers`, but they still occupy screen space — leaving them out
|
|
689
|
+
* would let labels be placed straight on top of them. They carry no label
|
|
690
|
+
* of their own, so they only ever act as obstacles.
|
|
691
|
+
* @internal
|
|
692
|
+
*/
|
|
693
|
+
getMarkers() {
|
|
694
|
+
const unmanaged = this.routeController.getRouteMarkers();
|
|
695
|
+
if (this.userLocationMarker)
|
|
696
|
+
unmanaged.push(this.userLocationMarker);
|
|
697
|
+
return unmanaged.length > 0 ? [...this.markers, ...unmanaged] : this.markers;
|
|
698
|
+
}
|
|
673
699
|
addMarker(marker) {
|
|
674
|
-
var _a, _b;
|
|
700
|
+
var _a, _b, _c;
|
|
675
701
|
try {
|
|
676
702
|
// Check if a marker with the same ID already exists and remove it
|
|
677
703
|
if (marker.id) {
|
|
@@ -686,11 +712,12 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
686
712
|
});
|
|
687
713
|
}
|
|
688
714
|
}
|
|
689
|
-
const markerCreated = new marker_1.MarkerAttribute(marker);
|
|
715
|
+
const markerCreated = new marker_1.MarkerAttribute(Object.assign(Object.assign({}, marker), { maxLabelWidthPx: (_a = marker.maxLabelWidthPx) !== null && _a !== void 0 ? _a : this.markerLayoutConfig.maxLabelWidthPx }));
|
|
690
716
|
const isOutdoor = !this.parentPlace ||
|
|
691
|
-
((
|
|
717
|
+
((_c = (_b = this.innerFloors.find((floor) => floor.key === this.currentFloor)) === null || _b === void 0 ? void 0 : _b.reachableFromGPS) !== null && _c !== void 0 ? _c : false);
|
|
692
718
|
markerCreated.changeFloor(this.currentFloor, this.map, isOutdoor);
|
|
693
719
|
this.markers.push(markerCreated);
|
|
720
|
+
this.markerLayoutController.scheduleRelayout();
|
|
694
721
|
this.logEvent("addMarker");
|
|
695
722
|
return markerCreated.id;
|
|
696
723
|
}
|
|
@@ -704,6 +731,8 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
704
731
|
const marker = this.markers.find((e) => e.id === markerConfig.id);
|
|
705
732
|
if (marker !== undefined) {
|
|
706
733
|
marker.updateIcon(markerConfig);
|
|
734
|
+
this.markerLayoutController.invalidateMarker(marker);
|
|
735
|
+
this.markerLayoutController.scheduleRelayout();
|
|
707
736
|
}
|
|
708
737
|
this.logEvent("updateMarker");
|
|
709
738
|
return (_a = marker === null || marker === void 0 ? void 0 : marker.id) !== null && _a !== void 0 ? _a : "";
|
|
@@ -717,6 +746,7 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
717
746
|
const marker = this.markers.find((e) => e.id === markerId);
|
|
718
747
|
if (marker !== undefined) {
|
|
719
748
|
marker.setLngLat(newPosition);
|
|
749
|
+
this.markerLayoutController.scheduleRelayout();
|
|
720
750
|
}
|
|
721
751
|
this.logEvent("updateMarkerPosition");
|
|
722
752
|
}
|
|
@@ -729,6 +759,7 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
729
759
|
const marker = this.markers.find((e) => e.id === markerId);
|
|
730
760
|
if (marker !== null && this.map) {
|
|
731
761
|
marker === null || marker === void 0 ? void 0 : marker.show(this.map);
|
|
762
|
+
this.markerLayoutController.scheduleRelayout();
|
|
732
763
|
}
|
|
733
764
|
this.logEvent("showMarker");
|
|
734
765
|
}
|
|
@@ -741,6 +772,7 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
741
772
|
const marker = this.markers.find((e) => e.id === markerId);
|
|
742
773
|
if (marker !== null) {
|
|
743
774
|
marker === null || marker === void 0 ? void 0 : marker.hide();
|
|
775
|
+
this.markerLayoutController.scheduleRelayout();
|
|
744
776
|
}
|
|
745
777
|
this.logEvent("hideMarker");
|
|
746
778
|
}
|
|
@@ -754,6 +786,7 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
754
786
|
if (marker !== null) {
|
|
755
787
|
marker === null || marker === void 0 ? void 0 : marker.remove();
|
|
756
788
|
this.markers = this.markers.filter((e) => e.id !== markerId);
|
|
789
|
+
this.markerLayoutController.scheduleRelayout();
|
|
757
790
|
}
|
|
758
791
|
this.logEvent("removeMarker");
|
|
759
792
|
}
|
|
@@ -767,6 +800,7 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
767
800
|
marker.remove();
|
|
768
801
|
});
|
|
769
802
|
this.markers = [];
|
|
803
|
+
this.markerLayoutController.scheduleRelayout();
|
|
770
804
|
this.logEvent("removeAllMarkers");
|
|
771
805
|
}
|
|
772
806
|
catch (error) {
|
|
@@ -1126,6 +1160,7 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
1126
1160
|
this.markers.forEach((e) => {
|
|
1127
1161
|
e.changeFloor(floorId, this.map, isOutdoor);
|
|
1128
1162
|
});
|
|
1163
|
+
this.markerLayoutController.scheduleRelayout();
|
|
1129
1164
|
}
|
|
1130
1165
|
updateFiltersTo(floorId) {
|
|
1131
1166
|
var _a, _b, _c, _d;
|
|
@@ -1876,8 +1911,10 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
1876
1911
|
const marker = new marker_1.MarkerAttribute(markerConfig);
|
|
1877
1912
|
marker.addToMap(this.map);
|
|
1878
1913
|
this.userLocationMarker = marker;
|
|
1914
|
+
this.markerLayoutController.scheduleRelayout();
|
|
1879
1915
|
const updateMarker = (position) => {
|
|
1880
1916
|
marker.setLngLat([position.coords.longitude, position.coords.latitude]);
|
|
1917
|
+
this.markerLayoutController.scheduleRelayout();
|
|
1881
1918
|
};
|
|
1882
1919
|
this.geoLocation = geoLocation !== null && geoLocation !== void 0 ? geoLocation : navigator.geolocation;
|
|
1883
1920
|
this.watchPositionID = this.geoLocation.watchPosition(updateMarker, (error) => {
|
|
@@ -1890,6 +1927,7 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
1890
1927
|
if (this.userLocationMarker !== undefined) {
|
|
1891
1928
|
this.userLocationMarker.remove();
|
|
1892
1929
|
this.userLocationMarker = undefined;
|
|
1930
|
+
this.markerLayoutController.scheduleRelayout();
|
|
1893
1931
|
// Check if watchPosition ID is valid and stop tracking
|
|
1894
1932
|
if (this.watchPositionID) {
|
|
1895
1933
|
this.geoLocation.clearWatch(this.watchPositionID);
|