@mapvx/web-js 1.2.3 → 1.3.0-dev.1
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/LICENSE.md +2 -2
- package/README.md +9 -10
- 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/logger/logger.js +1 -1
- package/dist/cjs/logger/rollbar.js +1 -1
- package/dist/cjs/map/map.js +490 -5
- package/dist/cjs/map/map.js.map +1 -1
- package/dist/cjs/sdk.js +1 -0
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/cjs/utils/3d.js +12 -0
- package/dist/cjs/utils/3d.js.map +1 -0
- 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/mapConfig.d.ts +11 -0
- package/dist/es/domain/models/mapConfig.d.ts.map +1 -1
- package/dist/es/interfaces/routeCacheResponse.d.ts.map +1 -1
- package/dist/es/logger/logger.js +1 -1
- package/dist/es/logger/rollbar.js +1 -1
- package/dist/es/map/map.d.ts +27 -1
- package/dist/es/map/map.d.ts.map +1 -1
- package/dist/es/map/map.js +491 -6
- package/dist/es/map/map.js.map +1 -1
- package/dist/es/sdk.d.ts.map +1 -1
- package/dist/es/sdk.js +1 -0
- package/dist/es/sdk.js.map +1 -1
- package/dist/es/utils/3d.d.ts +2 -0
- package/dist/es/utils/3d.d.ts.map +1 -0
- package/dist/es/utils/3d.js +8 -0
- package/dist/es/utils/3d.js.map +1 -0
- package/dist/umd/index.js +153836 -1958
- package/dist/umd/index.js.map +1 -1
- package/package.json +62 -62
package/LICENSE.md
CHANGED
|
@@ -6,8 +6,8 @@ This software and associated documentation files (the "Software") are the propri
|
|
|
6
6
|
MapVX. Unauthorized copying, modification, distribution, or use of this Software, in whole or in
|
|
7
7
|
part, is strictly prohibited without prior written permission from MapVX.
|
|
8
8
|
|
|
9
|
-
The Software is provided under a commercial license. For licensing inquiries, please contact
|
|
10
|
-
MapVX team.
|
|
9
|
+
The Software is provided under a commercial license. For licensing inquiries, please contact
|
|
10
|
+
the MapVX team.
|
|
11
11
|
|
|
12
12
|
## Terms
|
|
13
13
|
|
package/README.md
CHANGED
|
@@ -30,16 +30,15 @@ Or include the stylesheet manually in your HTML:
|
|
|
30
30
|
|
|
31
31
|
The SDK ships in three formats:
|
|
32
32
|
|
|
33
|
-
| Format | Entry Point
|
|
34
|
-
| ------ |
|
|
35
|
-
| ESM
|
|
36
|
-
| CJS
|
|
37
|
-
| UMD
|
|
33
|
+
| Format | Entry Point | Use Case |
|
|
34
|
+
| ------ | ----------- | -------- |
|
|
35
|
+
| ESM | `dist/es/index.js` | Modern bundlers (Vite, webpack 5, Rollup) |
|
|
36
|
+
| CJS | `dist/cjs/index.js` | Node.js, legacy bundlers |
|
|
37
|
+
| UMD | `dist/umd/index.js` | `<script>` tags, CDNs |
|
|
38
38
|
|
|
39
39
|
Bundlers automatically pick the right format via the `exports` field in `package.json`.
|
|
40
40
|
|
|
41
|
-
For UMD/CDN usage, `dist/umd/index.js` already includes the MapLibre JavaScript runtime. You only
|
|
42
|
-
need to load the SDK stylesheet separately.
|
|
41
|
+
For UMD/CDN usage, `dist/umd/index.js` already includes the MapLibre JavaScript runtime. You only need to load the SDK stylesheet separately.
|
|
43
42
|
|
|
44
43
|
## Quick Start
|
|
45
44
|
|
|
@@ -237,8 +236,7 @@ map.clearTileCache()
|
|
|
237
236
|
|
|
238
237
|
## Documentation
|
|
239
238
|
|
|
240
|
-
For complete documentation and examples, visit the
|
|
241
|
-
[MapVX Web SDK Docs](https://mapvx.github.io/sdk-web/).
|
|
239
|
+
For complete documentation and examples, visit the [MapVX Web SDK Docs](https://mapvx.github.io/sdk-web/).
|
|
242
240
|
|
|
243
241
|
### API Reference
|
|
244
242
|
|
|
@@ -268,4 +266,5 @@ caching for offline tile access.
|
|
|
268
266
|
|
|
269
267
|
## Support
|
|
270
268
|
|
|
271
|
-
For support, please contact your MapVX representative or visit
|
|
269
|
+
For support, please contact your MapVX representative or visit
|
|
270
|
+
[MapVX](https://mapvx.com).
|
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,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xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- 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) {
|
|
@@ -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.
|
|
18
|
+
const SDK_VERSION = typeof VERSION !== "undefined" ? VERSION : "1.3.0-dev.1";
|
|
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.
|
|
10
|
+
const SDK_VERSION = typeof VERSION !== "undefined" ? VERSION : "1.3.0-dev.1";
|
|
11
11
|
const ACCESS_TOKEN = typeof ROLLBAR_ACCESS_TOKEN !== "undefined" && ROLLBAR_ACCESS_TOKEN
|
|
12
12
|
? ROLLBAR_ACCESS_TOKEN
|
|
13
13
|
: "28279d52df43411ebd138c2bee0ab1df";
|