@mappedin/mappedin-js 6.0.1-beta.9 → 6.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 (54) hide show
  1. package/README.md +103 -7
  2. package/THIRD_PARTY_LICENSES.txt +8938 -21631
  3. package/lib/esm/GLTFExporter-AEIYURV6.js +2 -0
  4. package/lib/esm/GLTFExporter-AEIYURV6.js.map +7 -0
  5. package/lib/esm/GLTFLoader-YNJUYSBY.js +2 -0
  6. package/lib/esm/GLTFLoader-YNJUYSBY.js.map +7 -0
  7. package/lib/esm/chunk-C5ID5LHV.js +938 -0
  8. package/lib/esm/chunk-C5ID5LHV.js.map +7 -0
  9. package/lib/esm/chunk-DBCMQGTD.js +3820 -0
  10. package/lib/esm/chunk-DBCMQGTD.js.map +7 -0
  11. package/lib/esm/chunk-KYQ66GHT.js +2048 -0
  12. package/lib/esm/chunk-KYQ66GHT.js.map +7 -0
  13. package/lib/esm/chunk-RIFXMIJM.js +2 -0
  14. package/lib/esm/chunk-RIFXMIJM.js.map +7 -0
  15. package/lib/esm/chunk-ROCNZJLL.js +2 -0
  16. package/lib/esm/chunk-ROCNZJLL.js.map +7 -0
  17. package/lib/esm/fonts/roboto-regular.ttf +0 -0
  18. package/lib/esm/index.css +2 -1
  19. package/lib/esm/index.css.map +7 -0
  20. package/lib/esm/index.d.ts +27257 -25380
  21. package/lib/esm/index.js +2 -1
  22. package/lib/esm/index.js.map +7 -0
  23. package/lib/esm/inspector-2XETNHYZ.css +2 -0
  24. package/lib/esm/inspector-2XETNHYZ.css.map +7 -0
  25. package/lib/esm/inspector-J5CSSXEZ.js +483 -0
  26. package/lib/esm/inspector-J5CSSXEZ.js.map +7 -0
  27. package/lib/esm/internal-HTTM4ECA.js +2 -0
  28. package/lib/esm/internal-HTTM4ECA.js.map +7 -0
  29. package/lib/esm/internal-R5XTRV7Q.css +2 -0
  30. package/lib/esm/internal-R5XTRV7Q.css.map +7 -0
  31. package/lib/esm/roboto-regular-R5KXKW73.js +2 -0
  32. package/lib/esm/roboto-regular-R5KXKW73.js.map +7 -0
  33. package/lib/esm/text3d-AXM5ZHCS.css +2 -0
  34. package/lib/esm/text3d-AXM5ZHCS.css.map +7 -0
  35. package/lib/esm/text3d-FUGEPZHU.js +253 -0
  36. package/lib/esm/text3d-FUGEPZHU.js.map +7 -0
  37. package/lib/esm/workers/collision-worker.csp.js +23 -0
  38. package/lib/esm/workers/maplibre-worker.csp.js +2 -0
  39. package/lib/index-rn.js +4306 -0
  40. package/lib/index.css +2 -1
  41. package/package.json +24 -21
  42. package/lib/esm/GLTFExporter-DDZP3YM5.js +0 -1
  43. package/lib/esm/GLTFLoader-54EWX6DJ.js +0 -1
  44. package/lib/esm/browser-UXFEBJ7R.js +0 -1
  45. package/lib/esm/chunk-A35HKGOE.js +0 -1
  46. package/lib/esm/chunk-FE5S74VA.js +0 -1
  47. package/lib/esm/chunk-NTOUDKDJ.js +0 -1
  48. package/lib/esm/chunk-RZFBTKMI.js +0 -1
  49. package/lib/esm/chunk-SHB4JBRW.js +0 -1
  50. package/lib/esm/chunk-WVWEOR6I.js +0 -1
  51. package/lib/esm/inspector-HCNPJZJK.js +0 -1
  52. package/lib/esm/inspector-OZDC5DPH.css +0 -1
  53. package/lib/esm/internal-4B7MJ7JY.js +0 -1
  54. package/lib/esm/outdoor-context-v4-M3BL3WQZ.js +0 -1
package/README.md CHANGED
@@ -1,12 +1,13 @@
1
- # Mappedin Web SDK
1
+ # Mappedin JS
2
2
 
3
3
  ## Resources
4
4
 
