@mapcomponents/react-maplibre 0.1.45 → 0.1.46
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 +9 -0
- package/coverage/clover.xml +206 -132
- package/coverage/coverage-final.json +7 -5
- package/coverage/lcov-report/index.html +86 -71
- package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +40 -10
- package/coverage/lcov-report/src/components/MapLibreMap/index.html +17 -17
- package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFollowGps/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGPXViewer/MlGPXViewer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +1 -1
- package/coverage/lcov-report/src/components/MlGPXViewer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +188 -53
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +21 -21
- package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +2 -2
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
- package/coverage/lcov-report/src/components/MlMarker/MlMarker.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
- package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +184 -0
- package/coverage/lcov-report/src/components/MlMeasureTool/index.html +116 -0
- package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationTools/index.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.js.html +232 -0
- package/coverage/lcov-report/src/components/MlOsmLayer/index.html +25 -10
- package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +1 -1
- package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
- package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +1 -1
- package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +1 -1
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
- package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
- package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx.html +74 -20
- package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +19 -19
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.tsx.html +80 -20
- package/coverage/lcov-report/src/components/MlWmsLayer/index.html +21 -21
- package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLoader/index.html +1 -1
- package/coverage/lcov-report/src/contexts/MapContext.tsx.html +1 -1
- package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
- package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
- package/coverage/lcov-report/src/contexts/index.html +1 -1
- package/coverage/lcov-report/src/hooks/index.html +19 -19
- package/coverage/lcov-report/src/hooks/useLayer.ts.html +46 -22
- package/coverage/lcov-report/src/hooks/useMap.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useMapState.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useWms.js.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.ts.html +9 -6
- package/coverage/lcov.info +422 -252
- package/dist/index.esm.js +127 -36
- package/dist/index.esm.js.map +1 -1
- package/docs-build/{0.b1b9b035.iframe.bundle.js → 0.0ee4f98c.iframe.bundle.js} +2 -2
- package/docs-build/0.0ee4f98c.iframe.bundle.js.map +1 -0
- package/docs-build/{1.c50fb367.iframe.bundle.js → 1.bb3cf738.iframe.bundle.js} +3 -3
- package/docs-build/1.bb3cf738.iframe.bundle.js.map +1 -0
- package/docs-build/{17.2e544968.iframe.bundle.js → 17.97db5b3f.iframe.bundle.js} +2 -2
- package/docs-build/17.97db5b3f.iframe.bundle.js.map +1 -0
- package/docs-build/{18.42087006.iframe.bundle.js → 18.f8d843df.iframe.bundle.js} +3 -3
- package/docs-build/18.f8d843df.iframe.bundle.js.map +1 -0
- package/docs-build/{19.7e782442.iframe.bundle.js → 19.c45e6b08.iframe.bundle.js} +2 -2
- package/docs-build/19.c45e6b08.iframe.bundle.js.map +1 -0
- package/docs-build/{2.e58dc625.iframe.bundle.js → 2.42c790e4.iframe.bundle.js} +2 -2
- package/docs-build/2.42c790e4.iframe.bundle.js.map +1 -0
- package/docs-build/{20.f009289a.iframe.bundle.js → 20.120bbcfb.iframe.bundle.js} +2 -2
- package/docs-build/20.120bbcfb.iframe.bundle.js.map +1 -0
- package/docs-build/{21.1cdc9040.iframe.bundle.js → 21.37c885f1.iframe.bundle.js} +2 -2
- package/docs-build/21.37c885f1.iframe.bundle.js.map +1 -0
- package/docs-build/{22.c9e6b2d7.iframe.bundle.js → 22.7fbc99f4.iframe.bundle.js} +2 -2
- package/docs-build/22.7fbc99f4.iframe.bundle.js.map +1 -0
- package/docs-build/{3.a8172b89.iframe.bundle.js → 3.1a37a83e.iframe.bundle.js} +2 -2
- package/docs-build/3.1a37a83e.iframe.bundle.js.map +1 -0
- package/docs-build/iframe.html +1 -1
- package/docs-build/main~24120820.905c51c8.iframe.bundle.js +2 -0
- package/docs-build/main~24120820.905c51c8.iframe.bundle.js.map +1 -0
- package/docs-build/thumbnails/MlMeasureTool.png +0 -0
- package/docs-build/{vendors~main~0ad7406a.2054ae7c.iframe.bundle.js → vendors~main~0ad7406a.93aea1be.iframe.bundle.js} +3 -3
- package/docs-build/vendors~main~0ad7406a.93aea1be.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~0f485567.6e7163ef.iframe.bundle.js +2 -0
- package/docs-build/vendors~main~0f485567.6e7163ef.iframe.bundle.js.map +1 -0
- package/docs-build/{vendors~main~41a6ab2c.a947ed53.iframe.bundle.js → vendors~main~41a6ab2c.da377733.iframe.bundle.js} +2 -2
- package/docs-build/vendors~main~41a6ab2c.da377733.iframe.bundle.js.map +1 -0
- package/docs-build/{vendors~main~52589227.1d1558cd.iframe.bundle.js → vendors~main~52589227.cebbe724.iframe.bundle.js} +2 -2
- package/docs-build/vendors~main~52589227.cebbe724.iframe.bundle.js.map +1 -0
- package/docs-build/{vendors~main~57c1f6cb.6a433835.iframe.bundle.js → vendors~main~57c1f6cb.86178471.iframe.bundle.js} +2 -2
- package/docs-build/vendors~main~57c1f6cb.86178471.iframe.bundle.js.map +1 -0
- package/docs-build/{vendors~main~73914085.a8e03e3b.iframe.bundle.js → vendors~main~73914085.e2f34f8e.iframe.bundle.js} +6 -6
- package/docs-build/{vendors~main~73914085.a8e03e3b.iframe.bundle.js.map → vendors~main~73914085.e2f34f8e.iframe.bundle.js.map} +1 -1
- package/docs-build/{vendors~main~9c5b28f6.7b8beed1.iframe.bundle.js → vendors~main~9c5b28f6.eefa7445.iframe.bundle.js} +3 -3
- package/docs-build/vendors~main~9c5b28f6.eefa7445.iframe.bundle.js.map +1 -0
- package/docs-build/{vendors~main~b5906859.7f66dcaf.iframe.bundle.js → vendors~main~b5906859.210afc21.iframe.bundle.js} +5 -5
- package/docs-build/vendors~main~b5906859.210afc21.iframe.bundle.js.map +1 -0
- package/docs-build/{vendors~main~b8f44717.7053e467.iframe.bundle.js → vendors~main~b8f44717.7b869975.iframe.bundle.js} +3 -3
- package/docs-build/vendors~main~b8f44717.7b869975.iframe.bundle.js.map +1 -0
- package/docs-build/{vendors~main~b9cf3951.a4fd68f5.iframe.bundle.js → vendors~main~b9cf3951.62d39717.iframe.bundle.js} +11 -11
- package/docs-build/vendors~main~b9cf3951.62d39717.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~d939e436.394e3bc7.iframe.bundle.js +2 -0
- package/docs-build/vendors~main~d939e436.394e3bc7.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~f420d588.88814a6a.iframe.bundle.js +107 -0
- package/docs-build/vendors~main~f420d588.88814a6a.iframe.bundle.js.map +1 -0
- package/package.json +1 -1
- package/public/thumbnails/MlMeasureTool.png +0 -0
- package/src/components/MapLibreMap/MapLibreMap.stories.js +75 -20
- package/src/components/MapLibreMap/MapLibreMap.tsx +11 -1
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +2 -2
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.test.js +1 -1
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx +82 -37
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.js +1 -1
- package/src/components/MlMeasureTool/MlMeasureTool.doc.de.md +3 -0
- package/src/components/MlMeasureTool/MlMeasureTool.meta.json +15 -0
- package/src/components/MlMeasureTool/MlMeasureTool.stories.js +67 -0
- package/src/components/MlMeasureTool/MlMeasureTool.tsx +33 -0
- package/src/components/MlOsmLayer/{MlOsmLayer.stories.js → MlOsmLayer.stories_.js} +0 -0
- package/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx +26 -8
- package/src/components/MlWmsLayer/MlWmsLayer.stories.js +2 -3
- package/src/components/MlWmsLayer/MlWmsLayer.tsx +27 -7
- package/src/hooks/useLayer.ts +15 -7
- package/src/index.ts +4 -4
- package/src/util/layerRemovalTest.js +5 -0
- package/docs-build/0.b1b9b035.iframe.bundle.js.map +0 -1
- package/docs-build/1.c50fb367.iframe.bundle.js.map +0 -1
- package/docs-build/17.2e544968.iframe.bundle.js.map +0 -1
- package/docs-build/18.42087006.iframe.bundle.js.map +0 -1
- package/docs-build/19.7e782442.iframe.bundle.js.map +0 -1
- package/docs-build/2.e58dc625.iframe.bundle.js.map +0 -1
- package/docs-build/20.f009289a.iframe.bundle.js.map +0 -1
- package/docs-build/21.1cdc9040.iframe.bundle.js.map +0 -1
- package/docs-build/22.c9e6b2d7.iframe.bundle.js.map +0 -1
- package/docs-build/3.a8172b89.iframe.bundle.js.map +0 -1
- package/docs-build/main~24120820.edd86ba9.iframe.bundle.js +0 -2
- package/docs-build/main~24120820.edd86ba9.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~0ad7406a.2054ae7c.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~0f485567.de36692f.iframe.bundle.js +0 -2
- package/docs-build/vendors~main~0f485567.de36692f.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~41a6ab2c.a947ed53.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~52589227.1d1558cd.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~57c1f6cb.6a433835.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~9c5b28f6.7b8beed1.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~b5906859.7f66dcaf.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~b8f44717.7053e467.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~b9cf3951.a4fd68f5.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~d939e436.ba1cad1b.iframe.bundle.js +0 -2
- package/docs-build/vendors~main~d939e436.ba1cad1b.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~f420d588.59c93444.iframe.bundle.js +0 -107
- package/docs-build/vendors~main~f420d588.59c93444.iframe.bundle.js.map +0 -1
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">77.5% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>31/40</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">59.09% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>13/
|
|
35
|
+
<span class='fraction'>13/22</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">78.37% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>29/37</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line medium'></div>
|
|
65
65
|
<pre><table class="coverage">
|
|
66
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -243,7 +243,27 @@
|
|
|
243
243
|
<a name='L178'></a><a href='#L178'>178</a>
|
|
244
244
|
<a name='L179'></a><a href='#L179'>179</a>
|
|
245
245
|
<a name='L180'></a><a href='#L180'>180</a>
|
|
246
|
-
<a name='L181'></a><a href='#L181'>181</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>
|
|
250
|
+
<a name='L185'></a><a href='#L185'>185</a>
|
|
251
|
+
<a name='L186'></a><a href='#L186'>186</a>
|
|
252
|
+
<a name='L187'></a><a href='#L187'>187</a>
|
|
253
|
+
<a name='L188'></a><a href='#L188'>188</a>
|
|
254
|
+
<a name='L189'></a><a href='#L189'>189</a>
|
|
255
|
+
<a name='L190'></a><a href='#L190'>190</a>
|
|
256
|
+
<a name='L191'></a><a href='#L191'>191</a>
|
|
257
|
+
<a name='L192'></a><a href='#L192'>192</a>
|
|
258
|
+
<a name='L193'></a><a href='#L193'>193</a>
|
|
259
|
+
<a name='L194'></a><a href='#L194'>194</a>
|
|
260
|
+
<a name='L195'></a><a href='#L195'>195</a>
|
|
261
|
+
<a name='L196'></a><a href='#L196'>196</a>
|
|
262
|
+
<a name='L197'></a><a href='#L197'>197</a>
|
|
263
|
+
<a name='L198'></a><a href='#L198'>198</a>
|
|
264
|
+
<a name='L199'></a><a href='#L199'>199</a>
|
|
265
|
+
<a name='L200'></a><a href='#L200'>200</a>
|
|
266
|
+
<a name='L201'></a><a href='#L201'>201</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
247
267
|
<span class="cline-any cline-neutral"> </span>
|
|
248
268
|
<span class="cline-any cline-neutral"> </span>
|
|
249
269
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -309,10 +329,14 @@
|
|
|
309
329
|
<span class="cline-any cline-yes">12x</span>
|
|
310
330
|
<span class="cline-any cline-neutral"> </span>
|
|
311
331
|
<span class="cline-any cline-yes">12x</span>
|
|
312
|
-
<span class="cline-any cline-yes">
|
|
332
|
+
<span class="cline-any cline-yes">8x</span>
|
|
313
333
|
<span class="cline-any cline-neutral"> </span>
|
|
314
334
|
<span class="cline-any cline-yes">4x</span>
|
|
315
335
|
<span class="cline-any cline-neutral"> </span>
|
|
336
|
+
<span class="cline-any cline-yes">4x</span>
|
|
337
|
+
<span class="cline-any cline-no"> </span>
|
|
338
|
+
<span class="cline-any cline-neutral"> </span>
|
|
339
|
+
<span class="cline-any cline-neutral"> </span>
|
|
316
340
|
<span class="cline-any cline-neutral"> </span>
|
|
317
341
|
<span class="cline-any cline-yes">4x</span>
|
|
318
342
|
<span class="cline-any cline-yes">4x</span>
|
|
@@ -330,7 +354,6 @@
|
|
|
330
354
|
<span class="cline-any cline-neutral"> </span>
|
|
331
355
|
<span class="cline-any cline-yes">4x</span>
|
|
332
356
|
<span class="cline-any cline-neutral"> </span>
|
|
333
|
-
<span class="cline-any cline-neutral"> </span>
|
|
334
357
|
<span class="cline-any cline-yes">4x</span>
|
|
335
358
|
<span class="cline-any cline-neutral"> </span>
|
|
336
359
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -354,6 +377,17 @@
|
|
|
354
377
|
<span class="cline-any cline-neutral"> </span>
|
|
355
378
|
<span class="cline-any cline-neutral"> </span>
|
|
356
379
|
<span class="cline-any cline-neutral"> </span>
|
|
380
|
+
<span class="cline-any cline-neutral"> </span>
|
|
381
|
+
<span class="cline-any cline-yes">4x</span>
|
|
382
|
+
<span class="cline-any cline-neutral"> </span>
|
|
383
|
+
<span class="cline-any cline-neutral"> </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>
|
|
387
|
+
<span class="cline-any cline-neutral"> </span>
|
|
388
|
+
<span class="cline-any cline-neutral"> </span>
|
|
389
|
+
<span class="cline-any cline-neutral"> </span>
|
|
390
|
+
<span class="cline-any cline-neutral"> </span>
|
|
357
391
|
<span class="cline-any cline-yes">4x</span>
|
|
358
392
|
<span class="cline-any cline-no"> </span>
|
|
359
393
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -362,6 +396,12 @@
|
|
|
362
396
|
<span class="cline-any cline-yes">12x</span>
|
|
363
397
|
<span class="cline-any cline-yes">8x</span>
|
|
364
398
|
<span class="cline-any cline-neutral"> </span>
|
|
399
|
+
<span class="cline-any cline-yes">8x</span>
|
|
400
|
+
<span class="cline-any cline-neutral"> </span>
|
|
401
|
+
<span class="cline-any cline-neutral"> </span>
|
|
402
|
+
<span class="cline-any cline-yes">12x</span>
|
|
403
|
+
<span class="cline-any cline-yes">8x</span>
|
|
404
|
+
<span class="cline-any cline-neutral"> </span>
|
|
365
405
|
<span class="cline-any cline-neutral"> </span>
|
|
366
406
|
<span class="cline-any cline-yes">4x</span>
|
|
367
407
|
<span class="cline-any cline-yes">4x</span>
|
|
@@ -423,7 +463,7 @@
|
|
|
423
463
|
<span class="cline-any cline-neutral"> </span>
|
|
424
464
|
<span class="cline-any cline-neutral"> </span>
|
|
425
465
|
<span class="cline-any cline-neutral"> </span>
|
|
426
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, { useRef, useEffect } from "react";
|
|
466
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, { useRef, useEffect, useCallback } from "react";
|
|
427
467
|
import useMap from "../../hooks/useMap";
|
|
428
468
|
|
|
429
469
|
import PropTypes from "prop-types";
|
|
@@ -479,7 +519,7 @@ interface MlWmsLayerProps {
|
|
|
479
519
|
*
|
|
480
520
|
* @component
|
|
481
521
|
*/
|
|
482
|
-
const MlWmsLayer = (props:MlWmsLayerProps) => {
|
|
522
|
+
const MlWmsLayer = (props: MlWmsLayerProps) => {
|
|
483
523
|
const mapHook = useMap({
|
|
484
524
|
mapId: props.mapId,
|
|
485
525
|
waitForLayer: props.insertBeforeLayer,
|
|
@@ -488,10 +528,14 @@ const MlWmsLayer = (props:MlWmsLayerProps) => {
|
|
|
488
528
|
const initializedRef = useRef(false);
|
|
489
529
|
const layerId = useRef(props.layerId || "MlWmsLayer-" + mapHook.componentId);
|
|
490
530
|
|
|
491
|
-
|
|
492
|
-
if (!mapHook.map
|
|
531
|
+
const createLayer = useCallback(() => {
|
|
532
|
+
if (!mapHook.map) return;
|
|
493
533
|
|
|
494
534
|
initializedRef.current = true;
|
|
535
|
+
|
|
536
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (mapHook.map.map.getLayer(layerId.current)) {
|
|
537
|
+
<span class="cstat-no" title="statement not covered" > mapHook.cleanup();</span>
|
|
538
|
+
}
|
|
495
539
|
|
|
496
540
|
let _propsUrlParams;
|
|
497
541
|
let _wmsUrl = props.url;
|
|
@@ -508,8 +552,7 @@ const MlWmsLayer = (props:MlWmsLayerProps) => {
|
|
|
508
552
|
};
|
|
509
553
|
let urlParams = new URLSearchParams(urlParamsObj);
|
|
510
554
|
let urlParamsStr =
|
|
511
|
-
decodeURIComponent(urlParams.toString()) +
|
|
512
|
-
"".replace(/%2F/g, "/").replace(/%3A/g, ":");
|
|
555
|
+
decodeURIComponent(urlParams.toString()) + "".replace(/%2F/g, "/").replace(/%3A/g, ":");
|
|
513
556
|
|
|
514
557
|
mapHook.map.addSource(
|
|
515
558
|
layerId.current,
|
|
@@ -534,10 +577,27 @@ const MlWmsLayer = (props:MlWmsLayerProps) => {
|
|
|
534
577
|
mapHook.componentId
|
|
535
578
|
);
|
|
536
579
|
|
|
580
|
+
// recreate layer if map style.json has changed
|
|
581
|
+
mapHook.map.on(
|
|
582
|
+
"styledata",
|
|
583
|
+
<span class="fstat-no" title="function not covered" > ()</span> => {
|
|
584
|
+
<span class="cstat-no" title="statement not covered" > if (initializedRef.current && !mapHook.map?.map.getLayer(layerId.current)) {</span>
|
|
585
|
+
<span class="cstat-no" title="statement not covered" > console.log("Recreate Layer " + layerId.current);</span>
|
|
586
|
+
<span class="cstat-no" title="statement not covered" > createLayer();</span>
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
mapHook.componentId
|
|
590
|
+
);
|
|
537
591
|
<span class="missing-if-branch" title="if path not taken" >I</span>if (!props.visible) {
|
|
538
592
|
<span class="cstat-no" title="statement not covered" > mapHook.map.map.setLayoutProperty(layerId.current, "visibility", "none");</span>
|
|
539
593
|
}
|
|
540
|
-
}, [mapHook, props]);
|
|
594
|
+
}, [mapHook.map, props]);
|
|
595
|
+
|
|
596
|
+
useEffect(() => {
|
|
597
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (initializedRef.current) <span class="cstat-no" title="statement not covered" >return;</span>
|
|
598
|
+
|
|
599
|
+
createLayer();
|
|
600
|
+
}, [createLayer]);
|
|
541
601
|
|
|
542
602
|
useEffect(() => {
|
|
543
603
|
if (!mapHook.map || !initializedRef.current) return;
|
|
@@ -610,7 +670,7 @@ export default MlWmsLayer;
|
|
|
610
670
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
611
671
|
Code coverage generated by
|
|
612
672
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
613
|
-
at
|
|
673
|
+
at Sun Jun 12 2022 17:06:19 GMT+0000 (Coordinated Universal Time)
|
|
614
674
|
</div>
|
|
615
675
|
<script src="../../../prettify.js"></script>
|
|
616
676
|
<script>
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">77.5% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>31/40</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">59.09% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>13/
|
|
35
|
+
<span class='fraction'>13/22</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">78.37% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>29/37</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line medium'></div>
|
|
65
65
|
<div class="pad1">
|
|
66
66
|
<table class="coverage-summary">
|
|
67
67
|
<thead>
|
|
@@ -79,18 +79,18 @@
|
|
|
79
79
|
</tr>
|
|
80
80
|
</thead>
|
|
81
81
|
<tbody><tr>
|
|
82
|
-
<td class="file
|
|
83
|
-
<td data-value="
|
|
84
|
-
<div class="chart"><div class="cover-fill" style="width:
|
|
82
|
+
<td class="file medium" data-value="MlWmsLayer.tsx"><a href="MlWmsLayer.tsx.html">MlWmsLayer.tsx</a></td>
|
|
83
|
+
<td data-value="77.5" 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
85
|
</td>
|
|
86
|
-
<td data-value="
|
|
87
|
-
<td data-value="
|
|
88
|
-
<td data-value="
|
|
89
|
-
<td data-value="
|
|
90
|
-
<td data-value="
|
|
91
|
-
<td data-value="
|
|
92
|
-
<td data-value="
|
|
93
|
-
<td data-value="
|
|
86
|
+
<td data-value="77.5" class="pct medium">77.5%</td>
|
|
87
|
+
<td data-value="40" class="abs medium">31/40</td>
|
|
88
|
+
<td data-value="59.09" class="pct medium">59.09%</td>
|
|
89
|
+
<td data-value="22" class="abs medium">13/22</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="78.37" class="pct medium">78.37%</td>
|
|
93
|
+
<td data-value="37" class="abs medium">29/37</td>
|
|
94
94
|
</tr>
|
|
95
95
|
|
|
96
96
|
</tbody>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at
|
|
104
|
+
at Sun Jun 12 2022 17:06:19 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -1021,7 +1021,7 @@ export default MlWmsLoader;
|
|
|
1021
1021
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1022
1022
|
Code coverage generated by
|
|
1023
1023
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1024
|
-
at
|
|
1024
|
+
at Sun Jun 12 2022 17:06:19 GMT+0000 (Coordinated Universal Time)
|
|
1025
1025
|
</div>
|
|
1026
1026
|
<script src="../../../prettify.js"></script>
|
|
1027
1027
|
<script>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at
|
|
104
|
+
at Sun Jun 12 2022 17:06:19 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -343,7 +343,7 @@ export default MapContext;</pre></td></tr></table></pre>
|
|
|
343
343
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
344
344
|
Code coverage generated by
|
|
345
345
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
346
|
-
at
|
|
346
|
+
at Sun Jun 12 2022 17:06:19 GMT+0000 (Coordinated Universal Time)
|
|
347
347
|
</div>
|
|
348
348
|
<script src="../../prettify.js"></script>
|
|
349
349
|
<script>
|
|
@@ -88,7 +88,7 @@ export default SimpleDataContext;
|
|
|
88
88
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
89
89
|
Code coverage generated by
|
|
90
90
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
91
|
-
at
|
|
91
|
+
at Sun Jun 12 2022 17:06:19 GMT+0000 (Coordinated Universal Time)
|
|
92
92
|
</div>
|
|
93
93
|
<script src="../../prettify.js"></script>
|
|
94
94
|
<script>
|
|
@@ -262,7 +262,7 @@ export default SimpleDataProvider;
|
|
|
262
262
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
263
263
|
Code coverage generated by
|
|
264
264
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
265
|
-
at
|
|
265
|
+
at Sun Jun 12 2022 17:06:19 GMT+0000 (Coordinated Universal Time)
|
|
266
266
|
</div>
|
|
267
267
|
<script src="../../prettify.js"></script>
|
|
268
268
|
<script>
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
132
132
|
Code coverage generated by
|
|
133
133
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
134
|
-
at
|
|
134
|
+
at Sun Jun 12 2022 17:06:19 GMT+0000 (Coordinated Universal Time)
|
|
135
135
|
</div>
|
|
136
136
|
<script src="../../prettify.js"></script>
|
|
137
137
|
<script>
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">54.14% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>98/181</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">49.05% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>52/
|
|
35
|
+
<span class='fraction'>52/106</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">57.14% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>16/28</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">54.33% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>94/173</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -80,17 +80,17 @@
|
|
|
80
80
|
</thead>
|
|
81
81
|
<tbody><tr>
|
|
82
82
|
<td class="file medium" data-value="useLayer.ts"><a href="useLayer.ts.html">useLayer.ts</a></td>
|
|
83
|
-
<td data-value="
|
|
84
|
-
<div class="chart"><div class="cover-fill" style="width:
|
|
83
|
+
<td data-value="69.84" class="pic medium">
|
|
84
|
+
<div class="chart"><div class="cover-fill" style="width: 69%"></div><div class="cover-empty" style="width: 31%"></div></div>
|
|
85
85
|
</td>
|
|
86
|
-
<td data-value="
|
|
87
|
-
<td data-value="
|
|
88
|
-
<td data-value="
|
|
89
|
-
<td data-value="
|
|
90
|
-
<td data-value="
|
|
91
|
-
<td data-value="8" class="abs high">
|
|
92
|
-
<td data-value="
|
|
93
|
-
<td data-value="
|
|
86
|
+
<td data-value="69.84" class="pct medium">69.84%</td>
|
|
87
|
+
<td data-value="63" class="abs medium">44/63</td>
|
|
88
|
+
<td data-value="62.06" class="pct medium">62.06%</td>
|
|
89
|
+
<td data-value="58" class="abs medium">36/58</td>
|
|
90
|
+
<td data-value="87.5" class="pct high">87.5%</td>
|
|
91
|
+
<td data-value="8" class="abs high">7/8</td>
|
|
92
|
+
<td data-value="70" class="pct medium">70%</td>
|
|
93
|
+
<td data-value="60" class="abs medium">42/60</td>
|
|
94
94
|
</tr>
|
|
95
95
|
|
|
96
96
|
<tr>
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
147
147
|
Code coverage generated by
|
|
148
148
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
149
|
-
at
|
|
149
|
+
at Sun Jun 12 2022 17:06:19 GMT+0000 (Coordinated Universal Time)
|
|
150
150
|
</div>
|
|
151
151
|
<script src="../../prettify.js"></script>
|
|
152
152
|
<script>
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">69.84% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>44/63</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">62.06% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>36/
|
|
35
|
+
<span class='fraction'>36/58</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">87.5% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>7/8</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">70% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>42/60</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -250,7 +250,15 @@
|
|
|
250
250
|
<a name='L185'></a><a href='#L185'>185</a>
|
|
251
251
|
<a name='L186'></a><a href='#L186'>186</a>
|
|
252
252
|
<a name='L187'></a><a href='#L187'>187</a>
|
|
253
|
-
<a name='L188'></a><a href='#L188'>188</a
|
|
253
|
+
<a name='L188'></a><a href='#L188'>188</a>
|
|
254
|
+
<a name='L189'></a><a href='#L189'>189</a>
|
|
255
|
+
<a name='L190'></a><a href='#L190'>190</a>
|
|
256
|
+
<a name='L191'></a><a href='#L191'>191</a>
|
|
257
|
+
<a name='L192'></a><a href='#L192'>192</a>
|
|
258
|
+
<a name='L193'></a><a href='#L193'>193</a>
|
|
259
|
+
<a name='L194'></a><a href='#L194'>194</a>
|
|
260
|
+
<a name='L195'></a><a href='#L195'>195</a>
|
|
261
|
+
<a name='L196'></a><a href='#L196'>196</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
254
262
|
<span class="cline-any cline-neutral"> </span>
|
|
255
263
|
<span class="cline-any cline-neutral"> </span>
|
|
256
264
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -354,6 +362,18 @@
|
|
|
354
362
|
<span class="cline-any cline-no"> </span>
|
|
355
363
|
<span class="cline-any cline-neutral"> </span>
|
|
356
364
|
<span class="cline-any cline-neutral"> </span>
|
|
365
|
+
<span class="cline-any cline-neutral"> </span>
|
|
366
|
+
<span class="cline-any cline-yes">14x</span>
|
|
367
|
+
<span class="cline-any cline-neutral"> </span>
|
|
368
|
+
<span class="cline-any cline-neutral"> </span>
|
|
369
|
+
<span class="cline-any cline-no"> </span>
|
|
370
|
+
<span class="cline-any cline-no"> </span>
|
|
371
|
+
<span class="cline-any cline-no"> </span>
|
|
372
|
+
<span class="cline-any cline-neutral"> </span>
|
|
373
|
+
<span class="cline-any cline-neutral"> </span>
|
|
374
|
+
<span class="cline-any cline-neutral"> </span>
|
|
375
|
+
<span class="cline-any cline-neutral"> </span>
|
|
376
|
+
<span class="cline-any cline-neutral"> </span>
|
|
357
377
|
<span class="cline-any cline-yes">14x</span>
|
|
358
378
|
<span class="cline-any cline-yes">14x</span>
|
|
359
379
|
<span class="cline-any cline-yes">14x</span>
|
|
@@ -417,13 +437,9 @@
|
|
|
417
437
|
<span class="cline-any cline-neutral"> </span>
|
|
418
438
|
<span class="cline-any cline-neutral"> </span>
|
|
419
439
|
<span class="cline-any cline-yes">60x</span>
|
|
420
|
-
<span class="cline-any cline-yes">7x</span>
|
|
421
|
-
<span class="cline-any cline-yes">7x</span>
|
|
422
|
-
<span class="cline-any cline-neutral"> </span>
|
|
423
|
-
<span class="cline-any cline-neutral"> </span>
|
|
424
|
-
<span class="cline-any cline-yes">60x</span>
|
|
425
440
|
<span class="cline-any cline-yes">14x</span>
|
|
426
441
|
<span class="cline-any cline-yes">7x</span>
|
|
442
|
+
<span class="cline-any cline-yes">7x</span>
|
|
427
443
|
<span class="cline-any cline-neutral"> </span>
|
|
428
444
|
<span class="cline-any cline-neutral"> </span>
|
|
429
445
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -499,7 +515,7 @@ function useLayer(props: useLayerProps): useLayerType {
|
|
|
499
515
|
<span class="missing-if-branch" title="if path not taken" >I</span>if (!mapHook.map) <span class="cstat-no" title="statement not covered" >return;</span>
|
|
500
516
|
|
|
501
517
|
<span class="missing-if-branch" title="if path not taken" >I</span>if (mapHook.map.map.getLayer(layerId.current)) {
|
|
502
|
-
<span class="cstat-no" title="statement not covered" > mapHook.
|
|
518
|
+
<span class="cstat-no" title="statement not covered" > mapHook.cleanup();</span>
|
|
503
519
|
}
|
|
504
520
|
<span class="missing-if-branch" title="if path not taken" >I</span>if (mapHook.map.map.getSource(layerId.current)) {
|
|
505
521
|
<span class="cstat-no" title="statement not covered" > mapHook.map.map.removeSource(layerId.current);</span>
|
|
@@ -540,6 +556,18 @@ function useLayer(props: useLayerProps): useLayerType {
|
|
|
540
556
|
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof props.onLeave !== "undefined") {
|
|
541
557
|
<span class="cstat-no" title="statement not covered" > mapHook.map.on("mouseleave", layerId.current, props.onLeave, mapHook.componentId);</span>
|
|
542
558
|
}
|
|
559
|
+
|
|
560
|
+
// recreate layer if style has changed
|
|
561
|
+
mapHook.map.on(
|
|
562
|
+
"styledata",
|
|
563
|
+
<span class="fstat-no" title="function not covered" > ()</span> => {
|
|
564
|
+
<span class="cstat-no" title="statement not covered" > if (initializedRef.current && !mapHook.map?.map.getLayer(layerId.current)) {</span>
|
|
565
|
+
<span class="cstat-no" title="statement not covered" > console.log("Recreate Layer");</span>
|
|
566
|
+
<span class="cstat-no" title="statement not covered" > createLayer();</span>
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
mapHook.componentId
|
|
570
|
+
);
|
|
543
571
|
|
|
544
572
|
layerPaintConfRef.current = JSON.stringify(props.options?.paint);
|
|
545
573
|
layerLayoutConfRef.current = JSON.stringify(props.options?.layout);
|
|
@@ -602,15 +630,11 @@ function useLayer(props: useLayerProps): useLayerType {
|
|
|
602
630
|
<span class="cstat-no" title="statement not covered" > layerPaintConfRef.current = paintString;</span>
|
|
603
631
|
}
|
|
604
632
|
}, [props.options, mapHook.map]);
|
|
605
|
-
|
|
606
|
-
const cleanup = () => {
|
|
607
|
-
initializedRef.current = false;
|
|
608
|
-
mapHook.cleanup();
|
|
609
|
-
};
|
|
610
633
|
|
|
611
634
|
useEffect(() => {
|
|
612
635
|
return () => {
|
|
613
|
-
|
|
636
|
+
initializedRef.current = false;
|
|
637
|
+
mapHook.cleanup();
|
|
614
638
|
};
|
|
615
639
|
}, []);
|
|
616
640
|
|
|
@@ -631,7 +655,7 @@ export default useLayer;
|
|
|
631
655
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
632
656
|
Code coverage generated by
|
|
633
657
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
634
|
-
at
|
|
658
|
+
at Sun Jun 12 2022 17:06:19 GMT+0000 (Coordinated Universal Time)
|
|
635
659
|
</div>
|
|
636
660
|
<script src="../../prettify.js"></script>
|
|
637
661
|
<script>
|
|
@@ -340,7 +340,7 @@ export type { useMapType };
|
|
|
340
340
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
341
341
|
Code coverage generated by
|
|
342
342
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
343
|
-
at
|
|
343
|
+
at Sun Jun 12 2022 17:06:19 GMT+0000 (Coordinated Universal Time)
|
|
344
344
|
</div>
|
|
345
345
|
<script src="../../prettify.js"></script>
|
|
346
346
|
<script>
|
|
@@ -637,7 +637,7 @@ export default useMapState;
|
|
|
637
637
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
638
638
|
Code coverage generated by
|
|
639
639
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
640
|
-
at
|
|
640
|
+
at Sun Jun 12 2022 17:06:19 GMT+0000 (Coordinated Universal Time)
|
|
641
641
|
</div>
|
|
642
642
|
<script src="../../prettify.js"></script>
|
|
643
643
|
<script>
|
|
@@ -343,7 +343,7 @@ export default useWms;
|
|
|
343
343
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
344
344
|
Code coverage generated by
|
|
345
345
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
346
|
-
at
|
|
346
|
+
at Sun Jun 12 2022 17:06:19 GMT+0000 (Coordinated Universal Time)
|
|
347
347
|
</div>
|
|
348
348
|
<script src="../../prettify.js"></script>
|
|
349
349
|
<script>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at
|
|
104
|
+
at Sun Jun 12 2022 17:06:19 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../prettify.js"></script>
|
|
107
107
|
<script>
|