@panoramax/web-viewer 3.2.3-develop-17933507 → 3.2.3-develop-eb68a0ea

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/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='{"raster": {
2
- "type": "raster",
3
- "tiles": [
4
- "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}"
5
- ],
6
- "minzoom": 0,
7
- "maxzoom": 21,
8
- "attribution": "&copy; IGN",
9
- "tileSize": 256
10
- }}'/><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>
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": "&copy; 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>
@@ -38,6 +38,22 @@ In order to offer a coherent overlay of widgets, we follow this general `z-index
38
38
  | Togglable menus | 130 |
39
39
  | Fullscreen loaders & popups | 200 |
40
40
 
41
+ ### Parameters handling
42
+
43
+ !!! note
44
+
45
+ This concerns only __Viewer__ component. Editor & Coverage Map read input parameters only from Web Components attributes.
46
+
47
+ Viewer component can read parameters from 3 different sources:
48
+
49
+ - Web Component __attributes__, passed through DOM
50
+ - Browser __local storage__
51
+ - __URL search__ parameters
52
+
53
+ This allows a flexible way to interact with viewer for users. Prioritization of parameters is managed by [InitParameters class](./reference/utils/InitParameters.md), URL parameters coming first, then local storage, to fallback with Web component attributes (and eventually some hard-coded defaults).
54
+
55
+ This means that, when developing, if you want to check if your attributes are well-defined, you may want to get rid of URL search parameters, as well as remove the `pnx-map-parameters` local storage item. Otherwise, they may not be read as they are lower priority than others.
56
+
41
57
  ## Testing
42
58
 
43
59
  We're trying to make Panoramax as reliable and secure as possible. To ensure this, we rely heavily on code testing. A variety of testing tools is made available:
@@ -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.&lt;string&gt;</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-gl-js-docs/style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles. |
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.&lt;string&gt;</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-gl-js-docs/style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles. |
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.&lt;string&gt;</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-gl-js-docs/style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles. |
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). |
@@ -79,6 +79,12 @@ This component has a [CorneredGrid](../layout/CorneredGrid.md/#Panoramax.compone
79
79
  >
80
80
  <p slot="top-right">My custom text</p>
81
81
  </pnx-viewer>
82
+
83
+ <!-- With map options -->
84
+ <pnx-viewer
85
+ endpoint="https://panoramax.openstreetmap.fr/"
86
+ map="{'maxZoom': 15, 'background': 'aerial', 'raster': '...'}"
87
+ />
82
88
  ```
83
89
  <a name="Panoramax.components.core.Viewer+properties"></a>
84
90
 
