@panoramax/web-viewer 3.2.3-develop-dfee2adc → 3.2.3-develop-fbf5d630

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoramax/web-viewer",
3
- "version": "3.2.3-develop-dfee2adc",
3
+ "version": "3.2.3-develop-fbf5d630",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
@@ -59,7 +59,7 @@ export default class Basic extends LitElement {
59
59
  this.users = ["geovisio"];
60
60
  this.mapstyle = this.getAttribute("mapstyle") || DEFAULT_TILES;
61
61
  this.lang = this.getAttribute("lang") || null;
62
- this.endpoint = null; // No default
62
+ this.endpoint = this.getAttribute("endpoint") || null; // No default
63
63
  this.picture = null;
64
64
  this.sequence = null;
65
65
 
@@ -83,6 +83,18 @@ export default class Basic extends LitElement {
83
83
 
84
84
  connectedCallback() {
85
85
  super.connectedCallback();
86
+
87
+ if(
88
+ !(this._loadsAPI && this.endpoint && this._loadsAPI === this.endpoint)
89
+ && !(this.api && this.api._endpoint === this.endpoint)
90
+ && this.endpoint
91
+ ) {
92
+ if(this._loadsAPI || this.api) {
93
+ delete this.api;
94
+ delete this._loadsAPI;
95
+ }
96
+ this._setupAPI();
97
+ }
86
98
  }
87
99
 
88
100
  /**
@@ -340,7 +352,9 @@ export default class Basic extends LitElement {
340
352
  /** @private */
341
353
  static GetJSONConverter() {
342
354
  return {
343
- fromAttribute: (value) => JSON5.parse(value),
355
+ fromAttribute: (value) => {
356
+ return typeof value === "object" ? value : JSON5.parse(value);
357
+ },
344
358
  toAttribute: (value) => JSON.stringify(value)
345
359
  };
346
360
  }