@panoramax/web-viewer 4.0.3-develop-85c1e9c4 → 4.0.3-develop-a14de8c5
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/CHANGELOG.md +1 -0
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/photo.html +1 -1
- package/build/viewer.html +1 -1
- package/docs/reference/utils/URLHandler.md +7 -0
- package/package.json +1 -1
- package/public/photo.html +1 -1
- package/public/viewer.html +1 -1
- package/src/components/core/CoverageMap.js +6 -0
- package/src/components/core/Editor.js +8 -0
- package/src/components/core/PhotoViewer.js +7 -0
- package/src/components/core/Viewer.js +6 -0
- package/src/utils/URLHandler.js +8 -0
package/build/photo.html
CHANGED
|
@@ -1 +1 @@
|
|
|
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 Photo 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-photo-viewer id="viewer" class="fullpage" sequence="ecfe4b2c-0acd-4d3a-a10d-c3e6818755c8" picture="329af5c6-4761-4a6d-9c1e-674fd6daa8b6"
|
|
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 Photo 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-photo-viewer id="viewer" class="fullpage" sequence="ecfe4b2c-0acd-4d3a-a10d-c3e6818755c8" picture="329af5c6-4761-4a6d-9c1e-674fd6daa8b6"></pnx-photo-viewer><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>
|
package/build/viewer.html
CHANGED
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
attribution: "© IGN",
|
|
10
10
|
tileSize: 256
|
|
11
11
|
}
|
|
12
|
-
}'
|
|
12
|
+
}'></pnx-viewer><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>
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* [.URLHandler](#Panoramax.utils.URLHandler)
|
|
8
8
|
* [new URLHandler(parent)](#new_Panoramax.utils.URLHandler_new)
|
|
9
9
|
* [.listenToChanges()](#Panoramax.utils.URLHandler+listenToChanges)
|
|
10
|
+
* [.destroy()](#Panoramax.utils.URLHandler+destroy)
|
|
10
11
|
* [.nextURLParams()](#Panoramax.utils.URLHandler+nextURLParams) ⇒ <code>object</code>
|
|
11
12
|
* [.nextURLString()](#Panoramax.utils.URLHandler+nextURLString) ⇒ <code>string</code>
|
|
12
13
|
* [.currentURLParams([readFromHash])](#Panoramax.utils.URLHandler+currentURLParams) ⇒ <code>object</code>
|
|
@@ -34,6 +35,12 @@ Note that you may call `listenToChanges()` for this class to be effective once p
|
|
|
34
35
|
Start listening to URL & parent changes through events.
|
|
35
36
|
This leads to parent & URL updates.
|
|
36
37
|
|
|
38
|
+
**Kind**: instance method of [<code>URLHandler</code>](#Panoramax.utils.URLHandler)
|
|
39
|
+
<a name="Panoramax.utils.URLHandler+destroy"></a>
|
|
40
|
+
|
|
41
|
+
### urlHandler.destroy()
|
|
42
|
+
Call this function to stop listening to global events.
|
|
43
|
+
|
|
37
44
|
**Kind**: instance method of [<code>URLHandler</code>](#Panoramax.utils.URLHandler)
|
|
38
45
|
<a name="Panoramax.utils.URLHandler+nextURLParams"></a>
|
|
39
46
|
|
package/package.json
CHANGED
package/public/photo.html
CHANGED
package/public/viewer.html
CHANGED
|
@@ -83,6 +83,13 @@ export default class Editor extends Basic {
|
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
/** @private */
|
|
87
|
+
disconnectedCallback() {
|
|
88
|
+
super.disconnectedCallback();
|
|
89
|
+
this.map?.destroy();
|
|
90
|
+
this.psv?.destroy();
|
|
91
|
+
}
|
|
92
|
+
|
|
86
93
|
getClassName() {
|
|
87
94
|
return "Editor";
|
|
88
95
|
}
|
|
@@ -243,6 +250,7 @@ export default class Editor extends Basic {
|
|
|
243
250
|
"type": "FeatureCollection",
|
|
244
251
|
"features": [
|
|
245
252
|
{
|
|
253
|
+
"id": this.sequence,
|
|
246
254
|
"type": "Feature",
|
|
247
255
|
"properties": {
|
|
248
256
|
"id": this.sequence,
|
|
@@ -187,6 +187,13 @@ export default class PhotoViewer extends Basic {
|
|
|
187
187
|
this.onceAPIReady().then(this._postAPIInit.bind(this));
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
+
/** @private */
|
|
191
|
+
disconnectedCallback() {
|
|
192
|
+
super.disconnectedCallback();
|
|
193
|
+
this.urlHandler?.destroy();
|
|
194
|
+
this.psv?.destroy();
|
|
195
|
+
}
|
|
196
|
+
|
|
190
197
|
/** @private */
|
|
191
198
|
firstUpdated() {
|
|
192
199
|
super.firstUpdated();
|
package/src/utils/URLHandler.js
CHANGED
|
@@ -45,6 +45,14 @@ export default class URLHandler extends EventTarget {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Call this function to stop listening to global events.
|
|
50
|
+
* @memberof Panoramax.utils.URLHandler#
|
|
51
|
+
*/
|
|
52
|
+
destroy() {
|
|
53
|
+
window.removeEventListener("popstate", this._onURLChange);
|
|
54
|
+
}
|
|
55
|
+
|
|
48
56
|
/**
|
|
49
57
|
* Compute next values to insert in URL
|
|
50
58
|
* @returns {object} Query parameters
|