@panoramax/web-viewer 3.2.3-develop-17933507 → 3.2.3-develop-d0806c5a
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/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/viewer.html +12 -10
- package/docs/reference/components/core/Basic.md +1 -1
- package/docs/reference/components/core/CoverageMap.md +1 -1
- package/docs/reference/components/core/Editor.md +1 -1
- package/docs/reference/components/core/Viewer.md +1 -1
- package/docs/tutorials/map_style.md +1 -1
- package/package.json +1 -1
- package/public/viewer.html +12 -10
- package/src/components/core/Basic.js +1 -1
- package/src/components/core/Editor.js +1 -1
- package/src/components/core/Viewer.js +1 -1
- package/src/utils/InitParameters.js +1 -0
package/build/viewer.html
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><title>Panoramax Web Viewer</title><style>#viewer{position:relative;width:95%;margin:2.5%;height:400px}#viewer.fullpage{position:fixed;top:0;bottom:0;left:0;right:0;height:unset;width:unset;margin:0}</style><script defer="defer" src="index.js"></script><link href="index.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><pnx-viewer id="viewer" class="fullpage" map='{
|
|
2
|
-
"
|
|
3
|
-
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><title>Panoramax Web Viewer</title><style>#viewer{position:relative;width:95%;margin:2.5%;height:400px}#viewer.fullpage{position:fixed;top:0;bottom:0;left:0;right:0;height:unset;width:unset;margin:0}</style><script defer="defer" src="index.js"></script><link href="index.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><pnx-viewer id="viewer" class="fullpage" map='{
|
|
2
|
+
"raster": {
|
|
3
|
+
"type": "raster",
|
|
4
|
+
"tiles": [
|
|
5
|
+
"https://data.geopf.fr/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ORTHOIMAGERY.ORTHOPHOTOS&STYLE=normal&FORMAT=image/jpeg&TILEMATRIXSET=PM_0_21&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}"
|
|
6
|
+
],
|
|
7
|
+
"minzoom": 0,
|
|
8
|
+
"maxzoom": 21,
|
|
9
|
+
"attribution": "© IGN",
|
|
10
|
+
"tileSize": 256
|
|
11
|
+
}
|
|
12
|
+
}'/><script>var servers={meta:"https://api.panoramax.xyz/api",ign:"https://panoramax.ign.fr/api",osm:"https://panoramax.openstreetmap.fr/api",local:"http://localhost:5000/api",dev:"https://panoramax.codeureusesenliberte.fr/api"},urlParams=new URLSearchParams(window.location.search),server=servers[urlParams.get("server")||"meta"];window.onload=()=>{document.getElementById("viewer").setAttribute("endpoint",server)}</script></body></html>
|
|
@@ -46,7 +46,7 @@ Component properties.
|
|
|
46
46
|
| [sequence] | <code>string</code> | | The sequence ID of the picture displayed |
|
|
47
47
|
| [fetchOptions] | <code>object</code> | | Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters)) |
|
|
48
48
|
| [users] | <code>Array.<string></code> | <code>[geovisio]</code> | List of users IDs to use for map display (defaults to general map, identified as "geovisio") |
|
|
49
|
-
| [mapstyle] | <code>string</code> \| <code>object</code> | | The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-
|
|
49
|
+
| [mapstyle] | <code>string</code> \| <code>object</code> | | The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles. |
|
|
50
50
|
| [lang] | <code>string</code> | | To override language used for labels. Defaults to using user's preferred languages. |
|
|
51
51
|
| endpoint | <code>string</code> | | URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md)) |
|
|
52
52
|
|
|
@@ -53,7 +53,7 @@ Component properties.
|
|
|
53
53
|
| [sequence] | <code>string</code> | | The sequence ID of the picture displayed |
|
|
54
54
|
| [fetchOptions] | <code>object</code> | | Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters)) |
|
|
55
55
|
| [users] | <code>Array.<string></code> | <code>[geovisio]</code> | List of users IDs to use for map display (defaults to general map, identified as "geovisio") |
|
|
56
|
-
| [mapstyle] | <code>string</code> \| <code>object</code> | | The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-
|
|
56
|
+
| [mapstyle] | <code>string</code> \| <code>object</code> | | The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles. |
|
|
57
57
|
| [lang] | <code>string</code> | | To override language used for labels. Defaults to using user's preferred languages. |
|
|
58
58
|
| endpoint | <code>string</code> | | URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md)) |
|
|
59
59
|
|
|
@@ -58,7 +58,7 @@ Component properties. All of [Basic properties](Basic.md/#Panoramax.components.c
|
|
|
58
58
|
| [sequence] | <code>string</code> | | The sequence ID of the picture displayed |
|
|
59
59
|
| [fetchOptions] | <code>object</code> | | Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters)) |
|
|
60
60
|
| [users] | <code>Array.<string></code> | <code>[geovisio]</code> | List of users IDs to use for map display (defaults to general map, identified as "geovisio") |
|
|
61
|
-
| [mapstyle] | <code>string</code> \| <code>object</code> | | The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-
|
|
61
|
+
| [mapstyle] | <code>string</code> \| <code>object</code> | | The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles. |
|
|
62
62
|
| [lang] | <code>string</code> | | To override language used for labels. Defaults to using user's preferred languages. |
|
|
63
63
|
| endpoint | <code>string</code> | | URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md)) |
|
|
64
64
|
| [raster] | <code>object</code> | | The MapLibre raster source for aerial background. This must be a JSON object following [MapLibre raster source definition](https://maplibre.org/maplibre-style-spec/sources/#raster). |
|
|
@@ -102,7 +102,7 @@ Component properties. All of [Basic properties](Basic.md/#Panoramax.components.c
|
|
|
102
102
|
| [sequence] | <code>string</code> | | The sequence ID of the picture displayed |
|
|
103
103
|
| [fetchOptions] | <code>object</code> | | Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters)) |
|
|
104
104
|
| [users] | <code>Array.<string></code> | <code>[geovisio]</code> | List of users IDs to use for map display (defaults to general map, identified as "geovisio") |
|
|
105
|
-
| [mapstyle] | <code>string</code> \| <code>object</code> | | The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-
|
|
105
|
+
| [mapstyle] | <code>string</code> \| <code>object</code> | | The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles. |
|
|
106
106
|
| [lang] | <code>string</code> | | To override language used for labels. Defaults to using user's preferred languages. |
|
|
107
107
|
| endpoint | <code>string</code> | | URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md)) |
|
|
108
108
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change map background style
|
|
2
2
|
|
|
3
|
-
All components can be configured to use a different map background than the default one. By default, an OpenStreetMap France classic style if offered. Changing the style is done by passing a `mapstyle` parameter on viewer setup. It should follow the [MapLibre Style specification](https://maplibre.org/maplibre-style-spec) and be passed as an object, or an URL to such style:
|
|
3
|
+
All components can be configured to use a different map background than the default one. By default, an OpenStreetMap France classic style if offered. Changing the style is done by passing a `mapstyle` parameter on viewer setup. It should follow the [MapLibre Style specification](https://maplibre.org/maplibre-style-spec/) and be passed as an object, or an URL to such style:
|
|
4
4
|
|
|
5
5
|
```html
|
|
6
6
|
<pnx-viewer
|
package/package.json
CHANGED
package/public/viewer.html
CHANGED
|
@@ -31,16 +31,18 @@
|
|
|
31
31
|
<pnx-viewer
|
|
32
32
|
id="viewer"
|
|
33
33
|
class="fullpage"
|
|
34
|
-
map='{
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
map='{
|
|
35
|
+
"raster": {
|
|
36
|
+
"type": "raster",
|
|
37
|
+
"tiles": [
|
|
38
|
+
"https://data.geopf.fr/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ORTHOIMAGERY.ORTHOPHOTOS&STYLE=normal&FORMAT=image/jpeg&TILEMATRIXSET=PM_0_21&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}"
|
|
39
|
+
],
|
|
40
|
+
"minzoom": 0,
|
|
41
|
+
"maxzoom": 21,
|
|
42
|
+
"attribution": "© IGN",
|
|
43
|
+
"tileSize": 256
|
|
44
|
+
}
|
|
45
|
+
}'
|
|
44
46
|
/>
|
|
45
47
|
|
|
46
48
|
<script>
|
|
@@ -37,7 +37,7 @@ export default class Basic extends LitElement {
|
|
|
37
37
|
* @property {string} [sequence] The sequence ID of the picture displayed
|
|
38
38
|
* @property {object} [fetchOptions] Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters))
|
|
39
39
|
* @property {string[]} [users=[geovisio]] List of users IDs to use for map display (defaults to general map, identified as "geovisio")
|
|
40
|
-
* @property {string|object} [mapstyle] The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-
|
|
40
|
+
* @property {string|object} [mapstyle] The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles.
|
|
41
41
|
* @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.
|
|
42
42
|
* @property {string} endpoint URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md))
|
|
43
43
|
*/
|
|
@@ -44,7 +44,7 @@ export default class Editor extends Basic {
|
|
|
44
44
|
* @property {string} [sequence] The sequence ID of the picture displayed
|
|
45
45
|
* @property {object} [fetchOptions] Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters))
|
|
46
46
|
* @property {string[]} [users=[geovisio]] List of users IDs to use for map display (defaults to general map, identified as "geovisio")
|
|
47
|
-
* @property {string|object} [mapstyle] The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-
|
|
47
|
+
* @property {string|object} [mapstyle] The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles.
|
|
48
48
|
* @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.
|
|
49
49
|
* @property {string} endpoint URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md))
|
|
50
50
|
* @property {object} [raster] The MapLibre raster source for aerial background. This must be a JSON object following [MapLibre raster source definition](https://maplibre.org/maplibre-style-spec/sources/#raster).
|
|
@@ -87,7 +87,7 @@ export default class Viewer extends Basic {
|
|
|
87
87
|
* @property {string} [sequence] The sequence ID of the picture displayed
|
|
88
88
|
* @property {object} [fetchOptions] Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters))
|
|
89
89
|
* @property {string[]} [users=[geovisio]] List of users IDs to use for map display (defaults to general map, identified as "geovisio")
|
|
90
|
-
* @property {string|object} [mapstyle] The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-
|
|
90
|
+
* @property {string|object} [mapstyle] The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles.
|
|
91
91
|
* @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.
|
|
92
92
|
* @property {string} endpoint URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md))
|
|
93
93
|
*/
|
|
@@ -50,6 +50,7 @@ export default class InitParameters { // eslint-disable-line import/no-unused-mo
|
|
|
50
50
|
let map_zoom = urlMap?.zoom || browserMap?.zoom || componentMap.zoom;
|
|
51
51
|
let map_pitch = urlMap?.pitch || componentMap.pitch;
|
|
52
52
|
let map_bearing = urlMap?.bearing || componentMap.bearing;
|
|
53
|
+
console.log(componentMap);
|
|
53
54
|
|
|
54
55
|
// - Component only
|
|
55
56
|
let geocoder = componentAttrs.geocoder;
|