@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/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"/><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 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: "&copy; IGN",
10
10
  tileSize: 256
11
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>
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoramax/web-viewer",
3
- "version": "4.0.3-develop-85c1e9c4",
3
+ "version": "4.0.3-develop-a14de8c5",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
package/public/photo.html CHANGED
@@ -33,7 +33,7 @@
33
33
  class="fullpage"
34
34
  sequence="ecfe4b2c-0acd-4d3a-a10d-c3e6818755c8"
35
35
  picture="329af5c6-4761-4a6d-9c1e-674fd6daa8b6"
36
- />
36
+ ></pnx-photo-viewer>
37
37
 
38
38
  <script>
39
39
  var servers = {
@@ -43,7 +43,7 @@
43
43
  tileSize: 256
44
44
  }
45
45
  }'
46
- />
46
+ ></pnx-viewer>
47
47
 
48
48
  <script>
49
49
  var servers = {
@@ -59,6 +59,12 @@ export default class CoverageMap extends Basic {
59
59
  });
60
60
  }
61
61
 
62
+ /** @private */
63
+ disconnectedCallback() {
64
+ super.disconnectedCallback();
65
+ this.map?.destroy();
66
+ }
67
+
62
68
  getClassName() {
63
69
  return "CoverageMap";
64
70
  }
@@ -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();
@@ -204,6 +204,12 @@ export default class Viewer extends PhotoViewer {
204
204
  }
205
205
  }
206
206
 
207
+ /** @private */
208
+ disconnectedCallback() {
209
+ super.disconnectedCallback();
210
+ this.map?.destroy();
211
+ }
212
+
207
213
  getClassName() {
208
214
  return "Viewer";
209
215
  }
@@ -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