5
5
  - [Mappedin Developer Portal](https://developer.mappedin.com)
6
- - [Releases and Roadmap](https://developer.mappedin.com/releases/)
7
- - [Getting Started Guide](https://developer.mappedin.com/web/v6/guides/getting-started/)
8
- - [API Reference](https://developer.mappedin.com/web/v6/api-reference/)
9
- - [Trial Keys](https://developer.mappedin.com/web/v6/trial-keys-and-maps/)
6
+ - [Releases and Roadmap](https://developer.mappedin.com/docs/roadmap)
7
+ - [Getting Started Guide](https://developer.mappedin.com/web-sdk/getting-started)
8
+ - [Migration Guide](https://developer.mappedin.com/web-sdk/migration-guide)
9
+ - [API Reference](https://developer.mappedin.com/web-sdk/api-reference)
10
+ - [Demo Keys & Maps](https://developer.mappedin.com/docs/demo-keys-and-maps)
10
11
  - [License](https://info.mappedin.com/terms/sdk)
11
12
 
12
13
  ## Usage
@@ -32,7 +33,7 @@ async function init() {
32
33
  });
33
34
  const mapContainer = document.getElementById('app');
34
35
  const map = await show3dMap(mapContainer, mapData);
35
- map.Labels.all();
36
+ map.Labels.__EXPERIMENTAL__all();
36
37
  map.on('click', event => {
37
38
  const { coordinate } = event;
38
39
  const { latitude, longitude } = coordinate;
@@ -42,4 +43,99 @@ async function init() {
42
43
  init();
43
44
  ```
44
45
 
45
- For full documentation, read our [Getting Started guide on the Developer Portal](https://developer.mappedin.com/web/v6/guides/getting-started/).
46
+ For full documentation, read our [Getting Started guide on the Developer Portal](https://developer.mappedin.com/web-sdk/getting-started).
47
+
48
+ ### Content Security Policy (CSP) Support
49
+
50
+ The SDK provides solutions for applications that use a strict Content Security Policy.
51
+
52
+ #### Minimum Required CSP Rules
53
+
54
+ The following CSP directives are the minimum requirements to run the SDK:
55
+
56
+ | Purpose | CSP Directive | Required Value | Notes |
57
+ | ---------------------- | ------------- | ---------------------- | -------------------------------------------------------------------- |
58
+ | **Images & Textures** | `img-src` | `*.mappedin.com data:` | Required for loading map textures and images |
59
+ | **API & Font Loading** | `connect-src` | `*.mappedin.com data:` | `*.mappedin.com` for map data; `data:` only needed for default fonts |
60
+ | **Web Workers** | `worker-src` | `'self' blob:` | Enables collision detection and MapLibre workers |
61
+
62
+ **Example minimum CSP header:**
63
+
64
+ ```
65
+ Content-Security-Policy: img-src *.mappedin.com data:; connect-src *.mappedin.com data:; worker-src 'self' blob:;
66
+ ```
67
+
68
+ **Alternative for strict CSP environments:**
69
+ If your CSP does not allow `blob:`, you can set up a transparent proxy on your server that forwards requests from `https://YOUR.DOMAIN/mappedin-web-redirector/*` to `https://cdn.mappedin.com/web2/release/*`. This removes the need for additional CSP rules while maintaining functionality.
70
+
71
+ #### Web Worker CSP Solution
72
+
73
+ If your CSP blocks `blob:` URLs or `unsafe-eval` directives (affecting web workers), you can host worker scripts externally:
74
+
75
+ ```javascript
76
+ import { setWorkerUrl } from '@mappedin/mappedin-js';
77
+
78
+ // Call this before initializing any maps
79
+ setWorkerUrl('/path/to/workers');
80
+ ```
81
+
82
+ This function configures both the MapLibre and collision detection workers to load from external URLs. To set this up:
83
+
84
+ 1. Copy the worker files from `node_modules/@mappedin/mappedin-js/lib/esm/workers/` to your web server
85
+ 2. Call `setWorkerUrl` with the base URL path to these files
86
+ 3. Ensure your CSP allows scripts from this location
87
+
88
+ Example in a build script:
89
+
90
+ ```bash
91
+ # Copy worker files to your public directory
92
+ cp -r node_modules/@mappedin/mappedin-js/lib/esm/workers ./public/mappedin-workers
93
+ ```
94
+
95
+ ```javascript
96
+ // In your JavaScript
97
+ setWorkerUrl('/mappedin-workers');
98
+ ```
99
+
100
+ #### CSS Injection CSP Solution
101
+
102
+ If your CSP blocks inline styles (`style-src 'unsafe-inline'`), use external CSS loading instead:
103
+
104
+ 1. Load the SDK's CSS with a `<link>` tag in your HTML
105
+ 2. Disable automatic style injection in `show3dMap` options
106
+
107
+ ```html
108
+ <!-- In your HTML file -->
109
+ <link rel="stylesheet" href="/path/to/mappedin-js/index.css" />
110
+ ```
111
+
112
+ ```javascript
113
+ // In your JavaScript
114
+ const mapView = await show3dMap(element, venue, {
115
+ injectStyles: false, // Disable automatic style injection
116
+ });
117
+ ```
118
+
119
+ For your build process:
120
+
121
+ ```bash
122
+ # Copy CSS file to your public directory
123
+ cp node_modules/@mappedin/mappedin-js/lib/index.css ./public/
124
+ ```
125
+
126
+ #### Text3D Worker CSP Solution (Optional)
127
+
128
+ If you use Text3D features (like `labelAll()`) in a CSP-restricted environment, you'll need to disable the Text3D worker if you don't want see error message:
129
+
130
+ ```javascript
131
+ import { disableText3DWorker } from '@mappedin/mappedin-js';
132
+ // After initializing your map
133
+ disableText3DWorker();
134
+
135
+ // Now you can use Text3D features without errors or warnings
136
+ mapView.Text3D.labelAll();
137
+ ```
138
+
139
+ This disables the worker and processes text on the main thread instead, allowing Text3D to work in CSP environments that block worker creation.
140
+
141
+ You can apply any combination of these solutions based on your specific CSP restrictions and SDK feature usage.