@panoramax/web-viewer 3.2.3-develop-04898f19 → 3.2.3-develop-64f445f0

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/docs/index.md CHANGED
@@ -83,6 +83,15 @@ Once ready, you can create for example a viewer. We use web components to do so,
83
83
 
84
84
  [Many options are available to configure it finely](./reference/components/core/Viewer.md).
85
85
 
86
+ You may also add some CSS to make sure your component has proper dimensions:
87
+
88
+ ```css
89
+ pnx-viewer {
90
+ width: 300px;
91
+ height: 250px;
92
+ }
93
+ ```
94
+
86
95
  Beyond classic viewer, other widgets are available and [can be tested online](https://viewer.geovisio.fr/).
87
96
 
88
97
  __Coverage map__
@@ -35,11 +35,14 @@
35
35
  ### new CoverageMap()
36
36
  Coverage Map is a basic map showing Panoramax coverage.
37
37
 
38
+ Make sure to set width/height through CSS for proper display.
39
+
38
40
  **Example**
39
41
  ```html
40
42
  <pnx-coverage-map
41
43
  endpoint="https://panoramax.openstreetmap.fr/"
42
44
  map='{"bounds": [[-73.9876, 40.7661], [-73.9397, 40.8002]]}'
45
+ style="width: 300px; height: 250px"
43
46
  />
44
47
  ```
45
48
  <a name="Panoramax.components.core.CoverageMap+properties"></a>
@@ -38,10 +38,13 @@
38
38
  Editor allows to focus on a single sequence, and preview what you edits would look like.
39
39
  It shows both picture and map.
40
40
 
41
+ Make sure to set width/height through CSS for proper display.
42
+
41
43
  **Example**
42
44
  ```html
43
45
  <pnx-editor
44
46
  endpoint="https://panoramax.openstreetmap.fr/"
47
+ style="width: 300px; height: 250px"
45
48
  />
46
49
  ```
47
50
  <a name="Panoramax.components.core.Editor+properties"></a>
@@ -56,16 +56,20 @@ This component has a [CorneredGrid](../layout/CorneredGrid.md/#Panoramax.compone
56
56
 
57
57
  If you need a viewer with map, checkout [Viewer component](Viewer.md/#Panoramax.components.core.Viewer).
58
58
 
59
+ Make sure to set width/height through CSS for proper display.
60
+
59
61
  **Example**
60
62
  ```html
61
63
  <!-- Basic example -->
62
64
  <pnx-photo-viewer
63
65
  endpoint="https://panoramax.openstreetmap.fr/"
66
+ style="width: 300px; height: 250px"
64
67
  />
65
68
 
66
69
  <!-- With slotted widgets -->
67
70
  <pnx-photo-viewer
68
71
  endpoint="https://panoramax.openstreetmap.fr/"
72
+ style="width: 300px; height: 250px"
69
73
  >
70
74
  <p slot="top-right">My custom text</p>
71
75
  </pnx-photo-viewer>
@@ -73,6 +77,7 @@ If you need a viewer with map, checkout [Viewer component](Viewer.md/#Panoramax.
73
77
  <!-- With only your custom widgets -->
74
78
  <pnx-photo-viewer
75
79
  endpoint="https://panoramax.openstreetmap.fr/"
80
+ style="width: 300px; height: 250px"
76
81
  widgets="false"
77
82
  >
78
83
  <p slot="top-right">My custom text</p>
@@ -61,16 +61,20 @@ This component has a [CorneredGrid](../layout/CorneredGrid.md/#Panoramax.compone
61
61
 
62
62
  If you need a viewer without map, checkout [Photo Viewer component](PhotoViewer.md/#Panoramax.components.core.PhotoViewer).
63
63
 
64
+ Make sure to set width/height through CSS for proper display.
65
+
64
66
  **Example**
65
67
  ```html
66
68
  <!-- Basic example -->
67
69
  <pnx-viewer
68
70
  endpoint="https://panoramax.openstreetmap.fr/"
71
+ style="width: 300px; height: 250px"
69
72
  />
70
73
 
71
74
  <!-- With slotted widgets -->
72
75
  <pnx-viewer
73
76
  endpoint="https://panoramax.openstreetmap.fr/"
77
+ style="width: 300px; height: 250px"
74
78
  >
75
79
  <p slot="top-right">My custom text</p>
76
80
  </pnx-viewer>
@@ -78,6 +82,7 @@ If you need a viewer without map, checkout [Photo Viewer component](PhotoViewer.
78
82
  <!-- With only your custom widgets -->
79
83
  <pnx-viewer
80
84
  endpoint="https://panoramax.openstreetmap.fr/"
85
+ style="width: 300px; height: 250px"
81
86
  widgets="false"
82
87
  >
83
88
  <p slot="top-right">My custom text</p>
@@ -86,6 +91,7 @@ If you need a viewer without map, checkout [Photo Viewer component](PhotoViewer.
86
91
  <!-- With map options -->
87
92
  <pnx-viewer
88
93
  endpoint="https://panoramax.openstreetmap.fr/"
94
+ style="width: 300px; height: 250px"
89
95
  map="{'maxZoom': 15, 'background': 'aerial', 'raster': '...'}"
90
96
  />
91
97
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoramax/web-viewer",
3
- "version": "3.2.3-develop-04898f19",
3
+ "version": "3.2.3-develop-64f445f0",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
@@ -8,6 +8,8 @@ import { default as InitParameters, alterMapState } from "../../utils/InitParame
8
8
 
9
9
  /**
10
10
  * Coverage Map is a basic map showing Panoramax coverage.
11
+ *
12
+ * Make sure to set width/height through CSS for proper display.
11
13
  * @class Panoramax.components.core.CoverageMap
12
14
  * @element pnx-coverage-map
13
15
  * @extends Panoramax.components.core.Basic
@@ -22,6 +24,7 @@ import { default as InitParameters, alterMapState } from "../../utils/InitParame
22
24
  * <pnx-coverage-map
23
25
  * endpoint="https://panoramax.openstreetmap.fr/"
24
26
  * map='{"bounds": [[-73.9876, 40.7661], [-73.9397, 40.8002]]}'
27
+ * style="width: 300px; height: 250px"
25
28
  * />
26
29
  * ```
27
30
  */
@@ -54,9 +57,6 @@ export default class CoverageMap extends Basic {
54
57
  this._initParams = new InitParameters(InitParameters.GetComponentProperties(CoverageMap, this));
55
58
  this._initMap();
56
59
  });
57
-
58
- // Events handlers
59
- this.addEventListener("select", this._onSelect.bind(this));
60
60
  }
61
61
 
62
62
  getClassName() {
@@ -103,13 +103,16 @@ export default class CoverageMap extends Basic {
103
103
  this.map = new MyMap(this, this._mapContainer, Object.assign({}, this._initParams.getMapInit(), { hash: true }));
104
104
  this.map.addControl(new NavigationControl({ showCompass: false }));
105
105
  this.loader.setAttribute("value", 70);
106
+
107
+ this.addEventListener("select", this._onSelect.bind(this));
108
+ this.map.on("picture-click", e => this.select(e.seqId, e.picId));
109
+ this.map.on("sequence-click", e => this.select(e.seqId));
110
+
106
111
  this.map.waitForEnoughMapLoaded().then(() => {
107
112
  alterMapState(this.map, this._initParams.getMapPostInit());
108
113
  this.map.reloadLayersStyles();
109
114
  this.loader.dismiss();
110
115
  });
111
- this.map.on("picture-click", e => this.select(e.seqId, e.picId));
112
- this.map.on("sequence-click", e => this.select(e.seqId));
113
116
  }
114
117
 
115
118
  /**
@@ -17,6 +17,8 @@ const LAYER_HEADING_ID = "sequence-headings";
17
17
  /**
18
18
  * Editor allows to focus on a single sequence, and preview what you edits would look like.
19
19
  * It shows both picture and map.
20
+ *
21
+ * Make sure to set width/height through CSS for proper display.
20
22
  * @class Panoramax.components.core.Editor
21
23
  * @element pnx-editor
22
24
  * @extends Panoramax.components.core.Basic
@@ -31,6 +33,7 @@ const LAYER_HEADING_ID = "sequence-headings";
31
33
  * ```html
32
34
  * <pnx-editor
33
35
  * endpoint="https://panoramax.openstreetmap.fr/"
36
+ * style="width: 300px; height: 250px"
34
37
  * />
35
38
  * ```
36
39
  */
@@ -20,6 +20,8 @@ const PSV_MOVE_DELTA = Math.PI / 6;
20
20
  * This component has a [CorneredGrid](#Panoramax.components.layout.CorneredGrid) layout, you can use directly any slot element to pass custom widgets.
21
21
  *
22
22
  * If you need a viewer with map, checkout [Viewer component](#Panoramax.components.core.Viewer).
23
+ *
24
+ * Make sure to set width/height through CSS for proper display.
23
25
  * @class Panoramax.components.core.PhotoViewer
24
26
  * @element pnx-photo-viewer
25
27
  * @extends Panoramax.components.core.Basic
@@ -43,11 +45,13 @@ const PSV_MOVE_DELTA = Math.PI / 6;
43
45
  * <!-- Basic example -->
44
46
  * <pnx-photo-viewer
45
47
  * endpoint="https://panoramax.openstreetmap.fr/"
48
+ * style="width: 300px; height: 250px"
46
49
  * />
47
50
  *
48
51
  * <!-- With slotted widgets -->
49
52
  * <pnx-photo-viewer
50
53
  * endpoint="https://panoramax.openstreetmap.fr/"
54
+ * style="width: 300px; height: 250px"
51
55
  * >
52
56
  * <p slot="top-right">My custom text</p>
53
57
  * </pnx-photo-viewer>
@@ -55,6 +59,7 @@ const PSV_MOVE_DELTA = Math.PI / 6;
55
59
  * <!-- With only your custom widgets -->
56
60
  * <pnx-photo-viewer
57
61
  * endpoint="https://panoramax.openstreetmap.fr/"
62
+ * style="width: 300px; height: 250px"
58
63
  * widgets="false"
59
64
  * >
60
65
  * <p slot="top-right">My custom text</p>
@@ -26,6 +26,8 @@ const MAP_MOVE_DELTA = 100;
26
26
  * This component has a [CorneredGrid](#Panoramax.components.layout.CorneredGrid) layout, you can use directly any slot element to pass custom widgets.
27
27
  *
28
28
  * If you need a viewer without map, checkout [Photo Viewer component](#Panoramax.components.core.PhotoViewer).
29
+ *
30
+ * Make sure to set width/height through CSS for proper display.
29
31
  * @class Panoramax.components.core.Viewer
30
32
  * @element pnx-viewer
31
33
  * @extends Panoramax.components.core.PhotoViewer
@@ -52,11 +54,13 @@ const MAP_MOVE_DELTA = 100;
52
54
  * <!-- Basic example -->
53
55
  * <pnx-viewer
54
56
  * endpoint="https://panoramax.openstreetmap.fr/"
57
+ * style="width: 300px; height: 250px"
55
58
  * />
56
59
  *
57
60
  * <!-- With slotted widgets -->
58
61
  * <pnx-viewer
59
62
  * endpoint="https://panoramax.openstreetmap.fr/"
63
+ * style="width: 300px; height: 250px"
60
64
  * >
61
65
  * <p slot="top-right">My custom text</p>
62
66
  * </pnx-viewer>
@@ -64,6 +68,7 @@ const MAP_MOVE_DELTA = 100;
64
68
  * <!-- With only your custom widgets -->
65
69
  * <pnx-viewer
66
70
  * endpoint="https://panoramax.openstreetmap.fr/"
71
+ * style="width: 300px; height: 250px"
67
72
  * widgets="false"
68
73
  * >
69
74
  * <p slot="top-right">My custom text</p>
@@ -72,6 +77,7 @@ const MAP_MOVE_DELTA = 100;
72
77
  * <!-- With map options -->
73
78
  * <pnx-viewer
74
79
  * endpoint="https://panoramax.openstreetmap.fr/"
80
+ * style="width: 300px; height: 250px"
75
81
  * map="{'maxZoom': 15, 'background': 'aerial', 'raster': '...'}"
76
82
  * />
77
83
  * ```
package/src/utils/map.js CHANGED
@@ -136,6 +136,9 @@ export function combineStyles(parent, options) {
136
136
  style.layers = style.layers.concat(options.supplementaryStyle.layers || []);
137
137
  }
138
138
 
139
+ // Fix for empty layers causing sorting issues
140
+ style.layers = style.layers.filter(l => l.id);
141
+
139
142
  // Aerial imagery background
140
143
  if(options.raster) {
141
144
  style.sources["pnx-aerial"] = options.raster;