@@ -92,8 +98,8 @@ Component properties. All of [Basic properties](Basic.md/#Panoramax.components.c
92
98
 
93
99
  | Name | Type | Default | Description |
94
100
  | --- | --- | --- | --- |
95
- | [map] | <code>boolean</code> \| <code>object</code> | <code>true</code> | Should map be used (true/false), or an object with [any map option available in Map class](../ui/MapMore.md/#Panoramax.components.ui.MapMore) |
96
- | [psv] | <code>object</code> | | [Any option to pass to Photo component](../ui/Photo.md/#Panoramax.components.ui.Photo) as an object |
101
+ | [map] | <code>boolean</code> \| <code>object</code> | <code>true</code> | Should map be used (true/false), or an object with [any map option available in Map or MapMore class](../ui/MapMore.md/#Panoramax.components.ui.MapMore).<br />Example: `map="{'background': 'aerial', 'theme': 'age'}"` |
102
+ | [psv] | <code>object</code> | | [Any option to pass to Photo component](../ui/Photo.md/#Panoramax.components.ui.Photo) as an object.<br />Example: `psv="{'transitionDuration': 500, 'picturesNavigation': 'pic'}"` |
97
103
  | [url-parameters] | <code>string</code> | <code>true</code> | Should the component add and update URL query parameters to save viewer state ? |
98
104
  | [focus] | <code>string</code> | <code>&quot;pic&quot;</code> | The component showing up as main component (pic, map) |
99
105
  | [geocoder] | <code>string</code> | <code>&quot;nominatim&quot;</code> | The geocoder engine to use (nominatim, ban) |
@@ -102,7 +108,7 @@ Component properties. All of [Basic properties](Basic.md/#Panoramax.components.c
102
108
  | [sequence] | <code>string</code> | | The sequence ID of the picture displayed |
103
109
  | [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
110
  | [users] | <code>Array.&lt;string&gt;</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-gl-js-docs/style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles. |
111
+ | [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
112
  | [lang] | <code>string</code> | | To override language used for labels. Defaults to using user's preferred languages. |
107
113
  | 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
114
 
@@ -45,6 +45,7 @@ It uses instead [`on`](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/
45
45
  | [options] | <code>object</code> | | The map options (any of [MapLibre GL settings](https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/MapOptions/) or any supplementary option defined here) |
46
46
  | [options.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). |
47
47
  | [options.background] | <code>string</code> | <code>&quot;streets&quot;</code> | Choose default map background to display (streets or aerial, if raster aerial background available). Defaults to street. |
48
+ | [options.attributionControl.customAttribution] | <code>string</code> | | To override default map attribution. |
48
49
 
49
50
  **Example**
50
51
  ```js
@@ -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
@@ -25,3 +25,15 @@ Note that we also support PMTiles (for a simpler tile hosting), so your style fi
25
25
  }'
26
26
  />
27
27
  ```
28
+
29
+ And you can also customize the map attribution, especially if your style JSON doesn't contain any by default, for example:
30
+
31
+ ```html
32
+ <pnx-viewer
33
+ endpoint="https://api.panoramax.xyz/api"
34
+ mapstyle="https://my.tiles.provider/basic.json"
35
+ map='{
36
+ "attributionControl": { "customAttribution": "&copy; IGN" }
37
+ }'
38
+ />
39
+ ```
@@ -132,3 +132,7 @@ URL parameters are now managed in the URL _search_ part (everything after the `?
132
132
  ```urlencoded
133
133
  https://panoramax.ign.fr/?background=streets&focus=map&map=9/48.6659/2.3237&speed=250
134
134
  ```
135
+
136
+ ## 🪛 Initialization parameters
137
+
138
+ Parameters passed to __Viewer__ are more finely read, they can come from Web Component itself (attributes), browser local storage or URL search parameters. URL ones are read first, then local storage, and finally component attributes. This can be misleading while you develop, [read more about this on Develop documentation](../09_Develop.md#parameters-handling).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoramax/web-viewer",
3
- "version": "3.2.3-develop-17933507",
3
+ "version": "3.2.3-develop-eb68a0ea",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
@@ -31,16 +31,18 @@
31
31
  <pnx-viewer
32
32
  id="viewer"
33
33
  class="fullpage"
34
- map='{"raster": {
35
- "type": "raster",
36
- "tiles": [
37
- "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}"
38
- ],
39
- "minzoom": 0,
40
- "maxzoom": 21,
41
- "attribution": "&copy; IGN",
42
- "tileSize": 256
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": "&copy; 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-gl-js-docs/style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles.
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-gl-js-docs/style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles.
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).
@@ -69,6 +69,12 @@ const MAP_MOVE_DELTA = 100;
69
69
  * >
70
70
  * <p slot="top-right">My custom text</p>
71
71
  * </pnx-viewer>
72
+ *
73
+ * <!-- With map options -->
74
+ * <pnx-viewer
75
+ * endpoint="https://panoramax.openstreetmap.fr/"
76
+ * map="{'maxZoom': 15, 'background': 'aerial', 'raster': '...'}"
77
+ * />
72
78
  * ```
73
79
  */
74
80
  export default class Viewer extends Basic {
@@ -77,8 +83,8 @@ export default class Viewer extends Basic {
77
83
  * @memberof Panoramax.components.core.Viewer#
78
84
  * @mixes Panoramax.components.core.Basic#properties
79
85
  * @type {Object}
80
- * @property {boolean|object} [map=true] Should map be used (true/false), or an object with [any map option available in Map class](#Panoramax.components.ui.MapMore)
81
- * @property {object} [psv] [Any option to pass to Photo component](#Panoramax.components.ui.Photo) as an object
86
+ * @property {boolean|object} [map=true] Should map be used (true/false), or an object with [any map option available in Map or MapMore class](#Panoramax.components.ui.MapMore).<br />Example: `map="{'background': 'aerial', 'theme': 'age'}"`
87
+ * @property {object} [psv] [Any option to pass to Photo component](#Panoramax.components.ui.Photo) as an object.<br />Example: `psv="{'transitionDuration': 500, 'picturesNavigation': 'pic'}"`
82
88
  * @property {string} [url-parameters=true] Should the component add and update URL query parameters to save viewer state ?
83
89
  * @property {string} [focus=pic] The component showing up as main component (pic, map)
84
90
  * @property {string} [geocoder=nominatim] The geocoder engine to use (nominatim, ban)
@@ -87,7 +93,7 @@ export default class Viewer extends Basic {
87
93
  * @property {string} [sequence] The sequence ID of the picture displayed
88
94
  * @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
95
  * @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-gl-js-docs/style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles.
96
+ * @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
97
  * @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.
92
98
  * @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
99
  */
@@ -46,7 +46,7 @@ export default class MapLegend extends LitElement {
46
46
  </pnx-link-button>
47
47
  </div>
48
48
  </div>
49
- ${mapAttrib ? html`${this._parent?._t.map.map_data}<br />${mapAttrib}` : nothing}
49
+ ${mapAttrib && mapAttrib.innerHTML.length > 0 ? html`${this._parent?._t.map.map_data}<br />${mapAttrib}` : nothing}
50
50
  `;
51
51
  }
52
52
  }
@@ -17,8 +17,10 @@ import * as pmtiles from "pmtiles";
17
17
  maplibregl.workerClass = maplibreglWorker;
18
18
  maplibregl.addProtocol("pmtiles", new pmtiles.Protocol().tile);
19
19
 
20
- const MAPLIBRE_OPTIONS = [ // No "style" option as it's handled by combineStyles function
21
- "antialias", "attributionControl", "bearing", "bearingSnap", "bounds",
20
+ // No "style" option as it's handled by combineStyles function
21
+ // and no "attributionControl" as its handled manually
22
+ const MAPLIBRE_OPTIONS = [
23
+ "antialias", "bearing", "bearingSnap", "bounds",
22
24
  "boxZoom", "center", "clickTolerance", "collectResourceTiming",
23
25
  "cooperativeGestures", "crossSourceCollisions", "doubleClickZoom", "dragPan",
24
26
  "dragRotate", "fadeDuration", "failIfMajorPerformanceCaveat", "fitBoundsOptions",
@@ -49,6 +51,7 @@ const filterMapLibreOptions = opts => Object.fromEntries(Object.entries(opts).fi
49
51
  * @param {object} [options] The map options (any of [MapLibre GL settings](https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/MapOptions/) or any supplementary option defined here)
50
52
  * @param {object} [options.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).
51
53
  * @param {string} [options.background=streets] Choose default map background to display (streets or aerial, if raster aerial background available). Defaults to street.
54
+ * @param {string} [options.attributionControl.customAttribution] To override default map attribution.
52
55
  * @fires Panoramax.components.ui.Map#background-changed
53
56
  * @fires Panoramax.components.ui.Map#users-changed
54
57
  * @fires Panoramax.components.ui.Map#sequence-hover
@@ -95,7 +98,7 @@ export default class Map extends maplibregl.Map {
95
98
  this._options.background = this._options.background || "streets";
96
99
  }
97
100
 
98
- this._attribution = new maplibregl.AttributionControl({ compact: false });
101
+ this._attribution = new maplibregl.AttributionControl({ compact: false, ...options.attributionControl });
99
102
  this.addControl(this._attribution);
100
103
 
101
104
  this._initMapPosition();
@@ -60,6 +60,7 @@ export default class InitParameters { // eslint-disable-line import/no-unused-mo
60
60
  let lang = componentAttrs.lang;
61
61
  let endpoint = componentAttrs.endpoint;
62
62
  let map_raster = componentMap.raster;
63
+ let map_attribution = componentMap.attributionControl;
63
64
 
64
65
  // - URL only
65
66
  let psv_xyz = urlParams.xyz;
@@ -101,7 +102,7 @@ export default class InitParameters { // eslint-disable-line import/no-unused-mo
101
102
  };
102
103
  this._psvPostInit = { xyz: psv_xyz };
103
104
 
104
- this._mapInit = { raster: map_raster };
105
+ this._mapInit = { raster: map_raster, attributionControl: map_attribution };
105
106
  this._mapAny = {
106
107
  theme: map_theme,
107
108
  background: map_background,