@mapvx/web-js 1.2.3 → 1.2.4-dev.2
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/assets/icons.js +8 -6
- package/dist/cjs/assets/icons.js.map +1 -1
- package/dist/cjs/assets/route_animation_icon.svg +15 -0
- package/dist/cjs/assets/user-dot-icon.svg +3 -0
- package/dist/cjs/domain/models/animation.js +2 -2
- package/dist/cjs/domain/models/categories.js +10 -23
- package/dist/cjs/domain/models/categories.js.map +1 -1
- package/dist/cjs/domain/models/marker.js +80 -86
- package/dist/cjs/domain/models/marker.js.map +1 -1
- package/dist/cjs/index.js +12 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/logger/logger.js +1 -1
- package/dist/cjs/logger/rollbar.js +1 -1
- package/dist/cjs/map/map.js +1 -1
- package/dist/cjs/repository/requester.js +64 -47
- package/dist/cjs/repository/requester.js.map +1 -1
- package/dist/es/assets/icons.d.ts +4 -4
- package/dist/es/assets/icons.d.ts.map +1 -1
- package/dist/es/assets/icons.js +8 -6
- package/dist/es/assets/icons.js.map +1 -1
- package/dist/es/assets/route_animation_icon.svg +15 -0
- package/dist/es/assets/user-dot-icon.svg +3 -0
- package/dist/es/domain/models/animation.d.ts +3 -3
- package/dist/es/domain/models/animation.js +2 -2
- package/dist/es/domain/models/categories.d.ts +10 -34
- package/dist/es/domain/models/categories.d.ts.map +1 -1
- package/dist/es/domain/models/categories.js +9 -21
- package/dist/es/domain/models/categories.js.map +1 -1
- package/dist/es/domain/models/marker.d.ts +0 -8
- package/dist/es/domain/models/marker.d.ts.map +1 -1
- package/dist/es/domain/models/marker.js +80 -86
- package/dist/es/domain/models/marker.js.map +1 -1
- package/dist/es/domain/models/routeConfiguration.d.ts +0 -38
- package/dist/es/domain/models/routeConfiguration.d.ts.map +1 -1
- package/dist/es/index.d.ts +12 -12
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +6 -6
- package/dist/es/index.js.map +1 -1
- package/dist/es/logger/logger.js +1 -1
- package/dist/es/logger/rollbar.js +1 -1
- package/dist/es/map/map.js +1 -1
- package/dist/es/repository/requester.d.ts +0 -12
- package/dist/es/repository/requester.d.ts.map +1 -1
- package/dist/es/repository/requester.js +64 -47
- package/dist/es/repository/requester.js.map +1 -1
- package/dist/umd/index.js +415 -498
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/styles.css +14 -32
- package/dist/umd/styles.css.map +1 -1
- package/package.json +3 -2
package/dist/cjs/assets/icons.js
CHANGED
|
@@ -6,7 +6,7 @@ exports.userLocationDataUrl = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//w
|
|
|
6
6
|
* Generates a data URL for the route animation icon SVG with customizable appearance.
|
|
7
7
|
*
|
|
8
8
|
* @param config - Optional configuration for the icon appearance.
|
|
9
|
-
* @param config.backgroundColor - The background color of the circle (default: "#
|
|
9
|
+
* @param config.backgroundColor - The background color of the circle (default: "#0076B6").
|
|
10
10
|
* @param config.arrowColor - The color of the arrow (default: "#FFFFFF").
|
|
11
11
|
* @param config.arrowWidth - The stroke width of the arrow path in pixels (default: 0).
|
|
12
12
|
* @param config.borderWidth - The border width of the circle in pixels (default: 0).
|
|
@@ -38,7 +38,7 @@ exports.userLocationDataUrl = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//w
|
|
|
38
38
|
*/
|
|
39
39
|
function createRouteAnimationIconDataUrl(config) {
|
|
40
40
|
var _a, _b, _c, _d, _e, _f;
|
|
41
|
-
const backgroundColor = (_a = config === null || config === void 0 ? void 0 : config.backgroundColor) !== null && _a !== void 0 ? _a : "#
|
|
41
|
+
const backgroundColor = (_a = config === null || config === void 0 ? void 0 : config.backgroundColor) !== null && _a !== void 0 ? _a : "#0076B6";
|
|
42
42
|
const arrowColor = (_b = config === null || config === void 0 ? void 0 : config.arrowColor) !== null && _b !== void 0 ? _b : "#FFFFFF";
|
|
43
43
|
const arrowWidth = (_c = config === null || config === void 0 ? void 0 : config.arrowWidth) !== null && _c !== void 0 ? _c : 0;
|
|
44
44
|
const borderWidth = (_d = config === null || config === void 0 ? void 0 : config.borderWidth) !== null && _d !== void 0 ? _d : 0;
|
|
@@ -58,11 +58,13 @@ function createRouteAnimationIconDataUrl(config) {
|
|
|
58
58
|
const filterAttr = blur > 0 ? `filter="url(#${filterId})"` : "";
|
|
59
59
|
const svg = `<?xml version="1.0" encoding="utf-8"?>
|
|
60
60
|
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
61
|
-
viewBox="0 0
|
|
61
|
+
viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve">
|
|
62
62
|
${filterDef}
|
|
63
63
|
<g ${filterAttr}>
|
|
64
|
-
<circle cx="
|
|
65
|
-
<path style="${arrowStyle}${arrowStroke}" d="
|
|
64
|
+
<circle cx="20" cy="20" r="20" style="${circleStyle}${circleStroke}"/>
|
|
65
|
+
<path style="${arrowStyle}${arrowStroke}" d="M12.4,29.7c-0.2,0.1-0.4,0.1-0.6,0.1c-0.2,0-0.4-0.1-0.5-0.3c-0.2-0.1-0.2-0.3-0.3-0.5c0-0.2,0-0.4,0.1-0.6
|
|
66
|
+
l8.2-17.8c0.2-0.4,0.5-0.6,0.9-0.6c0.4,0,0.7,0.2,0.9,0.6l7.9,17.9c0.1,0.2,0.1,0.4,0.1,0.6c0,0.2-0.1,0.4-0.3,0.5
|
|
67
|
+
c-0.1,0.1-0.3,0.2-0.5,0.3c-0.2,0-0.4,0-0.6-0.1L20,26.5L12.4,29.7z M13.9,27l6.1-2.6l6.1,2.7l-6-13.8L13.9,27z"/>
|
|
66
68
|
</g>
|
|
67
69
|
</svg>`;
|
|
68
70
|
// Encode the SVG as a data URL
|
|
@@ -71,7 +73,7 @@ ${filterDef}
|
|
|
71
73
|
}
|
|
72
74
|
exports.createRouteAnimationIconDataUrl = createRouteAnimationIconDataUrl;
|
|
73
75
|
/**
|
|
74
|
-
* Default route animation icon data URL with blue background (#
|
|
76
|
+
* Default route animation icon data URL with blue background (#0076B6) and white arrow (#FFFFFF).
|
|
75
77
|
* This constant is maintained for backward compatibility.
|
|
76
78
|
*
|
|
77
79
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../../src/assets/icons.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAC9B,mYAAmY,CAAA;AAwCrY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,SAAgB,+BAA+B,CAAC,MAAiC;;IAC/E,MAAM,eAAe,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,eAAe,mCAAI,SAAS,CAAA;IAC5D,MAAM,UAAU,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,mCAAI,SAAS,CAAA;IAClD,MAAM,UAAU,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,mCAAI,CAAC,CAAA;IAC1C,MAAM,WAAW,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,mCAAI,CAAC,CAAA;IAC5C,MAAM,WAAW,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,mCAAI,SAAS,CAAA;IACpD,MAAM,IAAI,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,mCAAI,CAAC,CAAA;IAE9B,0CAA0C;IAC1C,MAAM,WAAW,GAAG,QAAQ,eAAe,GAAG,CAAA;IAC9C,MAAM,YAAY,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,WAAW,iBAAiB,WAAW,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;IAEhG,yCAAyC;IACzC,MAAM,UAAU,GAAG,QAAQ,UAAU,GAAG,CAAA;IACxC,MAAM,WAAW,GAAG,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<!-- Generator: Adobe Illustrator 26.5.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve">
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
.st0{fill:#0076B6;}
|
|
7
|
+
.st1{fill:#FFFFFF;}
|
|
8
|
+
</style>
|
|
9
|
+
<g>
|
|
10
|
+
<circle class="st0" cx="20" cy="20" r="20"/>
|
|
11
|
+
<path class="st1" d="M12.4,29.7c-0.2,0.1-0.4,0.1-0.6,0.1c-0.2,0-0.4-0.1-0.5-0.3c-0.2-0.1-0.2-0.3-0.3-0.5c0-0.2,0-0.4,0.1-0.6
|
|
12
|
+
l8.2-17.8c0.2-0.4,0.5-0.6,0.9-0.6c0.4,0,0.7,0.2,0.9,0.6l7.9,17.9c0.1,0.2,0.1,0.4,0.1,0.6c0,0.2-0.1,0.4-0.3,0.5
|
|
13
|
+
c-0.1,0.1-0.3,0.2-0.5,0.3c-0.2,0-0.4,0-0.6-0.1L20,26.5L12.4,29.7z M13.9,27l6.1-2.6l6.1,2.7l-6-13.8L13.9,27z"/>
|
|
14
|
+
</g>
|
|
15
|
+
</svg>
|
|
@@ -26,11 +26,11 @@ class InternalAnimationDrawingConfig {
|
|
|
26
26
|
var _a, _b, _c;
|
|
27
27
|
this.aheadPathStyle = (_a = data.aheadPathStyle) !== null && _a !== void 0 ? _a : {
|
|
28
28
|
type: "Solid",
|
|
29
|
-
color: "#
|
|
29
|
+
color: "#757575",
|
|
30
30
|
};
|
|
31
31
|
this.behindPathStyle = (_b = data.behindPathStyle) !== null && _b !== void 0 ? _b : {
|
|
32
32
|
type: "Solid",
|
|
33
|
-
color: "#
|
|
33
|
+
color: "#0076B6",
|
|
34
34
|
};
|
|
35
35
|
this.polylineWidth = (_c = data.polylineWidth) !== null && _c !== void 0 ? _c : 10;
|
|
36
36
|
if (data.routeIcon != null) {
|
|
@@ -1,38 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Category.ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.isBasicWithIcon = exports.isBasicWithLogo = void 0;
|
|
5
5
|
/**
|
|
6
|
-
* Checks if the category
|
|
7
|
-
*
|
|
8
|
-
* @param category
|
|
9
|
-
* @returns
|
|
6
|
+
* Checks if the category is a basic with logo.
|
|
7
|
+
* @group Utils
|
|
8
|
+
* @param category
|
|
9
|
+
* @returns
|
|
10
10
|
*/
|
|
11
11
|
function isBasicWithLogo(category) {
|
|
12
|
-
|
|
13
|
-
return input.logo != null && input.logo !== "";
|
|
12
|
+
return category.logo !== undefined;
|
|
14
13
|
}
|
|
15
14
|
exports.isBasicWithLogo = isBasicWithLogo;
|
|
16
15
|
/**
|
|
17
|
-
* Checks if the category
|
|
16
|
+
* Checks if the category is a basic with icon.
|
|
18
17
|
* @group Utils
|
|
19
|
-
* @param category
|
|
20
|
-
* @returns
|
|
18
|
+
* @param category
|
|
19
|
+
* @returns
|
|
21
20
|
*/
|
|
22
21
|
function isBasicWithIcon(category) {
|
|
23
|
-
|
|
24
|
-
return input.icon != null && input.icon !== "";
|
|
22
|
+
return category.icon !== undefined;
|
|
25
23
|
}
|
|
26
24
|
exports.isBasicWithIcon = isBasicWithIcon;
|
|
27
|
-
/**
|
|
28
|
-
* Checks if the category carries an image URL.
|
|
29
|
-
* @group Utils
|
|
30
|
-
* @param category - The category to inspect.
|
|
31
|
-
* @returns `true` if the category exposes a non-empty `imageUrl`, narrowing it to {@link BasicWithImageUrl}.
|
|
32
|
-
*/
|
|
33
|
-
function isBasicWithImageUrl(category) {
|
|
34
|
-
const input = category;
|
|
35
|
-
return input.imageUrl != null && input.imageUrl !== "";
|
|
36
|
-
}
|
|
37
|
-
exports.isBasicWithImageUrl = isBasicWithImageUrl;
|
|
38
25
|
//# sourceMappingURL=categories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../../../src/domain/models/categories.ts"],"names":[],"mappings":";AAAA,cAAc;;;
|
|
1
|
+
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../../../src/domain/models/categories.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAyKd;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,QAAuB;IACrD,OAAQ,QAA0B,CAAC,IAAI,KAAK,SAAS,CAAA;AACvD,CAAC;AAFD,0CAEC;AAED;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,QAAuB;IACrD,OAAQ,QAA0B,CAAC,IAAI,KAAK,SAAS,CAAA;AACvD,CAAC;AAFD,0CAEC"}
|
|
@@ -48,88 +48,84 @@ class MarkerUtils {
|
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
|
50
50
|
static createMarkerElement(marker) {
|
|
51
|
+
var _a, _b, _c, _d;
|
|
51
52
|
const markerContainer = document.createElement("div");
|
|
53
|
+
// Configure specific marker dimensions
|
|
54
|
+
const iconWidth = (_b = (_a = marker.iconProperties) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 40;
|
|
55
|
+
const iconHeight = (_d = (_c = marker.iconProperties) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 40;
|
|
56
|
+
// Apply base class
|
|
52
57
|
markerContainer.className = "mapvx-marker";
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// Reset the state classes we own (no-op on a fresh element).
|
|
72
|
-
container.classList.remove("no-text", "interactive");
|
|
73
|
-
// The container box equals the icon box so the out-of-flow label never
|
|
74
|
-
// displaces the icon from the coordinate MapLibre anchors. A caller-
|
|
75
|
-
// provided `element` owns its own size, so we let the box size to it.
|
|
76
|
-
if (marker.element) {
|
|
77
|
-
container.style.width = "";
|
|
78
|
-
container.style.height = "";
|
|
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
|
+
}
|
|
79
76
|
}
|
|
80
77
|
else {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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`;
|
|
85
82
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
// flips the out-of-flow label's pointer-events to auto (see styles.css)
|
|
91
|
-
// so the label is hit-testable, while non-clickable labels stay
|
|
92
|
-
// click-through and never block the map.
|
|
93
|
-
if (marker.onClick) {
|
|
94
|
-
container.classList.add("interactive");
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Builds the in-order children for a marker container: the icon (or the
|
|
99
|
-
* caller-provided element) followed by the optional out-of-flow label. DOM
|
|
100
|
-
* order is irrelevant for placement — the .text-container position classes
|
|
101
|
-
* (top/bottom/left/right) lay the label out around the icon.
|
|
102
|
-
*
|
|
103
|
-
* @param marker - Marker configuration
|
|
104
|
-
* @returns The child elements to append to the container
|
|
105
|
-
*/
|
|
106
|
-
static createMarkerChildren(marker) {
|
|
107
|
-
var _a, _b, _c, _d;
|
|
108
|
-
const children = [];
|
|
83
|
+
markerContainer.addEventListener("click", () => {
|
|
84
|
+
var _a;
|
|
85
|
+
(_a = marker.onClick) === null || _a === void 0 ? void 0 : _a.call(marker);
|
|
86
|
+
});
|
|
109
87
|
if (marker.element) {
|
|
110
|
-
|
|
88
|
+
markerContainer.appendChild(marker.element);
|
|
89
|
+
return this.setAndCreateText(marker, markerContainer, `${iconHeight}px`, `${iconWidth}px`);
|
|
111
90
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
91
|
+
// Create elements in correct order according to textPosition
|
|
92
|
+
const iconElement = this.createIconElement(marker, iconWidth, iconHeight);
|
|
93
|
+
const textElement = marker.text
|
|
94
|
+
? this.createTextContainer(typeof marker.text === "string"
|
|
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);
|
|
116
103
|
}
|
|
117
|
-
|
|
118
|
-
|
|
104
|
+
else {
|
|
105
|
+
markerContainer.appendChild(iconElement);
|
|
106
|
+
if (textElement)
|
|
107
|
+
markerContainer.appendChild(textElement);
|
|
119
108
|
}
|
|
120
|
-
return
|
|
109
|
+
return markerContainer;
|
|
121
110
|
}
|
|
122
111
|
/**
|
|
123
|
-
*
|
|
112
|
+
* Sets up text positioning and styling for the marker.
|
|
124
113
|
*
|
|
125
|
-
* @param
|
|
126
|
-
* @
|
|
114
|
+
* @param markerConfig - Configuration object containing text properties
|
|
115
|
+
* @param container - Container element where text will be added
|
|
116
|
+
* @param iconHeight - Height of the icon for positioning calculations
|
|
117
|
+
* @param iconWidth - Width of the icon for positioning calculations
|
|
118
|
+
* @returns Container element with properly positioned text
|
|
127
119
|
*/
|
|
128
|
-
static
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
120
|
+
static setAndCreateText(markerConfig, container, iconHeight, iconWidth) {
|
|
121
|
+
if (markerConfig.text) {
|
|
122
|
+
const textElement = typeof markerConfig.text === "string"
|
|
123
|
+
? this.createTextElement(markerConfig.text, markerConfig.textProperties)
|
|
124
|
+
: markerConfig.text;
|
|
125
|
+
const textContainer = this.createTextContainer(textElement, markerConfig.textPosition);
|
|
126
|
+
container.appendChild(textContainer);
|
|
127
|
+
}
|
|
128
|
+
return container;
|
|
133
129
|
}
|
|
134
130
|
/**
|
|
135
131
|
* Creates an icon element with proper styling.
|
|
@@ -162,8 +158,7 @@ class MarkerUtils {
|
|
|
162
158
|
}
|
|
163
159
|
/**
|
|
164
160
|
* Creates a text container with proper positioning using CSS classes.
|
|
165
|
-
*
|
|
166
|
-
* never grows the marker's anchored box.
|
|
161
|
+
* Uses natural block/flex layout without absolute positioning.
|
|
167
162
|
*
|
|
168
163
|
* @param textElement - The text element to contain
|
|
169
164
|
* @param textPosition - Desired position relative to the icon
|
|
@@ -285,10 +280,6 @@ class MarkerAttribute extends maplibre_gl_1.Marker {
|
|
|
285
280
|
anchor: (_a = markerConfig.anchor) !== null && _a !== void 0 ? _a : "center",
|
|
286
281
|
offset: [0, 0],
|
|
287
282
|
});
|
|
288
|
-
// Route clicks through an instance-level handler so the latest onClick is
|
|
289
|
-
// always invoked, even after updateIcon replaces the marker content.
|
|
290
|
-
this._userOnClick = markerConfig.onClick;
|
|
291
|
-
this._element.addEventListener("click", () => { var _a; return (_a = this._userOnClick) === null || _a === void 0 ? void 0 : _a.call(this); });
|
|
292
283
|
this.setLngLat([markerConfig.coordinate.lng, markerConfig.coordinate.lat]);
|
|
293
284
|
this.setRotationAlignment((_b = markerConfig.rotationAlignment) !== null && _b !== void 0 ? _b : "viewport");
|
|
294
285
|
this.setPitchAlignment("viewport");
|
|
@@ -329,17 +320,20 @@ class MarkerAttribute extends maplibre_gl_1.Marker {
|
|
|
329
320
|
* ```
|
|
330
321
|
*/
|
|
331
322
|
updateIcon(marker) {
|
|
332
|
-
var _a;
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
323
|
+
var _a, _b;
|
|
324
|
+
if (marker.element) {
|
|
325
|
+
this._element.innerHTML = "";
|
|
326
|
+
this._element.appendChild(marker.element);
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
const markerElement = MarkerUtils.createMarkerElement(marker);
|
|
330
|
+
const oldMarkerContent = this._element.querySelector("div");
|
|
331
|
+
const newMarkerContent = markerElement.querySelector("div");
|
|
332
|
+
if (newMarkerContent) {
|
|
333
|
+
(_a = oldMarkerContent === null || oldMarkerContent === void 0 ? void 0 : oldMarkerContent.parentElement) === null || _a === void 0 ? void 0 : _a.replaceChild(newMarkerContent, oldMarkerContent);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
this.setRotationAlignment((_b = marker.rotationAlignment) !== null && _b !== void 0 ? _b : "viewport");
|
|
343
337
|
this.setPitchAlignment("viewport");
|
|
344
338
|
if (typeof marker.rotation === "number") {
|
|
345
339
|
this.setRotation(marker.rotation);
|
|
@@ -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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IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAA;QAClC,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE;YACvC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;SAClC;IACH,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;YAC3D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SACf;aAAM;YACL,IAAI,CAAC,IAAI,EAAE,CAAA;SACZ;IACH,CAAC;CACF;AApKD,0CAoKC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadStyles = exports.
|
|
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.isBasicWithIcon = exports.Banner = exports.createRouteAnimationIconDataUrl = exports.initializeSDK = exports.CountlyLogger = exports.FetchHttpClient = exports.DEFAULT_MAX_STORAGE_BYTES = exports.DEFAULT_CACHE_CONFIGS = exports.CacheManager = exports.PersistentCache = exports.LRUCache = void 0;
|
|
4
4
|
// ─── Infrastructure: Cache ───────────────────────────────────────────────────
|
|
5
|
-
var cacheConfig_1 = require("./infrastructure/cache/cacheConfig");
|
|
6
|
-
Object.defineProperty(exports, "DEFAULT_CACHE_CONFIGS", { enumerable: true, get: function () { return cacheConfig_1.DEFAULT_CACHE_CONFIGS; } });
|
|
7
|
-
Object.defineProperty(exports, "DEFAULT_MAX_STORAGE_BYTES", { enumerable: true, get: function () { return cacheConfig_1.DEFAULT_MAX_STORAGE_BYTES; } });
|
|
8
|
-
var CacheManager_1 = require("./infrastructure/cache/CacheManager");
|
|
9
|
-
Object.defineProperty(exports, "CacheManager", { enumerable: true, get: function () { return CacheManager_1.CacheManager; } });
|
|
10
5
|
var LRUCache_1 = require("./infrastructure/cache/LRUCache");
|
|
11
6
|
Object.defineProperty(exports, "LRUCache", { enumerable: true, get: function () { return LRUCache_1.LRUCache; } });
|
|
12
7
|
var PersistentCache_1 = require("./infrastructure/cache/PersistentCache");
|
|
13
8
|
Object.defineProperty(exports, "PersistentCache", { enumerable: true, get: function () { return PersistentCache_1.PersistentCache; } });
|
|
9
|
+
var CacheManager_1 = require("./infrastructure/cache/CacheManager");
|
|
10
|
+
Object.defineProperty(exports, "CacheManager", { enumerable: true, get: function () { return CacheManager_1.CacheManager; } });
|
|
11
|
+
var cacheConfig_1 = require("./infrastructure/cache/cacheConfig");
|
|
12
|
+
Object.defineProperty(exports, "DEFAULT_CACHE_CONFIGS", { enumerable: true, get: function () { return cacheConfig_1.DEFAULT_CACHE_CONFIGS; } });
|
|
13
|
+
Object.defineProperty(exports, "DEFAULT_MAX_STORAGE_BYTES", { enumerable: true, get: function () { return cacheConfig_1.DEFAULT_MAX_STORAGE_BYTES; } });
|
|
14
14
|
// ─── Infrastructure: HTTP ────────────────────────────────────────────────────
|
|
15
15
|
var FetchHttpClient_1 = require("./infrastructure/http/FetchHttpClient");
|
|
16
16
|
Object.defineProperty(exports, "FetchHttpClient", { enumerable: true, get: function () { return FetchHttpClient_1.FetchHttpClient; } });
|
|
@@ -29,14 +29,13 @@ Object.defineProperty(exports, "Banner", { enumerable: true, get: function () {
|
|
|
29
29
|
// ─── Domain Models: Categories ───────────────────────────────────────────────
|
|
30
30
|
var categories_1 = require("./domain/models/categories");
|
|
31
31
|
Object.defineProperty(exports, "isBasicWithIcon", { enumerable: true, get: function () { return categories_1.isBasicWithIcon; } });
|
|
32
|
-
Object.defineProperty(exports, "isBasicWithImageUrl", { enumerable: true, get: function () { return categories_1.isBasicWithImageUrl; } });
|
|
33
32
|
Object.defineProperty(exports, "isBasicWithLogo", { enumerable: true, get: function () { return categories_1.isBasicWithLogo; } });
|
|
34
33
|
// ─── Domain Models: Circle ───────────────────────────────────────────────────
|
|
35
34
|
var circle_1 = require("./domain/models/circle");
|
|
36
|
-
Object.defineProperty(exports, "CIRCLE_DEFAULTS", { enumerable: true, get: function () { return circle_1.CIRCLE_DEFAULTS; } });
|
|
37
35
|
Object.defineProperty(exports, "circleRing", { enumerable: true, get: function () { return circle_1.circleRing; } });
|
|
38
|
-
Object.defineProperty(exports, "
|
|
36
|
+
Object.defineProperty(exports, "CIRCLE_DEFAULTS", { enumerable: true, get: function () { return circle_1.CIRCLE_DEFAULTS; } });
|
|
39
37
|
Object.defineProperty(exports, "MAPVX_BRAND_COLOR", { enumerable: true, get: function () { return circle_1.MAPVX_BRAND_COLOR; } });
|
|
38
|
+
Object.defineProperty(exports, "isValidCircleConfig", { enumerable: true, get: function () { return circle_1.isValidCircleConfig; } });
|
|
40
39
|
// ─── Domain Models: Institution ──────────────────────────────────────────────
|
|
41
40
|
var institution_1 = require("./domain/models/institution");
|
|
42
41
|
Object.defineProperty(exports, "Institution", { enumerable: true, get: function () { return institution_1.Institution; } });
|
|
@@ -64,15 +63,15 @@ Object.defineProperty(exports, "UnitSystem", { enumerable: true, get: function (
|
|
|
64
63
|
var transport_1 = require("./domain/models/transport");
|
|
65
64
|
Object.defineProperty(exports, "MVXTransport", { enumerable: true, get: function () { return transport_1.MVXTransport; } });
|
|
66
65
|
// ─── Utils ───────────────────────────────────────────────────────────────────
|
|
67
|
-
var
|
|
68
|
-
Object.defineProperty(exports, "
|
|
66
|
+
var update_css_1 = require("./utils/update-css");
|
|
67
|
+
Object.defineProperty(exports, "loadCustomization", { enumerable: true, get: function () { return update_css_1.loadCustomization; } });
|
|
69
68
|
var opening_hours_helper_1 = require("./utils/opening-hours-helper");
|
|
70
69
|
Object.defineProperty(exports, "OpeningHoursHelper", { enumerable: true, get: function () { return opening_hours_helper_1.OpeningHoursHelper; } });
|
|
70
|
+
var mapvxHostname_1 = require("./utils/mapvxHostname");
|
|
71
|
+
Object.defineProperty(exports, "isMapVxRequestHostname", { enumerable: true, get: function () { return mapvxHostname_1.isMapVxRequestHostname; } });
|
|
71
72
|
var preconnect_1 = require("./utils/preconnect");
|
|
72
73
|
Object.defineProperty(exports, "injectPreconnects", { enumerable: true, get: function () { return preconnect_1.injectPreconnects; } });
|
|
73
74
|
Object.defineProperty(exports, "MAPVX_DEFAULT_PRECONNECT_HOSTS", { enumerable: true, get: function () { return preconnect_1.MAPVX_DEFAULT_PRECONNECT_HOSTS; } });
|
|
74
|
-
var update_css_1 = require("./utils/update-css");
|
|
75
|
-
Object.defineProperty(exports, "loadCustomization", { enumerable: true, get: function () { return update_css_1.loadCustomization; } });
|
|
76
75
|
/**
|
|
77
76
|
* Function to load default styles
|
|
78
77
|
* @group Utils
|
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,
|
|
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,wEAAsE;AAA7D,8GAAA,aAAa,OAAA;AAKtB,gFAAgF;AAChF,6BAAqC;AAA5B,oGAAA,aAAa,OAAA;AAatB,gFAAgF;AAChF,wCAAgE;AAAvD,wHAAA,+BAA+B,OAAA;AAGxC,gFAAgF;AAChF,iDAA+C;AAAtC,gGAAA,MAAM,OAAA;AAEf,gFAAgF;AAChF,yDAA6E;AAApE,6GAAA,eAAe,OAAA;AAAE,6GAAA,eAAe,OAAA;AAezC,gFAAgF;AAChF,iDAK+B;AAJ7B,oGAAA,UAAU,OAAA;AACV,yGAAA,eAAe,OAAA;AACf,2GAAA,iBAAiB,OAAA;AACjB,6GAAA,mBAAmB,OAAA;AAqCrB,gFAAgF;AAChF,2DAAyD;AAAhD,0GAAA,WAAW,OAAA;AASpB,gFAAgF;AAChF,uDAGkC;AAFhC,sHAAA,yBAAyB,OAAA;AACzB,6HAAA,gCAAgC,OAAA;AAIlC,gFAAgF;AAChF,iDAAqD;AAA5C,sGAAA,YAAY,OAAA;AASrB,gFAAgF;AAChF,+CAAgD;AAAvC,iGAAA,QAAQ,OAAA;AAKjB,gFAAgF;AAChF,+CAA2E;AAAlE,iGAAA,QAAQ,OAAA;AAAE,oGAAA,WAAW,OAAA;AAAE,qGAAA,YAAY,OAAA;AAE5C,gFAAgF;AAChF,yEAAmG;AAA1F,oHAAA,cAAc,OAAA;AAAE,wHAAA,kBAAkB,OAAA;AAAE,gHAAA,UAAU,OAAA;AAWvD,gFAAgF;AAChF,uDAAwD;AAA/C,yGAAA,YAAY,OAAA;AAQrB,gFAAgF;AAChF,iDAAsD;AAA7C,+GAAA,iBAAiB,OAAA;AAC1B,qEAAiE;AAAxD,0HAAA,kBAAkB,OAAA;AAC3B,uDAA8D;AAArD,uHAAA,sBAAsB,OAAA;AAC/B,iDAAsF;AAA7E,+GAAA,iBAAiB,OAAA;AAAE,4HAAA,8BAA8B,OAAA;AAE1D;;;GAGG;AACI,MAAM,UAAU,GAAG,GAAS,EAAE;IACnC,qCAAqC;IACrC,IAAI,QAAQ,CAAC,aAAa,CAAC,yBAAyB,CAAC,EAAE;QACrD,OAAM;KACP;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;IAC3C,IAAI,CAAC,GAAG,GAAG,YAAY,CAAA;IACvB,IAAI,CAAC,IAAI,GAAG,cAAc,CAAA,CAAC,wBAAwB;IACnD,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAA;IAC9C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC,CAAA;AAXY,QAAA,UAAU,cAWtB"}
|
|
@@ -15,7 +15,7 @@ const rollbar_2 = require("./rollbar");
|
|
|
15
15
|
// by scripts/inject-build-defines.js. The Countly key falls back to the
|
|
16
16
|
// MapVX key when none is injected at build time.
|
|
17
17
|
const IS_DEBUG = typeof DEBUG !== "undefined" ? DEBUG : false;
|
|
18
|
-
const SDK_VERSION = typeof VERSION !== "undefined" ? VERSION : "1.2.
|
|
18
|
+
const SDK_VERSION = typeof VERSION !== "undefined" ? VERSION : "1.2.4-dev.2";
|
|
19
19
|
const COUNTLY_API_KEY = typeof COUNTLY_KEY !== "undefined" && COUNTLY_KEY
|
|
20
20
|
? COUNTLY_KEY
|
|
21
21
|
: "f0c8d3b96d336e857a8628f49dd1baf7d7add0e9";
|
|
@@ -7,7 +7,7 @@ exports.argsToDict = exports._rollbarConfig = void 0;
|
|
|
7
7
|
// version placeholder is replaced with the package version by
|
|
8
8
|
// scripts/inject-build-defines.js. The access token falls back to the MapVX
|
|
9
9
|
// SDK-web Rollbar project token when none is injected at build time.
|
|
10
|
-
const SDK_VERSION = typeof VERSION !== "undefined" ? VERSION : "1.2.
|
|
10
|
+
const SDK_VERSION = typeof VERSION !== "undefined" ? VERSION : "1.2.4-dev.2";
|
|
11
11
|
const ACCESS_TOKEN = typeof ROLLBAR_ACCESS_TOKEN !== "undefined" && ROLLBAR_ACCESS_TOKEN
|
|
12
12
|
? ROLLBAR_ACCESS_TOKEN
|
|
13
13
|
: "28279d52df43411ebd138c2bee0ab1df";
|
package/dist/cjs/map/map.js
CHANGED
|
@@ -1285,7 +1285,7 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
1285
1285
|
throw new Error("Error: Failed to add route");
|
|
1286
1286
|
}
|
|
1287
1287
|
}
|
|
1288
|
-
updateRouteProgress(routeId, position, behindStyle = { type: "Solid", color: "#
|
|
1288
|
+
updateRouteProgress(routeId, position, behindStyle = { type: "Solid", color: "#757575" }) {
|
|
1289
1289
|
try {
|
|
1290
1290
|
const behindConfig = new routeConfiguration_1.InternalDrawRouteConfiguration({
|
|
1291
1291
|
routeStyle: behindStyle,
|