@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.
Files changed (42) hide show
  1. package/LICENSE.md +2 -2
  2. package/README.md +9 -10
  3. package/dist/cjs/assets/icons.js +8 -6
  4. package/dist/cjs/assets/icons.js.map +1 -1
  5. package/dist/cjs/assets/route_animation_icon.svg +15 -0
  6. package/dist/cjs/assets/user-dot-icon.svg +3 -0
  7. package/dist/cjs/domain/models/animation.js +2 -2
  8. package/dist/cjs/logger/logger.js +1 -1
  9. package/dist/cjs/logger/rollbar.js +1 -1
  10. package/dist/cjs/map/map.js +490 -5
  11. package/dist/cjs/map/map.js.map +1 -1
  12. package/dist/cjs/sdk.js +1 -0
  13. package/dist/cjs/sdk.js.map +1 -1
  14. package/dist/cjs/utils/3d.js +12 -0
  15. package/dist/cjs/utils/3d.js.map +1 -0
  16. package/dist/es/assets/icons.d.ts +4 -4
  17. package/dist/es/assets/icons.d.ts.map +1 -1
  18. package/dist/es/assets/icons.js +8 -6
  19. package/dist/es/assets/icons.js.map +1 -1
  20. package/dist/es/assets/route_animation_icon.svg +15 -0
  21. package/dist/es/assets/user-dot-icon.svg +3 -0
  22. package/dist/es/domain/models/animation.d.ts +3 -3
  23. package/dist/es/domain/models/animation.js +2 -2
  24. package/dist/es/domain/models/mapConfig.d.ts +11 -0
  25. package/dist/es/domain/models/mapConfig.d.ts.map +1 -1
  26. package/dist/es/interfaces/routeCacheResponse.d.ts.map +1 -1
  27. package/dist/es/logger/logger.js +1 -1
  28. package/dist/es/logger/rollbar.js +1 -1
  29. package/dist/es/map/map.d.ts +27 -1
  30. package/dist/es/map/map.d.ts.map +1 -1
  31. package/dist/es/map/map.js +491 -6
  32. package/dist/es/map/map.js.map +1 -1
  33. package/dist/es/sdk.d.ts.map +1 -1
  34. package/dist/es/sdk.js +1 -0
  35. package/dist/es/sdk.js.map +1 -1
  36. package/dist/es/utils/3d.d.ts +2 -0
  37. package/dist/es/utils/3d.d.ts.map +1 -0
  38. package/dist/es/utils/3d.js +8 -0
  39. package/dist/es/utils/3d.js.map +1 -0
  40. package/dist/umd/index.js +153836 -1958
  41. package/dist/umd/index.js.map +1 -1
  42. 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 the
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 | 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 |
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 [MapVX](https://mapvx.com).
269
+ For support, please contact your MapVX representative or visit
270
+ [MapVX](https://mapvx.com).
@@ -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: "#276EF1").
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 : "#276EF1";
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 30 30" style="enable-background:new 0 0 30 30;" xml:space="preserve">
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="15" cy="15" r="15" style="${circleStyle}${circleStroke}"/>
65
- <path style="${arrowStyle}${arrowStroke}" d="M16.4471 7.26386C16.2568 6.80696 15.808 6.51052 15.3131 6.51052C14.8181 6.51052 14.3693 6.80696 14.179 7.26386L8.52211 20.7533C8.29366 21.2972 8.48404 21.9227 8.97085 22.2518C9.45767 22.5809 10.1104 22.5156 10.5265 22.0995L15.3131 17.3129L20.0996 22.0995C20.5157 22.5156 21.1657 22.5782 21.6553 22.2518C22.1448 21.9254 22.3325 21.2972 22.104 20.7533L16.4471 7.26386Z"/>
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 (#276EF1) and white arrow (#FFFFFF).
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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B,CAAC,GAAG,CAAC,CAAA;IAC1C,OAAO,sBAAsB,UAAU,EAAE,CAAA;AAC3C,CAAC;AAvCD,0EAuCC;AAED;;;;;;;;;;GAUG;AACU,QAAA,qBAAqB,GAAG,+BAA+B,EAAE,CAAA"}
@@ -0,0 +1,15 @@
1
+ <?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>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" aria-hidden="false" role="img">
2
+ <circle cx="12" cy="12" r="6" fill="var(--icon-fill, #007aff)" stroke="var(--icon-stroke, #ffffff)" stroke-width="2"/>
3
+ </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: "#0C0C0C",
29
+ color: "#757575",
30
30
  };
31
31
  this.behindPathStyle = (_b = data.behindPathStyle) !== null && _b !== void 0 ? _b : {
32
32
  type: "Solid",
33
- color: "#276EF1",
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.2.3";
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.2.3";
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";