@mapcomponents/react-maplibre 0.1.13 → 0.1.17
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/.github/workflows/storybook.yml +4 -2
- package/CHANGELOG.md +33 -0
- package/README.md +22 -6
- package/coverage/clover.xml +447 -460
- package/coverage/coverage-final.json +14 -14
- package/coverage/lcov-report/index.html +77 -78
- package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.js.html +2 -3
- package/coverage/lcov-report/src/components/MapLibreMap/index.html +2 -3
- package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.js.html +2 -3
- package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +2 -3
- package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.js.html +2 -3
- package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +2 -3
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.js.html +2 -3
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +2 -3
- package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.js.html +112 -107
- package/coverage/lcov-report/src/components/MlFollowGps/index.html +16 -17
- package/coverage/lcov-report/src/components/MlGPXViewer/MlGPXViewer.js.html +2 -3
- package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +2 -3
- package/coverage/lcov-report/src/components/MlGPXViewer/index.html +2 -3
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.js.html +142 -134
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +20 -21
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.js.html +46 -152
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +20 -21
- package/coverage/lcov-report/src/components/MlLayer/MlLayer.js.html +92 -30
- package/coverage/lcov-report/src/components/MlLayer/index.html +20 -21
- package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.js.html +2 -3
- package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +2 -3
- package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.js.html +2 -3
- package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +2 -3
- package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +3 -10
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +9 -82
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +10 -11
- package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +2 -3
- package/coverage/lcov-report/src/components/MlMarker/MlMarker.js.html +6 -7
- package/coverage/lcov-report/src/components/MlMarker/index.html +6 -7
- package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.js.html +2 -3
- package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +2 -3
- package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.js.html +11 -15
- package/coverage/lcov-report/src/components/MlNavigationTools/index.html +8 -9
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +2 -3
- package/coverage/lcov-report/src/components/MlOsmLayer/index.html +2 -3
- package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +2 -3
- package/coverage/lcov-report/src/components/MlScaleReference/index.html +2 -3
- package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +209 -18
- package/coverage/lcov-report/src/components/MlShareMapState/index.html +10 -11
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +2 -3
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +2 -3
- package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +2 -3
- package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +2 -3
- package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +6 -25
- package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +6 -7
- package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.js.html +2 -3
- package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +2 -3
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +2 -3
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +2 -3
- package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.js.html +2 -3
- package/coverage/lcov-report/src/components/MlWmsLayer/index.html +2 -3
- package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.js.html +6 -19
- package/coverage/lcov-report/src/components/MlWmsLoader/index.html +8 -9
- package/coverage/lcov-report/src/hooks/index.html +35 -36
- package/coverage/lcov-report/src/hooks/useMap.js.html +81 -169
- package/coverage/lcov-report/src/hooks/useMapState.js.html +82 -125
- package/coverage/lcov-report/src/hooks/useWms.js.html +9 -22
- package/coverage/lcov-report/src/i18n.js.html +2 -3
- package/coverage/lcov-report/src/index.html +2 -3
- package/coverage/lcov-report/src/translations/english.js.html +2 -3
- package/coverage/lcov-report/src/translations/german.js.html +2 -3
- package/coverage/lcov-report/src/translations/index.html +2 -3
- package/coverage/lcov.info +891 -896
- package/dist/index.esm.js +941 -717
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.js +16 -14
- package/src/components/MlComponentTemplate/MlComponentTemplate.js +7 -32
- package/src/components/MlFollowGps/MlFollowGps.js +67 -65
- package/src/components/MlFollowGps/MlFollowGps.test.js +3 -5
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.js +91 -88
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.js +20 -6
- package/src/components/MlGeoJsonLayer/assets/sample_polygon_1.json +33 -0
- package/src/components/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry.js +25 -0
- package/src/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.js +22 -0
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.js +21 -56
- package/src/components/MlLayer/MlLayer.js +26 -5
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.js +0 -2
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.stories.js +3 -6
- package/src/components/MlLayerSwitcher/components/LayerBox.js +2 -26
- package/src/components/MlMarker/MlMarker.js +1 -1
- package/src/components/MlNavigationTools/MlNavigationTools.js +4 -5
- package/src/components/MlShareMapState/MlShareMapState.js +73 -9
- package/src/components/MlShareMapState/MlShareMapState.stories.js +22 -2
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.js +1 -3
- package/src/components/MlUseMapDebugger/MlUseMapDebugger.js +1 -7
- package/src/components/MlWmsLoader/MlWmsLoader.js +0 -4
- package/src/hooks/useMap.js +33 -62
- package/src/hooks/useMapState.js +3 -17
- package/src/hooks/useWms.js +2 -7
- package/src/index.js +3 -0
- package/src/ui_components/ImageLoader.js +8 -3
- package/src/ui_components/Sidebar.js +1 -1
- package/src/ui_components/TopToolbar.js +0 -2
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>0/
|
|
28
|
+
<span class='fraction'>0/50</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
40
|
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>0/
|
|
42
|
+
<span class='fraction'>0/12</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>0/
|
|
49
|
+
<span class='fraction'>0/46</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -230,8 +230,7 @@
|
|
|
230
230
|
<a name='L165'></a><a href='#L165'>165</a>
|
|
231
231
|
<a name='L166'></a><a href='#L166'>166</a>
|
|
232
232
|
<a name='L167'></a><a href='#L167'>167</a>
|
|
233
|
-
<a name='L168'></a><a href='#L168'>168</a>
|
|
234
|
-
<a name='L169'></a><a href='#L169'>169</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
233
|
+
<a name='L168'></a><a href='#L168'>168</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
235
234
|
<span class="cline-any cline-neutral"> </span>
|
|
236
235
|
<span class="cline-any cline-neutral"> </span>
|
|
237
236
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -274,7 +273,6 @@
|
|
|
274
273
|
<span class="cline-any cline-neutral"> </span>
|
|
275
274
|
<span class="cline-any cline-neutral"> </span>
|
|
276
275
|
<span class="cline-any cline-neutral"> </span>
|
|
277
|
-
<span class="cline-any cline-neutral"> </span>
|
|
278
276
|
<span class="cline-any cline-no"> </span>
|
|
279
277
|
<span class="cline-any cline-no"> </span>
|
|
280
278
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -377,7 +375,7 @@
|
|
|
377
375
|
<span class="cline-any cline-neutral"> </span>
|
|
378
376
|
<span class="cline-any cline-neutral"> </span>
|
|
379
377
|
<span class="cline-any cline-neutral"> </span>
|
|
380
|
-
<span class="cline-any cline-
|
|
378
|
+
<span class="cline-any cline-no"> </span>
|
|
381
379
|
<span class="cline-any cline-neutral"> </span>
|
|
382
380
|
<span class="cline-any cline-neutral"> </span>
|
|
383
381
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -430,7 +428,6 @@ const MlNavigationTools = <span class="cstat-no" title="statement not covered" >
|
|
|
430
428
|
minHeight: "20px",
|
|
431
429
|
width: mediaIsMobile ? "50px" : "30px",
|
|
432
430
|
height: mediaIsMobile ? "50px" : "30px",
|
|
433
|
-
color: "#bbb",
|
|
434
431
|
backgroundColor: "#414141",
|
|
435
432
|
borderRadius: "23%",
|
|
436
433
|
//border: "1px solid #bbb",
|
|
@@ -439,8 +436,8 @@ const MlNavigationTools = <span class="cstat-no" title="statement not covered" >
|
|
|
439
436
|
fontSize: mediaIsMobile ? "1.5em" : "1.2em",
|
|
440
437
|
":hover": {
|
|
441
438
|
backgroundColor: "#515151",
|
|
442
|
-
color: "#ececec",
|
|
443
439
|
},
|
|
440
|
+
color: "#ececec"
|
|
444
441
|
};
|
|
445
442
|
|
|
446
443
|
<span class="cstat-no" title="statement not covered" > useEffect(<span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
@@ -545,7 +542,7 @@ const MlNavigationTools = <span class="cstat-no" title="statement not covered" >
|
|
|
545
542
|
<Button sx={buttonStyle} onClick={moveToCurrentLocation} disabled={locationAccessDenied}>
|
|
546
543
|
<GpsFixedIcon sx={{fontSize: mediaIsMobile ? "1.5em" : "1.2em"}}/>
|
|
547
544
|
</Button>
|
|
548
|
-
<MlFollowGps style={buttonStyle}/>
|
|
545
|
+
<MlFollowGps style={{...(<span class="fstat-no" title="function not covered" >({</span>color, ...rest}) => <span class="cstat-no" title="statement not covered" >rest)</span>(buttonStyle)}} />
|
|
549
546
|
<ButtonGroup
|
|
550
547
|
orientation="vertical"
|
|
551
548
|
sx={{
|
|
@@ -555,10 +552,10 @@ const MlNavigationTools = <span class="cstat-no" title="statement not covered" >
|
|
|
555
552
|
"Button:hover": {border: "none"},
|
|
556
553
|
}}
|
|
557
554
|
>
|
|
558
|
-
<Button sx={buttonStyle} onClick={zoomIn}>
|
|
555
|
+
<Button sx={{...buttonStyle, color: "#ececec",}} onClick={zoomIn}>
|
|
559
556
|
<ControlPointIcon sx={{fontSize: mediaIsMobile ? "1.5em" : "1.2em"}}/>
|
|
560
557
|
</Button>
|
|
561
|
-
<Button sx={buttonStyle} onClick={zoomOut}>
|
|
558
|
+
<Button sx={{...buttonStyle, color: "#ececec",}} onClick={zoomOut}>
|
|
562
559
|
<RemoveCircleOutlineIcon sx={{fontSize: mediaIsMobile ? "1.5em" : "1.2em"}}/>
|
|
563
560
|
</Button>
|
|
564
561
|
</ButtonGroup>
|
|
@@ -573,10 +570,9 @@ export default MlNavigationTools;
|
|
|
573
570
|
</div><!-- /wrapper -->
|
|
574
571
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
575
572
|
Code coverage generated by
|
|
576
|
-
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
577
|
-
at
|
|
573
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
574
|
+
at Sun Jan 09 2022 17:13:08 GMT+0000 (Coordinated Universal Time)
|
|
578
575
|
</div>
|
|
579
|
-
</div>
|
|
580
576
|
<script src="../../../prettify.js"></script>
|
|
581
577
|
<script>
|
|
582
578
|
window.onload = function () {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>0/
|
|
28
|
+
<span class='fraction'>0/50</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
40
|
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>0/
|
|
42
|
+
<span class='fraction'>0/12</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>0/
|
|
49
|
+
<span class='fraction'>0/46</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -84,13 +84,13 @@
|
|
|
84
84
|
<div class="chart"><div class="cover-fill" style="width: 0%"></div><div class="cover-empty" style="width: 100%"></div></div>
|
|
85
85
|
</td>
|
|
86
86
|
<td data-value="0" class="pct low">0%</td>
|
|
87
|
-
<td data-value="
|
|
87
|
+
<td data-value="50" class="abs low">0/50</td>
|
|
88
88
|
<td data-value="0" class="pct low">0%</td>
|
|
89
89
|
<td data-value="44" class="abs low">0/44</td>
|
|
90
90
|
<td data-value="0" class="pct low">0%</td>
|
|
91
|
-
<td data-value="
|
|
91
|
+
<td data-value="12" class="abs low">0/12</td>
|
|
92
92
|
<td data-value="0" class="pct low">0%</td>
|
|
93
|
-
<td data-value="
|
|
93
|
+
<td data-value="46" class="abs low">0/46</td>
|
|
94
94
|
</tr>
|
|
95
95
|
|
|
96
96
|
</tbody>
|
|
@@ -100,10 +100,9 @@
|
|
|
100
100
|
</div><!-- /wrapper -->
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
|
-
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
104
|
-
at
|
|
103
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
+
at Sun Jan 09 2022 17:13:08 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
|
-
</div>
|
|
107
106
|
<script src="../../../prettify.js"></script>
|
|
108
107
|
<script>
|
|
109
108
|
window.onload = function () {
|
|
@@ -405,10 +405,9 @@ export default MlOsmLayer;
|
|
|
405
405
|
</div><!-- /wrapper -->
|
|
406
406
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
407
407
|
Code coverage generated by
|
|
408
|
-
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
409
|
-
at
|
|
408
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
409
|
+
at Sun Jan 09 2022 17:13:08 GMT+0000 (Coordinated Universal Time)
|
|
410
410
|
</div>
|
|
411
|
-
</div>
|
|
412
411
|
<script src="../../../prettify.js"></script>
|
|
413
412
|
<script>
|
|
414
413
|
window.onload = function () {
|
|
@@ -100,10 +100,9 @@
|
|
|
100
100
|
</div><!-- /wrapper -->
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
|
-
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
104
|
-
at
|
|
103
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
+
at Sun Jan 09 2022 17:13:08 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
|
-
</div>
|
|
107
106
|
<script src="../../../prettify.js"></script>
|
|
108
107
|
<script>
|
|
109
108
|
window.onload = function () {
|
|
@@ -534,10 +534,9 @@ export default MlScaleReference;
|
|
|
534
534
|
</div><!-- /wrapper -->
|
|
535
535
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
536
536
|
Code coverage generated by
|
|
537
|
-
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
538
|
-
at
|
|
537
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
538
|
+
at Sun Jan 09 2022 17:13:08 GMT+0000 (Coordinated Universal Time)
|
|
539
539
|
</div>
|
|
540
|
-
</div>
|
|
541
540
|
<script src="../../../prettify.js"></script>
|
|
542
541
|
<script>
|
|
543
542
|
window.onload = function () {
|
|
@@ -100,10 +100,9 @@
|
|
|
100
100
|
</div><!-- /wrapper -->
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
|
-
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
104
|
-
at
|
|
103
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
+
at Sun Jan 09 2022 17:13:08 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
|
-
</div>
|
|
107
106
|
<script src="../../../prettify.js"></script>
|
|
108
107
|
<script>
|
|
109
108
|
window.onload = function () {
|
|
@@ -25,28 +25,28 @@
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>0/
|
|
28
|
+
<span class='fraction'>0/87</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>0/
|
|
35
|
+
<span class='fraction'>0/42</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
40
|
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>0/
|
|
42
|
+
<span class='fraction'>0/10</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>0/
|
|
49
|
+
<span class='fraction'>0/81</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -182,7 +182,71 @@
|
|
|
182
182
|
<a name='L117'></a><a href='#L117'>117</a>
|
|
183
183
|
<a name='L118'></a><a href='#L118'>118</a>
|
|
184
184
|
<a name='L119'></a><a href='#L119'>119</a>
|
|
185
|
-
<a name='L120'></a><a href='#L120'>120</a
|
|
185
|
+
<a name='L120'></a><a href='#L120'>120</a>
|
|
186
|
+
<a name='L121'></a><a href='#L121'>121</a>
|
|
187
|
+
<a name='L122'></a><a href='#L122'>122</a>
|
|
188
|
+
<a name='L123'></a><a href='#L123'>123</a>
|
|
189
|
+
<a name='L124'></a><a href='#L124'>124</a>
|
|
190
|
+
<a name='L125'></a><a href='#L125'>125</a>
|
|
191
|
+
<a name='L126'></a><a href='#L126'>126</a>
|
|
192
|
+
<a name='L127'></a><a href='#L127'>127</a>
|
|
193
|
+
<a name='L128'></a><a href='#L128'>128</a>
|
|
194
|
+
<a name='L129'></a><a href='#L129'>129</a>
|
|
195
|
+
<a name='L130'></a><a href='#L130'>130</a>
|
|
196
|
+
<a name='L131'></a><a href='#L131'>131</a>
|
|
197
|
+
<a name='L132'></a><a href='#L132'>132</a>
|
|
198
|
+
<a name='L133'></a><a href='#L133'>133</a>
|
|
199
|
+
<a name='L134'></a><a href='#L134'>134</a>
|
|
200
|
+
<a name='L135'></a><a href='#L135'>135</a>
|
|
201
|
+
<a name='L136'></a><a href='#L136'>136</a>
|
|
202
|
+
<a name='L137'></a><a href='#L137'>137</a>
|
|
203
|
+
<a name='L138'></a><a href='#L138'>138</a>
|
|
204
|
+
<a name='L139'></a><a href='#L139'>139</a>
|
|
205
|
+
<a name='L140'></a><a href='#L140'>140</a>
|
|
206
|
+
<a name='L141'></a><a href='#L141'>141</a>
|
|
207
|
+
<a name='L142'></a><a href='#L142'>142</a>
|
|
208
|
+
<a name='L143'></a><a href='#L143'>143</a>
|
|
209
|
+
<a name='L144'></a><a href='#L144'>144</a>
|
|
210
|
+
<a name='L145'></a><a href='#L145'>145</a>
|
|
211
|
+
<a name='L146'></a><a href='#L146'>146</a>
|
|
212
|
+
<a name='L147'></a><a href='#L147'>147</a>
|
|
213
|
+
<a name='L148'></a><a href='#L148'>148</a>
|
|
214
|
+
<a name='L149'></a><a href='#L149'>149</a>
|
|
215
|
+
<a name='L150'></a><a href='#L150'>150</a>
|
|
216
|
+
<a name='L151'></a><a href='#L151'>151</a>
|
|
217
|
+
<a name='L152'></a><a href='#L152'>152</a>
|
|
218
|
+
<a name='L153'></a><a href='#L153'>153</a>
|
|
219
|
+
<a name='L154'></a><a href='#L154'>154</a>
|
|
220
|
+
<a name='L155'></a><a href='#L155'>155</a>
|
|
221
|
+
<a name='L156'></a><a href='#L156'>156</a>
|
|
222
|
+
<a name='L157'></a><a href='#L157'>157</a>
|
|
223
|
+
<a name='L158'></a><a href='#L158'>158</a>
|
|
224
|
+
<a name='L159'></a><a href='#L159'>159</a>
|
|
225
|
+
<a name='L160'></a><a href='#L160'>160</a>
|
|
226
|
+
<a name='L161'></a><a href='#L161'>161</a>
|
|
227
|
+
<a name='L162'></a><a href='#L162'>162</a>
|
|
228
|
+
<a name='L163'></a><a href='#L163'>163</a>
|
|
229
|
+
<a name='L164'></a><a href='#L164'>164</a>
|
|
230
|
+
<a name='L165'></a><a href='#L165'>165</a>
|
|
231
|
+
<a name='L166'></a><a href='#L166'>166</a>
|
|
232
|
+
<a name='L167'></a><a href='#L167'>167</a>
|
|
233
|
+
<a name='L168'></a><a href='#L168'>168</a>
|
|
234
|
+
<a name='L169'></a><a href='#L169'>169</a>
|
|
235
|
+
<a name='L170'></a><a href='#L170'>170</a>
|
|
236
|
+
<a name='L171'></a><a href='#L171'>171</a>
|
|
237
|
+
<a name='L172'></a><a href='#L172'>172</a>
|
|
238
|
+
<a name='L173'></a><a href='#L173'>173</a>
|
|
239
|
+
<a name='L174'></a><a href='#L174'>174</a>
|
|
240
|
+
<a name='L175'></a><a href='#L175'>175</a>
|
|
241
|
+
<a name='L176'></a><a href='#L176'>176</a>
|
|
242
|
+
<a name='L177'></a><a href='#L177'>177</a>
|
|
243
|
+
<a name='L178'></a><a href='#L178'>178</a>
|
|
244
|
+
<a name='L179'></a><a href='#L179'>179</a>
|
|
245
|
+
<a name='L180'></a><a href='#L180'>180</a>
|
|
246
|
+
<a name='L181'></a><a href='#L181'>181</a>
|
|
247
|
+
<a name='L182'></a><a href='#L182'>182</a>
|
|
248
|
+
<a name='L183'></a><a href='#L183'>183</a>
|
|
249
|
+
<a name='L184'></a><a href='#L184'>184</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
186
250
|
<span class="cline-any cline-neutral"> </span>
|
|
187
251
|
<span class="cline-any cline-neutral"> </span>
|
|
188
252
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -196,7 +260,6 @@
|
|
|
196
260
|
<span class="cline-any cline-neutral"> </span>
|
|
197
261
|
<span class="cline-any cline-neutral"> </span>
|
|
198
262
|
<span class="cline-any cline-neutral"> </span>
|
|
199
|
-
<span class="cline-any cline-no"> </span>
|
|
200
263
|
<span class="cline-any cline-neutral"> </span>
|
|
201
264
|
<span class="cline-any cline-no"> </span>
|
|
202
265
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -204,6 +267,18 @@
|
|
|
204
267
|
<span class="cline-any cline-no"> </span>
|
|
205
268
|
<span class="cline-any cline-no"> </span>
|
|
206
269
|
<span class="cline-any cline-no"> </span>
|
|
270
|
+
<span class="cline-any cline-no"> </span>
|
|
271
|
+
<span class="cline-any cline-no"> </span>
|
|
272
|
+
<span class="cline-any cline-no"> </span>
|
|
273
|
+
<span class="cline-any cline-neutral"> </span>
|
|
274
|
+
<span class="cline-any cline-neutral"> </span>
|
|
275
|
+
<span class="cline-any cline-neutral"> </span>
|
|
276
|
+
<span class="cline-any cline-neutral"> </span>
|
|
277
|
+
<span class="cline-any cline-neutral"> </span>
|
|
278
|
+
<span class="cline-any cline-neutral"> </span>
|
|
279
|
+
<span class="cline-any cline-neutral"> </span>
|
|
280
|
+
<span class="cline-any cline-neutral"> </span>
|
|
281
|
+
<span class="cline-any cline-neutral"> </span>
|
|
207
282
|
<span class="cline-any cline-neutral"> </span>
|
|
208
283
|
<span class="cline-any cline-no"> </span>
|
|
209
284
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -239,40 +314,93 @@
|
|
|
239
314
|
<span class="cline-any cline-no"> </span>
|
|
240
315
|
<span class="cline-any cline-no"> </span>
|
|
241
316
|
<span class="cline-any cline-no"> </span>
|
|
317
|
+
<span class="cline-any cline-neutral"> </span>
|
|
318
|
+
<span class="cline-any cline-neutral"> </span>
|
|
319
|
+
<span class="cline-any cline-neutral"> </span>
|
|
320
|
+
<span class="cline-any cline-no"> </span>
|
|
321
|
+
<span class="cline-any cline-no"> </span>
|
|
322
|
+
<span class="cline-any cline-no"> </span>
|
|
242
323
|
<span class="cline-any cline-no"> </span>
|
|
243
324
|
<span class="cline-any cline-neutral"> </span>
|
|
325
|
+
<span class="cline-any cline-no"> </span>
|
|
326
|
+
<span class="cline-any cline-neutral"> </span>
|
|
327
|
+
<span class="cline-any cline-no"> </span>
|
|
328
|
+
<span class="cline-any cline-no"> </span>
|
|
329
|
+
<span class="cline-any cline-no"> </span>
|
|
330
|
+
<span class="cline-any cline-no"> </span>
|
|
331
|
+
<span class="cline-any cline-neutral"> </span>
|
|
332
|
+
<span class="cline-any cline-neutral"> </span>
|
|
333
|
+
<span class="cline-any cline-neutral"> </span>
|
|
244
334
|
<span class="cline-any cline-neutral"> </span>
|
|
245
335
|
<span class="cline-any cline-neutral"> </span>
|
|
246
336
|
<span class="cline-any cline-no"> </span>
|
|
247
337
|
<span class="cline-any cline-no"> </span>
|
|
338
|
+
<span class="cline-any cline-no"> </span>
|
|
248
339
|
<span class="cline-any cline-neutral"> </span>
|
|
249
340
|
<span class="cline-any cline-no"> </span>
|
|
250
341
|
<span class="cline-any cline-no"> </span>
|
|
342
|
+
<span class="cline-any cline-no"> </span>
|
|
251
343
|
<span class="cline-any cline-neutral"> </span>
|
|
252
344
|
<span class="cline-any cline-neutral"> </span>
|
|
253
345
|
<span class="cline-any cline-no"> </span>
|
|
254
346
|
<span class="cline-any cline-no"> </span>
|
|
347
|
+
<span class="cline-any cline-no"> </span>
|
|
348
|
+
<span class="cline-any cline-neutral"> </span>
|
|
349
|
+
<span class="cline-any cline-neutral"> </span>
|
|
255
350
|
<span class="cline-any cline-neutral"> </span>
|
|
256
351
|
<span class="cline-any cline-neutral"> </span>
|
|
257
352
|
<span class="cline-any cline-neutral"> </span>
|
|
258
353
|
<span class="cline-any cline-no"> </span>
|
|
259
354
|
<span class="cline-any cline-no"> </span>
|
|
355
|
+
<span class="cline-any cline-neutral"> </span>
|
|
356
|
+
<span class="cline-any cline-neutral"> </span>
|
|
357
|
+
<span class="cline-any cline-neutral"> </span>
|
|
358
|
+
<span class="cline-any cline-neutral"> </span>
|
|
359
|
+
<span class="cline-any cline-neutral"> </span>
|
|
260
360
|
<span class="cline-any cline-no"> </span>
|
|
361
|
+
<span class="cline-any cline-no"> </span>
|
|
362
|
+
<span class="cline-any cline-no"> </span>
|
|
363
|
+
<span class="cline-any cline-neutral"> </span>
|
|
364
|
+
<span class="cline-any cline-neutral"> </span>
|
|
365
|
+
<span class="cline-any cline-neutral"> </span>
|
|
261
366
|
<span class="cline-any cline-neutral"> </span>
|
|
262
367
|
<span class="cline-any cline-neutral"> </span>
|
|
263
368
|
<span class="cline-any cline-neutral"> </span>
|
|
264
369
|
<span class="cline-any cline-neutral"> </span>
|
|
265
370
|
<span class="cline-any cline-neutral"> </span>
|
|
266
371
|
<span class="cline-any cline-neutral"> </span>
|
|
372
|
+
<span class="cline-any cline-no"> </span>
|
|
373
|
+
<span class="cline-any cline-neutral"> </span>
|
|
374
|
+
<span class="cline-any cline-neutral"> </span>
|
|
267
375
|
<span class="cline-any cline-neutral"> </span>
|
|
376
|
+
<span class="cline-any cline-no"> </span>
|
|
377
|
+
<span class="cline-any cline-no"> </span>
|
|
268
378
|
<span class="cline-any cline-neutral"> </span>
|
|
379
|
+
<span class="cline-any cline-no"> </span>
|
|
380
|
+
<span class="cline-any cline-no"> </span>
|
|
381
|
+
<span class="cline-any cline-no"> </span>
|
|
382
|
+
<span class="cline-any cline-no"> </span>
|
|
383
|
+
<span class="cline-any cline-no"> </span>
|
|
384
|
+
<span class="cline-any cline-no"> </span>
|
|
385
|
+
<span class="cline-any cline-no"> </span>
|
|
386
|
+
<span class="cline-any cline-no"> </span>
|
|
269
387
|
<span class="cline-any cline-neutral"> </span>
|
|
270
388
|
<span class="cline-any cline-no"> </span>
|
|
389
|
+
<span class="cline-any cline-no"> </span>
|
|
271
390
|
<span class="cline-any cline-neutral"> </span>
|
|
391
|
+
<span class="cline-any cline-no"> </span>
|
|
272
392
|
<span class="cline-any cline-neutral"> </span>
|
|
273
393
|
<span class="cline-any cline-neutral"> </span>
|
|
274
394
|
<span class="cline-any cline-no"> </span>
|
|
275
395
|
<span class="cline-any cline-no"> </span>
|
|
396
|
+
<span class="cline-any cline-no"> </span>
|
|
397
|
+
<span class="cline-any cline-no"> </span>
|
|
398
|
+
<span class="cline-any cline-no"> </span>
|
|
399
|
+
<span class="cline-any cline-neutral"> </span>
|
|
400
|
+
<span class="cline-any cline-neutral"> </span>
|
|
401
|
+
<span class="cline-any cline-no"> </span>
|
|
402
|
+
<span class="cline-any cline-neutral"> </span>
|
|
403
|
+
<span class="cline-any cline-no"> </span>
|
|
276
404
|
<span class="cline-any cline-neutral"> </span>
|
|
277
405
|
<span class="cline-any cline-neutral"> </span>
|
|
278
406
|
<span class="cline-any cline-no"> </span>
|
|
@@ -301,11 +429,12 @@
|
|
|
301
429
|
<span class="cline-any cline-neutral"> </span>
|
|
302
430
|
<span class="cline-any cline-neutral"> </span>
|
|
303
431
|
<span class="cline-any cline-neutral"> </span>
|
|
304
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, {
|
|
432
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, {useRef, useEffect, useContext, useState} from "react";
|
|
305
433
|
import PropTypes from "prop-types";
|
|
306
434
|
|
|
307
|
-
import {
|
|
308
|
-
import {
|
|
435
|
+
import {MapContext} from "@mapcomponents/react-core";
|
|
436
|
+
import {v4 as uuidv4} from "uuid";
|
|
437
|
+
import useMapState from "../../hooks/useMapState";
|
|
309
438
|
|
|
310
439
|
/**
|
|
311
440
|
* TODO: Add short & useful description
|
|
@@ -318,11 +447,21 @@ import { v4 as uuidv4 } from "uuid";
|
|
|
318
447
|
const MlShareMapState = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(p</span>rops) => {</span>
|
|
319
448
|
// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks
|
|
320
449
|
const mapContext = <span class="cstat-no" title="statement not covered" >useContext(MapContext);</span>
|
|
321
|
-
|
|
322
450
|
const initializedRef = <span class="cstat-no" title="statement not covered" >useRef(false);</span>
|
|
323
451
|
const mapRef = <span class="cstat-no" title="statement not covered" >useRef(undefined);</span>
|
|
324
452
|
const [map, setMap] = <span class="cstat-no" title="statement not covered" >useState(undefined);</span>
|
|
325
453
|
const componentId = <span class="cstat-no" title="statement not covered" >useRef((props.idPrefix ? props.idPrefix : "MlShareMapState-") + uuidv4());</span>
|
|
454
|
+
const [isInitialState, setIsInitialState] = <span class="cstat-no" title="statement not covered" >useState(true);</span>
|
|
455
|
+
const mapState = <span class="cstat-no" title="statement not covered" >useMapState({</span>
|
|
456
|
+
watch: {
|
|
457
|
+
viewport: false,
|
|
458
|
+
layers: true,
|
|
459
|
+
sources: false
|
|
460
|
+
},
|
|
461
|
+
filter: {
|
|
462
|
+
includeBaseLayers: false
|
|
463
|
+
}
|
|
464
|
+
})
|
|
326
465
|
|
|
327
466
|
const mapStateRef = <span class="cstat-no" title="statement not covered" >useRef({});</span>
|
|
328
467
|
|
|
@@ -352,32 +491,59 @@ const MlShareMapState = <span class="cstat-no" title="statement not covered" ><s
|
|
|
352
491
|
<span class="cstat-no" title="statement not covered" > mapRef.current = mapContext.getMap(props.mapId);</span>
|
|
353
492
|
<span class="cstat-no" title="statement not covered" > setMap(mapRef.current);</span>
|
|
354
493
|
|
|
355
|
-
|
|
494
|
+
const currentUrlParams = <span class="cstat-no" title="statement not covered" >getCurrentUrlParameters();</span>
|
|
356
495
|
<span class="cstat-no" title="statement not covered" > if (currentUrlParams.lat && currentUrlParams.lng) {</span>
|
|
357
496
|
<span class="cstat-no" title="statement not covered" > mapStateRef.current.lat = currentUrlParams.lat;</span>
|
|
358
497
|
<span class="cstat-no" title="statement not covered" > mapStateRef.current.lng = currentUrlParams.lng;</span>
|
|
359
498
|
<span class="cstat-no" title="statement not covered" > mapStateRef.current.zoom = currentUrlParams.zoom;</span>
|
|
360
|
-
<span class="cstat-no" title="statement not covered" > mapRef.current.setCenter([mapStateRef.current.lng, mapStateRef.current.lat]);</span>
|
|
361
499
|
<span class="cstat-no" title="statement not covered" > mapRef.current.setZoom(mapStateRef.current.zoom);</span>
|
|
362
500
|
}
|
|
363
501
|
}, [mapContext.mapIds, mapContext, props.mapId, props.active]);
|
|
364
502
|
|
|
365
503
|
<span class="cstat-no" title="statement not covered" > useEffect(<span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
366
504
|
<span class="cstat-no" title="statement not covered" > if (!map) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
505
|
+
<span class="cstat-no" title="statement not covered" > if(!mapState.layers) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
506
|
+
<span class="cstat-no" title="statement not covered" > if(!isInitialState) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
507
|
+
|
|
508
|
+
const currentUrlParams = <span class="cstat-no" title="statement not covered" >getCurrentUrlParameters()</span>
|
|
509
|
+
|
|
510
|
+
<span class="cstat-no" title="statement not covered" > if(currentUrlParams.layers) {</span>
|
|
511
|
+
<span class="cstat-no" title="statement not covered" > for (let x in currentUrlParams.layers) {</span>
|
|
512
|
+
<span class="cstat-no" title="statement not covered" > mapRef.current.getLayer(currentUrlParams.layers[x].id).visibility = currentUrlParams.layers[x].visible ? "visible" : "none"</span>
|
|
513
|
+
<span class="cstat-no" title="statement not covered" > mapRef.current.getLayer(currentUrlParams.layers[x].id).type = currentUrlParams.layers[x].type</span>
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
}, [mapState.layers, props.mapId, props.active])
|
|
518
|
+
|
|
519
|
+
<span class="cstat-no" title="statement not covered" > useEffect(<span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
520
|
+
<span class="cstat-no" title="statement not covered" > if (!map) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
521
|
+
<span class="cstat-no" title="statement not covered" > if (!mapState.layers) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
367
522
|
|
|
368
523
|
<span class="cstat-no" title="statement not covered" > if (props.active) {</span>
|
|
524
|
+
<span class="cstat-no" title="statement not covered" > setIsInitialState(false)</span>
|
|
369
525
|
<span class="cstat-no" title="statement not covered" > map.on(</span>
|
|
370
526
|
"moveend",
|
|
371
527
|
<span class="fstat-no" title="function not covered" > ()</span> => {
|
|
528
|
+
let mapLayers = <span class="cstat-no" title="statement not covered" >[]</span>
|
|
529
|
+
<span class="cstat-no" title="statement not covered" > for (let x in mapState.layers) {</span>
|
|
530
|
+
<span class="cstat-no" title="statement not covered" > mapLayers.push(new URLSearchParams({</span>
|
|
531
|
+
id: mapState.layers[x].id,
|
|
532
|
+
type: mapState.layers[x].type,
|
|
533
|
+
visible: mapState.layers[x].visible
|
|
534
|
+
}))
|
|
535
|
+
}
|
|
372
536
|
<span class="cstat-no" title="statement not covered" > refreshMapState();</span>
|
|
373
537
|
let urlParams = <span class="cstat-no" title="statement not covered" >new URLSearchParams({</span>
|
|
374
538
|
...getCurrentUrlParameters(),
|
|
375
539
|
...mapStateRef.current,
|
|
540
|
+
layers : mapLayers
|
|
376
541
|
});
|
|
542
|
+
|
|
377
543
|
let currentParams = <span class="cstat-no" title="statement not covered" >new URLSearchParams(window.location.search);</span>
|
|
378
544
|
<span class="cstat-no" title="statement not covered" > if (urlParams.toString() !== currentParams.toString()) {</span>
|
|
379
545
|
<span class="cstat-no" title="statement not covered" > window.history.pushState(</span>
|
|
380
|
-
{
|
|
546
|
+
{...mapStateRef.current},
|
|
381
547
|
document.title,
|
|
382
548
|
"?" + urlParams.toString()
|
|
383
549
|
);
|
|
@@ -391,7 +557,33 @@ const MlShareMapState = <span class="cstat-no" title="statement not covered" ><s
|
|
|
391
557
|
}, [props.active, map]);
|
|
392
558
|
|
|
393
559
|
const getCurrentUrlParameters = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
394
|
-
<span class="cstat-no" title="statement not covered" >
|
|
560
|
+
let parameterObject = <span class="cstat-no" title="statement not covered" >Object.fromEntries(new URLSearchParams(window.location.search))</span>
|
|
561
|
+
|
|
562
|
+
<span class="cstat-no" title="statement not covered" > if(window.location.search.indexOf("layers")!==-1) {</span>
|
|
563
|
+
let layerParamString = <span class="cstat-no" title="statement not covered" >window.location.search.substring(window.location.search.indexOf("layers"))</span>
|
|
564
|
+
<span class="cstat-no" title="statement not covered" > layerParamString = layerParamString.substring(0, (layerParamString.indexOf("&")!==-1) ? layerParamString.indexOf("&") : layerParamString.length)</span>
|
|
565
|
+
<span class="cstat-no" title="statement not covered" > parameterObject = Object.fromEntries(new URLSearchParams(window.location.search.replace(layerParamString, "")))</span>
|
|
566
|
+
let layerParams = <span class="cstat-no" title="statement not covered" >layerParamString.substring(7)</span>
|
|
567
|
+
<span class="cstat-no" title="statement not covered" > layerParams = layerParams.replaceAll("%3D", "=")</span>
|
|
568
|
+
<span class="cstat-no" title="statement not covered" > layerParams = layerParams.replaceAll("%26", "&")</span>
|
|
569
|
+
<span class="cstat-no" title="statement not covered" > layerParams = layerParams.replaceAll("%2C", ",")</span>
|
|
570
|
+
|
|
571
|
+
<span class="cstat-no" title="statement not covered" > if (layerParams.indexOf(",")) {</span>
|
|
572
|
+
<span class="cstat-no" title="statement not covered" > layerParams = layerParams.split(",")</span>
|
|
573
|
+
} else {
|
|
574
|
+
<span class="cstat-no" title="statement not covered" > layerParams = [layerParams]</span>
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
<span class="cstat-no" title="statement not covered" > for (let x in layerParams) {</span>
|
|
578
|
+
let layerState = <span class="cstat-no" title="statement not covered" >layerParams[x].split("&")</span>
|
|
579
|
+
<span class="cstat-no" title="statement not covered" > layerParams[x] = {}</span>
|
|
580
|
+
<span class="cstat-no" title="statement not covered" > for (let y in layerState) {</span>
|
|
581
|
+
<span class="cstat-no" title="statement not covered" > layerParams[x][layerState[y].split("=")[0]] = layerState[y].split("=")[1]</span>
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
<span class="cstat-no" title="statement not covered" > parameterObject["layers"] = layerParams</span>
|
|
585
|
+
}
|
|
586
|
+
<span class="cstat-no" title="statement not covered" > return parameterObject</span>
|
|
395
587
|
};
|
|
396
588
|
|
|
397
589
|
const refreshMapState = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
@@ -402,7 +594,7 @@ const MlShareMapState = <span class="cstat-no" title="statement not covered" ><s
|
|
|
402
594
|
|
|
403
595
|
<span class="cstat-no" title="statement not covered" > window.onpopstate = <span class="fstat-no" title="function not covered" >(e</span>vent) => {</span>
|
|
404
596
|
<span class="cstat-no" title="statement not covered" > if (event.state && event.state.lng && event.state.lat && event.state.zoom) {</span>
|
|
405
|
-
<span class="cstat-no" title="statement not covered" > mapRef.current.easeTo({
|
|
597
|
+
<span class="cstat-no" title="statement not covered" > mapRef.current.easeTo({zoom: event.state.zoom, center: [event.state.lng, event.state.lat]});</span>
|
|
406
598
|
}
|
|
407
599
|
};
|
|
408
600
|
|
|
@@ -426,10 +618,9 @@ export default MlShareMapState;
|
|
|
426
618
|
</div><!-- /wrapper -->
|
|
427
619
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
428
620
|
Code coverage generated by
|
|
429
|
-
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
430
|
-
at
|
|
621
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
622
|
+
at Sun Jan 09 2022 17:13:08 GMT+0000 (Coordinated Universal Time)
|
|
431
623
|
</div>
|
|
432
|
-
</div>
|
|
433
624
|
<script src="../../../prettify.js"></script>
|
|
434
625
|
<script>
|
|
435
626
|
window.onload = function () {
|