@mapcomponents/react-maplibre 0.1.11 → 0.1.15
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 +10 -5
- package/coverage/clover.xml +894 -747
- package/coverage/coverage-final.json +22 -17
- package/coverage/lcov-report/block-navigation.js +8 -0
- package/coverage/lcov-report/index.html +188 -122
- package/coverage/lcov-report/sorter.js +26 -0
- package/coverage/lcov-report/{components → src/components}/MapLibreMap/MapLibreMap.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MapLibreMap/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlCreatePdfButton/MlCreatePdfButton.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlCreatePdfButton/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlFeatureEditor/MlFeatureEditor.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlFeatureEditor/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlFillExtrusionLayer/MlFillExtrusionLayer.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlFillExtrusionLayer/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlFollowGps/MlFollowGps.js.html +84 -69
- package/coverage/lcov-report/{components → src/components}/MlFollowGps/index.html +27 -21
- package/coverage/lcov-report/{components → src/components}/MlGPXViewer/MlGPXViewer.js.html +73 -61
- package/coverage/lcov-report/{components → src/components}/MlGPXViewer/gpxConverter.js.html +56 -71
- package/coverage/lcov-report/{components → src/components}/MlGPXViewer/index.html +32 -26
- package/coverage/lcov-report/{components → src/components}/MlGeoJsonLayer/MlGeoJsonLayer.js.html +162 -48
- package/coverage/lcov-report/{components → src/components}/MlGeoJsonLayer/index.html +35 -29
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.js.html +311 -0
- package/coverage/lcov-report/{components → src/components}/MlImageMarkerLayer/index.html +35 -29
- package/coverage/lcov-report/{components/MlImageMarkerLayer/MlImageMarkerLayer.js.html → src/components/MlLayer/MlLayer.js.html} +123 -126
- package/coverage/lcov-report/src/components/MlLayer/index.html +117 -0
- package/coverage/lcov-report/{components → src/components}/MlLayerMagnify/MlLayerMagnify.js.html +48 -42
- package/coverage/lcov-report/{components → src/components}/MlLayerMagnify/index.html +31 -25
- package/coverage/lcov-report/{components → src/components}/MlLayerSwipe/MlLayerSwipe.js.html +45 -42
- package/coverage/lcov-report/{components → src/components}/MlLayerSwipe/index.html +31 -25
- package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +755 -0
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +380 -0
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +117 -0
- package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +117 -0
- package/coverage/lcov-report/{components → src/components}/MlMarker/MlMarker.js.html +18 -12
- package/coverage/lcov-report/{components → src/components}/MlMarker/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlNavigationCompass/MlNavigationCompass.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlNavigationCompass/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlNavigationTools/MlNavigationTools.js.html +57 -42
- package/coverage/lcov-report/{components → src/components}/MlNavigationTools/index.html +25 -19
- package/coverage/lcov-report/{components → src/components}/MlOsmLayer/MlOsmLayer.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlOsmLayer/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlScaleReference/MlScaleReference.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlScaleReference/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlShareMapState/MlShareMapState.js.html +224 -26
- package/coverage/lcov-report/{components → src/components}/MlShareMapState/index.html +25 -19
- package/coverage/lcov-report/{components → src/components}/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlSpatialElevationProfile/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlThreeJsLayer/MlThreeJsLayer.js.html +37 -55
- package/coverage/lcov-report/{components → src/components}/MlThreeJsLayer/index.html +31 -25
- package/coverage/lcov-report/{components → src/components}/MlUseMapDebugger/MlUseMapDebugger.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlUseMapDebugger/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlVectorTileLayer/MlVectorTileLayer.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlVectorTileLayer/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlWmsFeatureInfoPopup/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlWmsLayer/MlWmsLayer.js.html +20 -14
- package/coverage/lcov-report/{components → src/components}/MlWmsLayer/index.html +21 -15
- package/coverage/lcov-report/{components → src/components}/MlWmsLoader/MlWmsLoader.js.html +38 -20
- package/coverage/lcov-report/{components → src/components}/MlWmsLoader/index.html +23 -17
- package/coverage/lcov-report/src/hooks/index.html +147 -0
- package/coverage/lcov-report/{components/MlLayer/MlLayer.js.html → src/hooks/useMap.js.html} +86 -119
- package/coverage/lcov-report/{hooks → src/hooks}/useMapState.js.html +98 -92
- package/coverage/lcov-report/{hooks → src/hooks}/useWms.js.html +25 -19
- package/coverage/lcov-report/src/i18n.js.html +167 -0
- package/coverage/lcov-report/src/index.html +117 -0
- package/coverage/lcov-report/src/translations/english.js.html +95 -0
- package/coverage/lcov-report/src/translations/german.js.html +95 -0
- package/coverage/lcov-report/src/translations/index.html +132 -0
- package/coverage/lcov.info +1620 -1306
- package/dist/b556faa3bc6829d2.png +0 -0
- package/dist/index.esm.js +976 -688
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -1
- package/public/assets/dop.png +0 -0
- package/public/assets/historic.png +0 -0
- package/public/assets/osm.png +0 -0
- package/public/thumbnails/MlFollowGps.png +0 -0
- package/public/thumbnails/MlThreeJsLayer.png +0 -0
- package/rollup.config.js +7 -1
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.js +53 -67
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.meta.json +1 -1
- package/src/components/MlFeatureEditor/MlFeatureEditor.meta.json +2 -2
- package/src/components/MlFollowGps/MlFollowGps.js +49 -46
- package/src/components/MlFollowGps/MlFollowGps.meta.json +2 -2
- package/src/components/MlFollowGps/assets/marker.png +0 -0
- package/src/components/MlGPXViewer/MlGPXViewer.js +45 -43
- package/src/components/MlGPXViewer/gpxConverter.js +22 -29
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.js +45 -9
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.meta.json +1 -1
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.js +21 -57
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.test.js +6 -7
- package/src/components/MlLayer/MlLayer.js +28 -6
- package/src/components/MlLayer/MlLayer.test.js +12 -10
- package/src/components/MlLayerMagnify/MlLayerMagnify.js +3 -3
- package/src/components/MlLayerSwipe/MlLayerSwipe.js +4 -5
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.css +17 -0
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.doc.de.md +3 -0
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.js +223 -0
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.meta_.json +15 -0
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.stories.js +106 -0
- package/src/components/MlLayerSwitcher/assets/sample_1.json +26 -0
- package/src/components/MlLayerSwitcher/assets/sample_2.json +22 -0
- package/src/components/MlLayerSwitcher/components/LayerBox.js +98 -0
- package/src/components/MlMarker/MlMarker.js +1 -1
- package/src/components/MlNavigationTools/MlNavigationTools.js +29 -26
- package/src/components/MlScaleReference/MlScaleReference.meta.json +1 -1
- package/src/components/MlScaleReference/MlScaleReference.stories.js +25 -21
- package/src/components/MlShareMapState/MlShareMapState.js +73 -9
- package/src/components/MlShareMapState/MlShareMapState.stories.js +24 -1
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.js +12 -6
- package/src/components/MlThreeJsLayer/MlThreeJsLayer.js +8 -15
- package/src/components/MlVectorTileLayer/MlVectorTileLayer.meta.json +3 -3
- package/src/components/MlWmsLayer/MlWmsLayer.js +1 -1
- package/src/components/MlWmsLoader/MlWmsLoader.js +8 -4
- package/src/components/MlWmsLoader/MlWmsLoader.meta.json +1 -1
- package/src/components/MlWmsLoader/MlWmsLoader.stories.js +5 -4
- package/src/decorators/EmptyMapContextDecorator.js +11 -6
- package/src/decorators/MapContext3DDecorator.js +25 -20
- package/src/decorators/MapContextDashboardDecorator.js +7 -2
- package/src/decorators/MapContextDecorator.js +7 -3
- package/src/decorators/MapContextKlokantechBasicDecorator.js +8 -4
- package/src/decorators/MultiMapContextDecorator.js +2 -1
- package/src/hooks/useMap.js +36 -62
- package/src/hooks/useMapState.js +3 -3
- package/src/hooks/useWms.js +7 -6
- package/src/i18n.js +28 -0
- package/src/index.js +3 -0
- package/src/translations/english.js +4 -0
- package/src/translations/german.js +4 -0
- package/src/ui_components/ImageLoader.js +73 -0
- package/src/ui_components/Sidebar.js +76 -22
- package/src/ui_components/TopToolbar.js +18 -18
- package/coverage/lcov-report/components/MlLayer/index.html +0 -111
- package/coverage/lcov-report/hooks/index.html +0 -141
- package/coverage/lcov-report/hooks/useMap.js.html +0 -377
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
<html lang="en">
|
|
4
4
|
|
|
5
5
|
<head>
|
|
6
|
-
<title>Code coverage report for components/MlWmsLoader</title>
|
|
6
|
+
<title>Code coverage report for src/components/MlWmsLoader</title>
|
|
7
7
|
<meta charset="utf-8" />
|
|
8
|
-
<link rel="stylesheet" href="
|
|
9
|
-
<link rel="stylesheet" href="
|
|
10
|
-
<link rel="shortcut icon" type="image/x-icon" href="
|
|
8
|
+
<link rel="stylesheet" href="../../../prettify.css" />
|
|
9
|
+
<link rel="stylesheet" href="../../../base.css" />
|
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="../../../favicon.png" />
|
|
11
11
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
12
|
<style type='text/css'>
|
|
13
13
|
.coverage-summary .sorter {
|
|
14
|
-
background-image: url(
|
|
14
|
+
background-image: url(../../../sort-arrow-sprite.png);
|
|
15
15
|
}
|
|
16
16
|
</style>
|
|
17
17
|
</head>
|
|
@@ -19,20 +19,20 @@
|
|
|
19
19
|
<body>
|
|
20
20
|
<div class='wrapper'>
|
|
21
21
|
<div class='pad1'>
|
|
22
|
-
<h1><a href="
|
|
22
|
+
<h1><a href="../../../index.html">All files</a> src/components/MlWmsLoader</h1>
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
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/96</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/55</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -46,7 +46,7 @@
|
|
|
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/92</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line low'></div>
|
|
59
65
|
<div class="pad1">
|
|
@@ -78,13 +84,13 @@
|
|
|
78
84
|
<div class="chart"><div class="cover-fill" style="width: 0%"></div><div class="cover-empty" style="width: 100%"></div></div>
|
|
79
85
|
</td>
|
|
80
86
|
<td data-value="0" class="pct low">0%</td>
|
|
81
|
-
<td data-value="
|
|
87
|
+
<td data-value="96" class="abs low">0/96</td>
|
|
82
88
|
<td data-value="0" class="pct low">0%</td>
|
|
83
|
-
<td data-value="
|
|
89
|
+
<td data-value="55" class="abs low">0/55</td>
|
|
84
90
|
<td data-value="0" class="pct low">0%</td>
|
|
85
91
|
<td data-value="22" class="abs low">0/22</td>
|
|
86
92
|
<td data-value="0" class="pct low">0%</td>
|
|
87
|
-
<td data-value="
|
|
93
|
+
<td data-value="92" class="abs low">0/92</td>
|
|
88
94
|
</tr>
|
|
89
95
|
|
|
90
96
|
</tbody>
|
|
@@ -94,18 +100,18 @@
|
|
|
94
100
|
</div><!-- /wrapper -->
|
|
95
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
96
102
|
Code coverage generated by
|
|
97
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
98
|
-
at
|
|
103
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
104
|
+
at Tue Dec 21 2021 11:51:22 GMT+0000 (Coordinated Universal Time)
|
|
99
105
|
</div>
|
|
100
106
|
</div>
|
|
101
|
-
<script src="
|
|
107
|
+
<script src="../../../prettify.js"></script>
|
|
102
108
|
<script>
|
|
103
109
|
window.onload = function () {
|
|
104
110
|
prettyPrint();
|
|
105
111
|
};
|
|
106
112
|
</script>
|
|
107
|
-
<script src="
|
|
108
|
-
<script src="
|
|
113
|
+
<script src="../../../sorter.js"></script>
|
|
114
|
+
<script src="../../../block-navigation.js"></script>
|
|
109
115
|
</body>
|
|
110
116
|
</html>
|
|
111
117
|
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<title>Code coverage report for src/hooks</title>
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<link rel="stylesheet" href="../../prettify.css" />
|
|
9
|
+
<link rel="stylesheet" href="../../base.css" />
|
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
+
<style type='text/css'>
|
|
13
|
+
.coverage-summary .sorter {
|
|
14
|
+
background-image: url(../../sort-arrow-sprite.png);
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<div class='wrapper'>
|
|
21
|
+
<div class='pad1'>
|
|
22
|
+
<h1><a href="../../index.html">All files</a> src/hooks</h1>
|
|
23
|
+
<div class='clearfix'>
|
|
24
|
+
|
|
25
|
+
<div class='fl pad1y space-right2'>
|
|
26
|
+
<span class="strong">50.42% </span>
|
|
27
|
+
<span class="quiet">Statements</span>
|
|
28
|
+
<span class='fraction'>59/117</span>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<div class='fl pad1y space-right2'>
|
|
33
|
+
<span class="strong">33.33% </span>
|
|
34
|
+
<span class="quiet">Branches</span>
|
|
35
|
+
<span class='fraction'>14/42</span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<div class='fl pad1y space-right2'>
|
|
40
|
+
<span class="strong">47.36% </span>
|
|
41
|
+
<span class="quiet">Functions</span>
|
|
42
|
+
<span class='fraction'>9/19</span>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<div class='fl pad1y space-right2'>
|
|
47
|
+
<span class="strong">50.44% </span>
|
|
48
|
+
<span class="quiet">Lines</span>
|
|
49
|
+
<span class='fraction'>57/113</span>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
<p class="quiet">
|
|
55
|
+
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
+
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
</div>
|
|
64
|
+
<div class='status-line medium'></div>
|
|
65
|
+
<div class="pad1">
|
|
66
|
+
<table class="coverage-summary">
|
|
67
|
+
<thead>
|
|
68
|
+
<tr>
|
|
69
|
+
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
|
70
|
+
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
|
71
|
+
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
|
72
|
+
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
73
|
+
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
|
74
|
+
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
75
|
+
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
|
76
|
+
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
77
|
+
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
|
78
|
+
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
79
|
+
</tr>
|
|
80
|
+
</thead>
|
|
81
|
+
<tbody><tr>
|
|
82
|
+
<td class="file medium" data-value="useMap.js"><a href="useMap.js.html">useMap.js</a></td>
|
|
83
|
+
<td data-value="77.41" class="pic medium">
|
|
84
|
+
<div class="chart"><div class="cover-fill" style="width: 77%"></div><div class="cover-empty" style="width: 23%"></div></div>
|
|
85
|
+
</td>
|
|
86
|
+
<td data-value="77.41" class="pct medium">77.41%</td>
|
|
87
|
+
<td data-value="31" class="abs medium">24/31</td>
|
|
88
|
+
<td data-value="50" class="pct medium">50%</td>
|
|
89
|
+
<td data-value="12" class="abs medium">6/12</td>
|
|
90
|
+
<td data-value="80" class="pct high">80%</td>
|
|
91
|
+
<td data-value="5" class="abs high">4/5</td>
|
|
92
|
+
<td data-value="76.66" class="pct medium">76.66%</td>
|
|
93
|
+
<td data-value="30" class="abs medium">23/30</td>
|
|
94
|
+
</tr>
|
|
95
|
+
|
|
96
|
+
<tr>
|
|
97
|
+
<td class="file medium" data-value="useMapState.js"><a href="useMapState.js.html">useMapState.js</a></td>
|
|
98
|
+
<td data-value="74.46" class="pic medium">
|
|
99
|
+
<div class="chart"><div class="cover-fill" style="width: 74%"></div><div class="cover-empty" style="width: 26%"></div></div>
|
|
100
|
+
</td>
|
|
101
|
+
<td data-value="74.46" class="pct medium">74.46%</td>
|
|
102
|
+
<td data-value="47" class="abs medium">35/47</td>
|
|
103
|
+
<td data-value="36.36" class="pct low">36.36%</td>
|
|
104
|
+
<td data-value="22" class="abs low">8/22</td>
|
|
105
|
+
<td data-value="71.42" class="pct medium">71.42%</td>
|
|
106
|
+
<td data-value="7" class="abs medium">5/7</td>
|
|
107
|
+
<td data-value="73.91" class="pct medium">73.91%</td>
|
|
108
|
+
<td data-value="46" class="abs medium">34/46</td>
|
|
109
|
+
</tr>
|
|
110
|
+
|
|
111
|
+
<tr>
|
|
112
|
+
<td class="file low" data-value="useWms.js"><a href="useWms.js.html">useWms.js</a></td>
|
|
113
|
+
<td data-value="0" class="pic low">
|
|
114
|
+
<div class="chart"><div class="cover-fill" style="width: 0%"></div><div class="cover-empty" style="width: 100%"></div></div>
|
|
115
|
+
</td>
|
|
116
|
+
<td data-value="0" class="pct low">0%</td>
|
|
117
|
+
<td data-value="39" class="abs low">0/39</td>
|
|
118
|
+
<td data-value="0" class="pct low">0%</td>
|
|
119
|
+
<td data-value="8" class="abs low">0/8</td>
|
|
120
|
+
<td data-value="0" class="pct low">0%</td>
|
|
121
|
+
<td data-value="7" class="abs low">0/7</td>
|
|
122
|
+
<td data-value="0" class="pct low">0%</td>
|
|
123
|
+
<td data-value="37" class="abs low">0/37</td>
|
|
124
|
+
</tr>
|
|
125
|
+
|
|
126
|
+
</tbody>
|
|
127
|
+
</table>
|
|
128
|
+
</div>
|
|
129
|
+
<div class='push'></div><!-- for sticky footer -->
|
|
130
|
+
</div><!-- /wrapper -->
|
|
131
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
132
|
+
Code coverage generated by
|
|
133
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
134
|
+
at Tue Dec 21 2021 11:51:22 GMT+0000 (Coordinated Universal Time)
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
<script src="../../prettify.js"></script>
|
|
138
|
+
<script>
|
|
139
|
+
window.onload = function () {
|
|
140
|
+
prettyPrint();
|
|
141
|
+
};
|
|
142
|
+
</script>
|
|
143
|
+
<script src="../../sorter.js"></script>
|
|
144
|
+
<script src="../../block-navigation.js"></script>
|
|
145
|
+
</body>
|
|
146
|
+
</html>
|
|
147
|
+
|
package/coverage/lcov-report/{components/MlLayer/MlLayer.js.html → src/hooks/useMap.js.html}
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<html lang="en">
|
|
4
4
|
|
|
5
5
|
<head>
|
|
6
|
-
<title>Code coverage report for
|
|
6
|
+
<title>Code coverage report for src/hooks/useMap.js</title>
|
|
7
7
|
<meta charset="utf-8" />
|
|
8
8
|
<link rel="stylesheet" href="../../prettify.css" />
|
|
9
9
|
<link rel="stylesheet" href="../../base.css" />
|
|
@@ -19,34 +19,34 @@
|
|
|
19
19
|
<body>
|
|
20
20
|
<div class='wrapper'>
|
|
21
21
|
<div class='pad1'>
|
|
22
|
-
<h1><a href="../../index.html">All files</a> / <a href="index.html">
|
|
22
|
+
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/hooks</a> useMap.js</h1>
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">77.41% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>24/31</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">50% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>6/12</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">80% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>4/5</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">76.66% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>23/30</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -54,8 +54,14 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line medium'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
60
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
61
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -130,35 +136,29 @@
|
|
|
130
136
|
<a name='L71'></a><a href='#L71'>71</a>
|
|
131
137
|
<a name='L72'></a><a href='#L72'>72</a>
|
|
132
138
|
<a name='L73'></a><a href='#L73'>73</a>
|
|
133
|
-
<a name='L74'></a><a href='#L74'>74</a>
|
|
134
|
-
<
|
|
135
|
-
<a name='L76'></a><a href='#L76'>76</a>
|
|
136
|
-
<a name='L77'></a><a href='#L77'>77</a>
|
|
137
|
-
<a name='L78'></a><a href='#L78'>78</a>
|
|
138
|
-
<a name='L79'></a><a href='#L79'>79</a>
|
|
139
|
-
<a name='L80'></a><a href='#L80'>80</a>
|
|
140
|
-
<a name='L81'></a><a href='#L81'>81</a>
|
|
141
|
-
<a name='L82'></a><a href='#L82'>82</a>
|
|
142
|
-
<a name='L83'></a><a href='#L83'>83</a>
|
|
143
|
-
<a name='L84'></a><a href='#L84'>84</a>
|
|
144
|
-
<a name='L85'></a><a href='#L85'>85</a>
|
|
145
|
-
<a name='L86'></a><a href='#L86'>86</a>
|
|
146
|
-
<a name='L87'></a><a href='#L87'>87</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
139
|
+
<a name='L74'></a><a href='#L74'>74</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
140
|
+
<span class="cline-any cline-neutral"> </span>
|
|
147
141
|
<span class="cline-any cline-neutral"> </span>
|
|
148
142
|
<span class="cline-any cline-neutral"> </span>
|
|
149
143
|
<span class="cline-any cline-neutral"> </span>
|
|
150
144
|
<span class="cline-any cline-neutral"> </span>
|
|
151
|
-
<span class="cline-any cline-yes">1x</span>
|
|
152
145
|
<span class="cline-any cline-neutral"> </span>
|
|
153
146
|
<span class="cline-any cline-yes">12x</span>
|
|
147
|
+
<span class="cline-any cline-neutral"> </span>
|
|
154
148
|
<span class="cline-any cline-yes">12x</span>
|
|
155
|
-
<span class="cline-any cline-
|
|
156
|
-
<span class="cline-any cline-
|
|
149
|
+
<span class="cline-any cline-neutral"> </span>
|
|
150
|
+
<span class="cline-any cline-neutral"> </span>
|
|
151
|
+
<span class="cline-any cline-neutral"> </span>
|
|
152
|
+
<span class="cline-any cline-neutral"> </span>
|
|
153
|
+
<span class="cline-any cline-neutral"> </span>
|
|
154
|
+
<span class="cline-any cline-neutral"> </span>
|
|
157
155
|
<span class="cline-any cline-neutral"> </span>
|
|
158
156
|
<span class="cline-any cline-neutral"> </span>
|
|
159
157
|
<span class="cline-any cline-yes">12x</span>
|
|
160
158
|
<span class="cline-any cline-yes">12x</span>
|
|
159
|
+
<span class="cline-any cline-neutral"> </span>
|
|
161
160
|
<span class="cline-any cline-yes">12x</span>
|
|
161
|
+
<span class="cline-any cline-neutral"> </span>
|
|
162
162
|
<span class="cline-any cline-yes">12x</span>
|
|
163
163
|
<span class="cline-any cline-neutral"> </span>
|
|
164
164
|
<span class="cline-any cline-yes">12x</span>
|
|
@@ -169,83 +169,70 @@
|
|
|
169
169
|
<span class="cline-any cline-yes">2x</span>
|
|
170
170
|
<span class="cline-any cline-yes">2x</span>
|
|
171
171
|
<span class="cline-any cline-neutral"> </span>
|
|
172
|
+
<span class="cline-any cline-yes">2x</span>
|
|
173
|
+
<span class="cline-any cline-yes">2x</span>
|
|
172
174
|
<span class="cline-any cline-neutral"> </span>
|
|
173
175
|
<span class="cline-any cline-neutral"> </span>
|
|
174
176
|
<span class="cline-any cline-neutral"> </span>
|
|
175
177
|
<span class="cline-any cline-yes">12x</span>
|
|
176
178
|
<span class="cline-any cline-yes">12x</span>
|
|
177
179
|
<span class="cline-any cline-neutral"> </span>
|
|
178
|
-
<span class="cline-any cline-neutral"> </span>
|
|
179
|
-
<span class="cline-any cline-neutral"> </span>
|
|
180
|
-
<span class="cline-any cline-neutral"> </span>
|
|
181
|
-
<span class="cline-any cline-neutral"> </span>
|
|
182
|
-
<span class="cline-any cline-yes">8x</span>
|
|
183
|
-
<span class="cline-any cline-neutral"> </span>
|
|
184
|
-
<span class="cline-any cline-neutral"> </span>
|
|
185
|
-
<span class="cline-any cline-neutral"> </span>
|
|
186
|
-
<span class="cline-any cline-neutral"> </span>
|
|
187
180
|
<span class="cline-any cline-yes">4x</span>
|
|
181
|
+
<span class="cline-any cline-neutral"> </span>
|
|
188
182
|
<span class="cline-any cline-yes">4x</span>
|
|
189
183
|
<span class="cline-any cline-no"> </span>
|
|
190
|
-
<span class="cline-any cline-no"> </span>
|
|
191
184
|
<span class="cline-any cline-neutral"> </span>
|
|
192
185
|
<span class="cline-any cline-no"> </span>
|
|
193
|
-
<span class="cline-any cline-
|
|
194
|
-
<span class="cline-any cline-neutral"> </span>
|
|
195
|
-
<span class="cline-any cline-yes">4x</span>
|
|
196
|
-
<span class="cline-any cline-yes">4x</span>
|
|
186
|
+
<span class="cline-any cline-no"> </span>
|
|
197
187
|
<span class="cline-any cline-no"> </span>
|
|
198
188
|
<span class="cline-any cline-no"> </span>
|
|
199
189
|
<span class="cline-any cline-neutral"> </span>
|
|
200
190
|
<span class="cline-any cline-neutral"> </span>
|
|
191
|
+
<span class="cline-any cline-no"> </span>
|
|
192
|
+
<span class="cline-any cline-no"> </span>
|
|
201
193
|
<span class="cline-any cline-neutral"> </span>
|
|
202
194
|
<span class="cline-any cline-neutral"> </span>
|
|
203
|
-
<span class="cline-any cline-yes">
|
|
204
|
-
<span class="cline-any cline-yes">12x</span>
|
|
205
|
-
<span class="cline-any cline-neutral"> </span>
|
|
195
|
+
<span class="cline-any cline-yes">4x</span>
|
|
206
196
|
<span class="cline-any cline-neutral"> </span>
|
|
207
197
|
<span class="cline-any cline-neutral"> </span>
|
|
208
198
|
<span class="cline-any cline-yes">4x</span>
|
|
209
199
|
<span class="cline-any cline-yes">4x</span>
|
|
210
200
|
<span class="cline-any cline-yes">4x</span>
|
|
211
|
-
<span class="cline-any cline-yes">4x</span>
|
|
212
|
-
<span class="cline-any cline-neutral"> </span>
|
|
213
|
-
<span class="cline-any cline-neutral"> </span>
|
|
214
|
-
<span class="cline-any cline-neutral"> </span>
|
|
215
|
-
<span class="cline-any cline-neutral"> </span>
|
|
216
|
-
<span class="cline-any cline-neutral"> </span>
|
|
217
|
-
<span class="cline-any cline-neutral"> </span>
|
|
218
|
-
<span class="cline-any cline-neutral"> </span>
|
|
219
201
|
<span class="cline-any cline-neutral"> </span>
|
|
220
202
|
<span class="cline-any cline-neutral"> </span>
|
|
203
|
+
<span class="cline-any cline-yes">12x</span>
|
|
221
204
|
<span class="cline-any cline-neutral"> </span>
|
|
222
205
|
<span class="cline-any cline-neutral"> </span>
|
|
223
|
-
<span class="cline-any cline-yes">4x</span>
|
|
224
|
-
<span class="cline-any cline-yes">4x</span>
|
|
225
206
|
<span class="cline-any cline-neutral"> </span>
|
|
226
207
|
<span class="cline-any cline-neutral"> </span>
|
|
227
208
|
<span class="cline-any cline-neutral"> </span>
|
|
228
|
-
<span class="cline-any cline-yes">12x</span>
|
|
229
209
|
<span class="cline-any cline-neutral"> </span>
|
|
230
210
|
<span class="cline-any cline-neutral"> </span>
|
|
231
211
|
<span class="cline-any cline-neutral"> </span>
|
|
232
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import
|
|
233
|
-
|
|
212
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { useContext, useState, useEffect, useRef } from "react";
|
|
234
213
|
import { v4 as uuidv4 } from "uuid";
|
|
235
214
|
import { MapContext } from "@mapcomponents/react-core";
|
|
215
|
+
import useMapState from "./useMapState";
|
|
236
216
|
|
|
237
|
-
|
|
217
|
+
function useMap(props) {
|
|
238
218
|
// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks
|
|
239
219
|
const mapContext = useContext(MapContext);
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
220
|
+
|
|
221
|
+
const mapState = useMapState({
|
|
222
|
+
mapId: props.mapId,
|
|
223
|
+
watch: {
|
|
224
|
+
viewport: false,
|
|
225
|
+
layers: true,
|
|
226
|
+
sources: false,
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
const initializedRef = useRef(false);
|
|
231
|
+
const mapRef = useRef(undefined);
|
|
232
|
+
|
|
233
|
+
const componentId = useRef(uuidv4());
|
|
234
|
+
|
|
235
|
+
const [mapIsReady, setMapIsReady] = useState(undefined);
|
|
249
236
|
|
|
250
237
|
useEffect(() => {
|
|
251
238
|
let _componentId = componentId.current;
|
|
@@ -253,76 +240,56 @@ const MlLayer = (props) => {
|
|
|
253
240
|
return () => {
|
|
254
241
|
if (mapRef.current) {
|
|
255
242
|
mapRef.current.cleanup(_componentId);
|
|
256
|
-
mapRef.current =
|
|
243
|
+
mapRef.current = undefined;
|
|
257
244
|
}
|
|
245
|
+
initializedRef.current = false;
|
|
246
|
+
setMapIsReady(false);
|
|
258
247
|
};
|
|
259
248
|
}, []);
|
|
260
249
|
|
|
261
250
|
useEffect(() => {
|
|
262
|
-
if (
|
|
263
|
-
!mapContext.mapExists(props.mapId) ||
|
|
264
|
-
!mapContext.getMap(props.mapId)?.getLayer?.(layerId) ||
|
|
265
|
-
!layerInitializedRef.current ||
|
|
266
|
-
!props.options
|
|
267
|
-
)
|
|
268
|
-
return;
|
|
269
|
-
// the MapLibre-gl instance (mapContext.map) is accessible here
|
|
270
|
-
// initialize the layer and add it to the MapLibre-gl instance or do something else with it
|
|
271
|
-
var key;
|
|
251
|
+
if (!mapContext.mapExists(props.mapId) || initializedRef.current) return;
|
|
272
252
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
<span class="
|
|
276
|
-
<span class="cstat-no" title="statement not covered" >
|
|
277
|
-
}
|
|
278
|
-
<span class="cstat-no" title="statement not covered" > layerLayoutConfRef.current = layoutString;</span>
|
|
279
|
-
}
|
|
253
|
+
console.log("initialize useMap hook");
|
|
254
|
+
//check if insertBeforeLayer exists
|
|
255
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (props.waitForLayer) {
|
|
256
|
+
let layerFound = <span class="cstat-no" title="statement not covered" >false;</span>
|
|
280
257
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
<span class="cstat-no" title="statement not covered" >
|
|
284
|
-
<span class="cstat-no" title="statement not covered" >
|
|
258
|
+
<span class="cstat-no" title="statement not covered" > mapState?.layers?.forEach(<span class="fstat-no" title="function not covered" >(l</span>ayer) => {</span>
|
|
259
|
+
<span class="cstat-no" title="statement not covered" > console.log(layer.id + " " + props.waitForLayer);</span>
|
|
260
|
+
<span class="cstat-no" title="statement not covered" > if (layer.id === props.waitForLayer) {</span>
|
|
261
|
+
<span class="cstat-no" title="statement not covered" > layerFound = true;</span>
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
<span class="cstat-no" title="statement not covered" > if (!layerFound) {</span>
|
|
265
|
+
<span class="cstat-no" title="statement not covered" > return;</span>
|
|
285
266
|
}
|
|
286
267
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
useEffect(() => {
|
|
290
|
-
if (!mapContext.mapExists(props.mapId) || layerInitializedRef.current) return;
|
|
291
|
-
// the MapLibre-gl instance (mapContext.map) is accessible here
|
|
268
|
+
console.log("done initialize useMap hook");
|
|
269
|
+
// the MapLibre-gl instance (mapContext.getMap(props.mapId)) is accessible here
|
|
292
270
|
// initialize the layer and add it to the MapLibre-gl instance or do something else with it
|
|
293
|
-
|
|
271
|
+
initializedRef.current = true;
|
|
294
272
|
mapRef.current = mapContext.getMap(props.mapId);
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
mapRef.current.addLayer(
|
|
298
|
-
{
|
|
299
|
-
id: layerId,
|
|
300
|
-
type: "background",
|
|
301
|
-
paint: {
|
|
302
|
-
"background-color": "rgba(0,0,0,0)",
|
|
303
|
-
},
|
|
304
|
-
...props.options,
|
|
305
|
-
},
|
|
306
|
-
props.insertBeforeLayer,
|
|
307
|
-
componentId.current
|
|
308
|
-
);
|
|
309
|
-
layerPaintConfRef.current = JSON.stringify(props.options?.paint);
|
|
310
|
-
layerLayoutConfRef.current = JSON.stringify(props.options?.layout);
|
|
311
|
-
}
|
|
312
|
-
}, [mapContext.mapIds, mapContext, props, layerId]);
|
|
273
|
+
setMapIsReady(true);
|
|
274
|
+
}, [mapContext.mapIds, mapState.layers, mapContext, props.mapId]);
|
|
313
275
|
|
|
314
|
-
return
|
|
315
|
-
|
|
276
|
+
return {
|
|
277
|
+
map: mapRef.current,
|
|
278
|
+
mapIsReady,
|
|
279
|
+
componentId: componentId.current,
|
|
280
|
+
layers: mapState.layers,
|
|
281
|
+
};
|
|
282
|
+
}
|
|
316
283
|
|
|
317
|
-
export default
|
|
284
|
+
export default useMap;
|
|
318
285
|
</pre></td></tr></table></pre>
|
|
319
286
|
|
|
320
287
|
<div class='push'></div><!-- for sticky footer -->
|
|
321
288
|
</div><!-- /wrapper -->
|
|
322
289
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
323
290
|
Code coverage generated by
|
|
324
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
325
|
-
at
|
|
291
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
292
|
+
at Tue Dec 21 2021 11:51:22 GMT+0000 (Coordinated Universal Time)
|
|
326
293
|
</div>
|
|
327
294
|
</div>
|
|
328
295
|
<script src="../../prettify.js"></script>
|