@eeacms/volto-arcgis-block 0.1.302 → 0.1.303
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 +3 -1
- package/package.json +1 -1
- package/src/components/MapViewer/HotspotWidget.jsx +3 -1
- package/src/components/MapViewer/InfoWidget.jsx +3 -1
- package/src/components/MapViewer/LegendWidget.jsx +3 -1
- package/src/components/MapViewer/LoadingSpinner.jsx +3 -1
- package/src/components/MapViewer/MapViewer.jsx +123 -86
- package/src/components/MapViewer/MeasurementWidget.jsx +7 -5
- package/src/components/MapViewer/MenuWidget.jsx +6 -4
- package/src/components/MapViewer/PanWidget.jsx +7 -5
- package/src/components/MapViewer/PrintWidget.jsx +7 -5
- package/src/components/MapViewer/ScaleWidget.jsx +3 -1
- package/src/components/MapViewer/SwipeWidget.jsx +3 -1
- package/src/components/MapViewer/TimesliderWidget.jsx +8 -6
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,9 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
-
### [0.1.
|
|
7
|
+
### [0.1.303](https://github.com/eea/volto-arcgis-block/compare/0.1.302...0.1.303) - 10 September 2024
|
|
8
|
+
|
|
9
|
+
### [0.1.302](https://github.com/eea/volto-arcgis-block/compare/0.1.301...0.1.302) - 6 September 2024
|
|
8
10
|
|
|
9
11
|
### [0.1.301](https://github.com/eea/volto-arcgis-block/compare/0.1.300...0.1.301) - 21 August 2024
|
|
10
12
|
|
package/package.json
CHANGED
|
@@ -948,7 +948,9 @@ class HotspotWidget extends React.Component {
|
|
|
948
948
|
async componentDidMount() {
|
|
949
949
|
await this.getLayerParameters();
|
|
950
950
|
await this.loader();
|
|
951
|
-
this.props.
|
|
951
|
+
if (this.props.mapDiv.current) {
|
|
952
|
+
this.props.view.ui.add(this.container.current, 'top-right');
|
|
953
|
+
}
|
|
952
954
|
this.layerModelInit();
|
|
953
955
|
this.getBBoxData();
|
|
954
956
|
this.props.view.when(() => {
|
|
@@ -90,7 +90,9 @@ class InfoWidget extends React.Component {
|
|
|
90
90
|
* This method is executed after the rener method is executed
|
|
91
91
|
*/ async componentDidMount() {
|
|
92
92
|
await this.loader();
|
|
93
|
-
this.props.
|
|
93
|
+
if (this.props.mapDiv.current) {
|
|
94
|
+
this.props.view.ui.add(this.container.current, 'top-right');
|
|
95
|
+
}
|
|
94
96
|
this.props.view.on('click', (e) => {
|
|
95
97
|
let screenPoint = {
|
|
96
98
|
x: e.x,
|
|
@@ -232,7 +232,9 @@ class LegendWidget extends React.Component {
|
|
|
232
232
|
*/
|
|
233
233
|
async componentDidMount() {
|
|
234
234
|
await this.loader();
|
|
235
|
-
this.props.
|
|
235
|
+
if (this.props.mapDiv.current) {
|
|
236
|
+
this.props.view.ui.add(this.container.current, 'top-right');
|
|
237
|
+
}
|
|
236
238
|
this.LegendWidget = new Legend({
|
|
237
239
|
view: this.props.view,
|
|
238
240
|
viewModel: new LegendViewModel({
|
|
@@ -55,7 +55,9 @@ class LoadingSpinner extends React.Component {
|
|
|
55
55
|
|
|
56
56
|
async componentDidMount() {
|
|
57
57
|
this.props.view.when(() => {
|
|
58
|
-
this.props.
|
|
58
|
+
if (this.props.mapDiv.current) {
|
|
59
|
+
this.props.view.ui.add(this.container.current, 'manual');
|
|
60
|
+
}
|
|
59
61
|
this.listenForLayerChanges();
|
|
60
62
|
});
|
|
61
63
|
}
|
|
@@ -182,89 +182,91 @@ class MapViewer extends React.Component {
|
|
|
182
182
|
// ],
|
|
183
183
|
});
|
|
184
184
|
|
|
185
|
-
this.
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
mapStatus = this.recoverState();
|
|
192
|
-
|
|
193
|
-
if (
|
|
194
|
-
mapStatus === null ||
|
|
195
|
-
(mapStatus.zoom === null && mapStatus.center === null) ||
|
|
196
|
-
Object.entries(mapStatus).length === 0
|
|
197
|
-
) {
|
|
198
|
-
mapStatus = {};
|
|
199
|
-
mapStatus.zoom = this.mapCfg.zoom;
|
|
200
|
-
mapStatus.center = this.mapCfg.center;
|
|
201
|
-
mapStatus.activeLayers = this.mapCfg.activeLayers;
|
|
202
|
-
this.setCenterState(this.mapCfg.center);
|
|
203
|
-
this.setZoomState(this.mapCfg.zoom);
|
|
204
|
-
this.activeLayersHandler(this.mapCfg.activeLayers);
|
|
205
|
-
}
|
|
185
|
+
if (this.mapdiv.current) {
|
|
186
|
+
this.map = new Map({
|
|
187
|
+
// basemap: 'topo',
|
|
188
|
+
basemap: this.positronCompositeBasemap,
|
|
189
|
+
logo: false,
|
|
190
|
+
});
|
|
206
191
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
this.zoom = new Zoom({
|
|
223
|
-
view: this.view,
|
|
224
|
-
});
|
|
225
|
-
this.view.ui.add(this.zoom, {
|
|
226
|
-
position: 'top-right',
|
|
227
|
-
});
|
|
192
|
+
mapStatus = this.recoverState();
|
|
193
|
+
|
|
194
|
+
if (
|
|
195
|
+
mapStatus === null ||
|
|
196
|
+
(mapStatus.zoom === null && mapStatus.center === null) ||
|
|
197
|
+
Object.entries(mapStatus).length === 0
|
|
198
|
+
) {
|
|
199
|
+
mapStatus = {};
|
|
200
|
+
mapStatus.zoom = this.mapCfg.zoom;
|
|
201
|
+
mapStatus.center = this.mapCfg.center;
|
|
202
|
+
mapStatus.activeLayers = this.mapCfg.activeLayers;
|
|
203
|
+
this.setCenterState(this.mapCfg.center);
|
|
204
|
+
this.setZoomState(this.mapCfg.zoom);
|
|
205
|
+
this.activeLayersHandler(this.mapCfg.activeLayers);
|
|
206
|
+
}
|
|
228
207
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
this.
|
|
208
|
+
this.view = new MapView({
|
|
209
|
+
container: this.mapdiv.current,
|
|
210
|
+
map: this.map,
|
|
211
|
+
center: mapStatus.center,
|
|
212
|
+
zoom: mapStatus.zoom,
|
|
213
|
+
constraints: {
|
|
214
|
+
minZoom: this.mapCfg.minZoom,
|
|
215
|
+
maxZoom: this.mapCfg.maxZoom,
|
|
216
|
+
rotationEnabled: false,
|
|
217
|
+
geometry: this.mapCfg.geometry,
|
|
218
|
+
},
|
|
219
|
+
ui: {
|
|
220
|
+
components: ['attribution'],
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
this.zoom = new Zoom({
|
|
224
|
+
view: this.view,
|
|
225
|
+
});
|
|
226
|
+
this.view.ui.add(this.zoom, {
|
|
227
|
+
position: 'top-right',
|
|
232
228
|
});
|
|
233
229
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
230
|
+
this.view.when(() => {
|
|
231
|
+
this.view.watch('center', (newValue, oldValue, property, object) => {
|
|
232
|
+
this.setCenterState(newValue);
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
let constraintExtent = null;
|
|
236
|
+
this.view.watch('zoom', (newValue, oldValue, property, object) => {
|
|
237
|
+
this.setZoomState(newValue);
|
|
238
|
+
if (mapStatus.zoom <= this.mapCfg.minZoom) {
|
|
239
|
+
constraintExtent = new Extent({
|
|
240
|
+
xmin: this.mapCfg.geometry.xmin,
|
|
241
|
+
ymin: this.mapCfg.geometry.ymin,
|
|
242
|
+
xmax: this.mapCfg.geometry.xmax,
|
|
243
|
+
ymax: this.mapCfg.geometry.ymax,
|
|
244
|
+
spatialReference: 4326,
|
|
245
|
+
});
|
|
246
|
+
} else {
|
|
247
|
+
constraintExtent = new Extent({
|
|
248
|
+
xmin: this.mapCfg.geometryZoomIn.xmin,
|
|
249
|
+
ymin: this.mapCfg.geometryZoomIn.ymin,
|
|
250
|
+
xmax: this.mapCfg.geometryZoomIn.xmax,
|
|
251
|
+
ymax: this.mapCfg.geometryZoomIn.ymax,
|
|
252
|
+
spatialReference: 4326,
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
this.view.constraints.geometry = constraintExtent;
|
|
256
|
+
});
|
|
257
|
+
this.view.popup.autoOpenEnabled = false;
|
|
258
|
+
// After launching the MapViewerConfig action
|
|
259
|
+
// we will have stored the json response here:
|
|
260
|
+
// this.props.mapviewer_config
|
|
261
|
+
this.props.MapViewerConfig(flattenToAppURL(this.props.url));
|
|
262
|
+
//Once we have created the MapView, we need to ensure that the map div
|
|
263
|
+
//is refreshed in order to show the map on it. To do so, we need to
|
|
264
|
+
//trigger the renderization again, and to trigger the renderization
|
|
265
|
+
//we invoke the setState method, that changes the state and forces a
|
|
266
|
+
//react component to render itself again
|
|
267
|
+
//this.setState({});
|
|
255
268
|
});
|
|
256
|
-
|
|
257
|
-
// After launching the MapViewerConfig action
|
|
258
|
-
// we will have stored the json response here:
|
|
259
|
-
// this.props.mapviewer_config
|
|
260
|
-
this.props.MapViewerConfig(flattenToAppURL(this.props.url));
|
|
261
|
-
//Once we have created the MapView, we need to ensure that the map div
|
|
262
|
-
//is refreshed in order to show the map on it. To do so, we need to
|
|
263
|
-
//trigger the renderization again, and to trigger the renderization
|
|
264
|
-
//we invoke the setState method, that changes the state and forces a
|
|
265
|
-
//react component to render itself again
|
|
266
|
-
//this.setState({});
|
|
267
|
-
});
|
|
269
|
+
}
|
|
268
270
|
}
|
|
269
271
|
|
|
270
272
|
componentDidUpdate(prevProps, prevState) {
|
|
@@ -319,7 +321,12 @@ class MapViewer extends React.Component {
|
|
|
319
321
|
if (this.props.mapviewer_config.Download) return;
|
|
320
322
|
if (this.view)
|
|
321
323
|
return (
|
|
322
|
-
<BasemapWidget
|
|
324
|
+
<BasemapWidget
|
|
325
|
+
view={this.view}
|
|
326
|
+
mapViewer={this}
|
|
327
|
+
urls={this.cfgUrls}
|
|
328
|
+
mapDiv={this.mapdiv}
|
|
329
|
+
/>
|
|
323
330
|
);
|
|
324
331
|
}
|
|
325
332
|
|
|
@@ -334,6 +341,7 @@ class MapViewer extends React.Component {
|
|
|
334
341
|
layerLoading={this.state.layerLoading}
|
|
335
342
|
hotspotData={this.state.hotspotData}
|
|
336
343
|
hotspotDataHandler={this.hotspotDataHandler}
|
|
344
|
+
mapDiv={this.mapdiv}
|
|
337
345
|
/>
|
|
338
346
|
);
|
|
339
347
|
}
|
|
@@ -341,12 +349,21 @@ class MapViewer extends React.Component {
|
|
|
341
349
|
renderMeasurement() {
|
|
342
350
|
if (this.props.mapviewer_config.Download) return;
|
|
343
351
|
if (this.view)
|
|
344
|
-
return
|
|
352
|
+
return (
|
|
353
|
+
<MeasurementWidget
|
|
354
|
+
view={this.view}
|
|
355
|
+
mapViewer={this}
|
|
356
|
+
mapDiv={this.mapdiv}
|
|
357
|
+
/>
|
|
358
|
+
);
|
|
345
359
|
}
|
|
346
360
|
|
|
347
361
|
renderPrint() {
|
|
348
362
|
if (this.props.mapviewer_config.Download) return;
|
|
349
|
-
if (this.view)
|
|
363
|
+
if (this.view)
|
|
364
|
+
return (
|
|
365
|
+
<PrintWidget view={this.view} mapViewer={this} mapDiv={this.mapdiv} />
|
|
366
|
+
);
|
|
350
367
|
}
|
|
351
368
|
|
|
352
369
|
renderSwipe() {
|
|
@@ -358,6 +375,7 @@ class MapViewer extends React.Component {
|
|
|
358
375
|
mapViewer={this}
|
|
359
376
|
map={this.map}
|
|
360
377
|
layers={this.state.layers}
|
|
378
|
+
mapDiv={this.mapdiv}
|
|
361
379
|
/>
|
|
362
380
|
);
|
|
363
381
|
}
|
|
@@ -365,12 +383,17 @@ class MapViewer extends React.Component {
|
|
|
365
383
|
renderArea() {
|
|
366
384
|
if (this.props.mapviewer_config.Download) return;
|
|
367
385
|
if (this.view) {
|
|
368
|
-
return
|
|
386
|
+
return (
|
|
387
|
+
<CheckLogin reference={this} urls={this.cfgUrls} mapDiv={this.mapdiv} />
|
|
388
|
+
);
|
|
369
389
|
}
|
|
370
390
|
}
|
|
371
391
|
|
|
372
392
|
renderScale() {
|
|
373
|
-
if (this.view)
|
|
393
|
+
if (this.view)
|
|
394
|
+
return (
|
|
395
|
+
<ScaleWidget view={this.view} mapViewer={this} mapDiv={this.mapdiv} />
|
|
396
|
+
);
|
|
374
397
|
}
|
|
375
398
|
|
|
376
399
|
renderInfo() {
|
|
@@ -381,13 +404,21 @@ class MapViewer extends React.Component {
|
|
|
381
404
|
map={this.map}
|
|
382
405
|
mapViewer={this}
|
|
383
406
|
hotspotData={this.state.hotspotData}
|
|
407
|
+
mapDiv={this.mapdiv}
|
|
384
408
|
/>
|
|
385
409
|
);
|
|
386
410
|
}
|
|
387
411
|
|
|
388
412
|
renderPan() {
|
|
389
413
|
if (this.view)
|
|
390
|
-
return
|
|
414
|
+
return (
|
|
415
|
+
<PanWidget
|
|
416
|
+
view={this.view}
|
|
417
|
+
map={this.map}
|
|
418
|
+
mapViewer={this}
|
|
419
|
+
mapDiv={this.mapdiv}
|
|
420
|
+
/>
|
|
421
|
+
);
|
|
391
422
|
}
|
|
392
423
|
|
|
393
424
|
renderHotspot() {
|
|
@@ -406,6 +437,7 @@ class MapViewer extends React.Component {
|
|
|
406
437
|
hotspotDataHandler={this.hotspotDataHandler}
|
|
407
438
|
mapLayersHandler={this.mapLayersHandler}
|
|
408
439
|
bookmarkData={this.state.bookmarkData}
|
|
440
|
+
mapDiv={this.mapdiv}
|
|
409
441
|
/>
|
|
410
442
|
);
|
|
411
443
|
}
|
|
@@ -435,12 +467,13 @@ class MapViewer extends React.Component {
|
|
|
435
467
|
prepackageHandler={this.prepackageHandler}
|
|
436
468
|
uploadedFile={this.state.uploadedFile}
|
|
437
469
|
uploadFileHandler={this.uploadFileHandler}
|
|
470
|
+
mapDiv={this.mapdiv}
|
|
438
471
|
/>
|
|
439
472
|
); //call conf
|
|
440
473
|
}
|
|
441
474
|
|
|
442
475
|
renderBookmark() {
|
|
443
|
-
if (this.view) return <CheckUserID reference={this} />;
|
|
476
|
+
if (this.view) return <CheckUserID reference={this} mapDiv={this.mapdiv} />;
|
|
444
477
|
}
|
|
445
478
|
|
|
446
479
|
appLanguage() {
|
|
@@ -449,7 +482,11 @@ class MapViewer extends React.Component {
|
|
|
449
482
|
|
|
450
483
|
renderLoadingSpinner() {
|
|
451
484
|
return (
|
|
452
|
-
<LoadingSpinner
|
|
485
|
+
<LoadingSpinner
|
|
486
|
+
view={this.view}
|
|
487
|
+
layerLoading={this.state.layerLoading}
|
|
488
|
+
mapDiv={this.mapdiv}
|
|
489
|
+
/>
|
|
453
490
|
);
|
|
454
491
|
}
|
|
455
492
|
|
|
@@ -180,11 +180,13 @@ class MeasurementWidget extends React.Component {
|
|
|
180
180
|
*/
|
|
181
181
|
async componentDidMount() {
|
|
182
182
|
await this.loader();
|
|
183
|
-
this.props.
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
183
|
+
if (this.props.mapDiv.current) {
|
|
184
|
+
this.props.view.ui.add(this.container.current, 'top-right');
|
|
185
|
+
this.measurement = new Measurement({
|
|
186
|
+
view: this.props.view,
|
|
187
|
+
container: this.container.current.querySelector('.measurement-area'),
|
|
188
|
+
});
|
|
189
|
+
}
|
|
188
190
|
}
|
|
189
191
|
/**
|
|
190
192
|
* This method renders the component
|
|
@@ -799,11 +799,13 @@ class MenuWidget extends React.Component {
|
|
|
799
799
|
loadCss();
|
|
800
800
|
await this.loader();
|
|
801
801
|
await this.getTMSLayersJSON();
|
|
802
|
-
if (
|
|
803
|
-
this.
|
|
804
|
-
|
|
802
|
+
if (this.props.mapDiv.current) {
|
|
803
|
+
if (!this.props.download) {
|
|
804
|
+
this.prepareHotspotLayers();
|
|
805
|
+
this.getHotspotLayerIds();
|
|
806
|
+
}
|
|
807
|
+
this.props.view.ui.add(this.container.current, 'top-left');
|
|
805
808
|
}
|
|
806
|
-
this.props.view.ui.add(this.container.current, 'top-left');
|
|
807
809
|
if (this.props.download) {
|
|
808
810
|
setTimeout(() => {
|
|
809
811
|
document.querySelector('.area-panel input:checked').click();
|
|
@@ -20,11 +20,13 @@ class PanWidget extends React.Component {
|
|
|
20
20
|
* This method is executed after the rener method is executed
|
|
21
21
|
*/
|
|
22
22
|
async componentDidMount() {
|
|
23
|
-
this.props.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
if (this.props.mapDiv.current) {
|
|
24
|
+
this.props.view.ui.add({
|
|
25
|
+
component: this.container.current,
|
|
26
|
+
position: 'top-right',
|
|
27
|
+
index: 0,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
togglePan() {
|
|
@@ -71,11 +71,13 @@ class PrintWidget extends React.Component {
|
|
|
71
71
|
*/
|
|
72
72
|
async componentDidMount() {
|
|
73
73
|
await this.loader();
|
|
74
|
-
this.props.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
if (this.props.mapDiv.current) {
|
|
75
|
+
this.props.view.ui.add(this.container.current, 'top-right');
|
|
76
|
+
this.print = new Print({
|
|
77
|
+
view: this.props.view,
|
|
78
|
+
container: this.container.current.querySelector('.print-panel'),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
componentDidUpdate() {
|
|
@@ -35,7 +35,9 @@ class ScaleWidget extends React.Component {
|
|
|
35
35
|
view: this.props.view,
|
|
36
36
|
unit: 'dual',
|
|
37
37
|
});
|
|
38
|
-
this.props.
|
|
38
|
+
if (this.props.mapDiv.current) {
|
|
39
|
+
this.props.view.ui.add(this.scaleBar, 'bottom-left');
|
|
40
|
+
}
|
|
39
41
|
}
|
|
40
42
|
/**
|
|
41
43
|
* This method renders the component
|
|
@@ -91,7 +91,9 @@ class SwipeWidget extends React.Component {
|
|
|
91
91
|
* This method is executed after the rener method is executed
|
|
92
92
|
*/
|
|
93
93
|
async componentDidMount() {
|
|
94
|
-
this.props.
|
|
94
|
+
if (this.props.mapDiv.current) {
|
|
95
|
+
this.props.view.ui.add(this.container.current, 'top-right');
|
|
96
|
+
}
|
|
95
97
|
await this.loader();
|
|
96
98
|
this.swipe = new Swipe({
|
|
97
99
|
view: this.props.view,
|
|
@@ -262,12 +262,14 @@ class TimesliderWidget extends React.Component {
|
|
|
262
262
|
}
|
|
263
263
|
},
|
|
264
264
|
});
|
|
265
|
-
this.props.
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
265
|
+
if (this.props.mapDiv.current) {
|
|
266
|
+
this.props.view.ui.add(this.container.current, 'bottom-right');
|
|
267
|
+
this.container.current.insertAdjacentHTML(
|
|
268
|
+
'beforeend',
|
|
269
|
+
'<div class="esri-icon-close" id="timeslider_close" role="button"></div>',
|
|
270
|
+
);
|
|
271
|
+
this.container.current.style.display = 'block';
|
|
272
|
+
}
|
|
271
273
|
this.setState({ showDatePanel: true });
|
|
272
274
|
|
|
273
275
|
document
|