@mapcomponents/react-maplibre 0.1.9 → 0.1.13
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/ISSUE_TEMPLATE/bug_report.md +2 -2
- package/.github/ISSUE_TEMPLATE/feature_request.md +3 -3
- package/.github/workflows/node_version_test.yml +25 -0
- package/.github/workflows/storybook.yml +6 -3
- package/CONTRIBUTING.md +2 -2
- package/README.md +3 -7
- package/coverage/clover.xml +748 -625
- package/coverage/coverage-final.json +19 -14
- package/coverage/lcov-report/block-navigation.js +8 -0
- package/coverage/lcov-report/index.html +170 -104
- 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 +99 -48
- 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 +91 -31
- package/coverage/lcov-report/{components → src/components}/MlGeoJsonLayer/index.html +35 -29
- package/coverage/lcov-report/{components → src/components}/MlImageMarkerLayer/MlImageMarkerLayer.js.html +26 -23
- package/coverage/lcov-report/{components → src/components}/MlImageMarkerLayer/index.html +26 -20
- package/coverage/lcov-report/{components → src/components}/MlLayer/MlLayer.js.html +37 -31
- package/coverage/lcov-report/{components → src/components}/MlLayer/index.html +33 -27
- 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 +55 -37
- package/coverage/lcov-report/{components → src/components}/MlNavigationTools/index.html +23 -17
- 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 +17 -11
- package/coverage/lcov-report/{components → src/components}/MlShareMapState/index.html +17 -11
- 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/{hooks → src/hooks}/index.html +17 -11
- package/coverage/lcov-report/{hooks → src/hooks}/useMap.js.html +17 -11
- package/coverage/lcov-report/{hooks → src/hooks}/useMapState.js.html +17 -11
- 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 +1278 -1010
- package/dist/b556faa3bc6829d2.png +0 -0
- package/dist/index.esm.js +170 -109
- 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 +10 -2
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.js +58 -73
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.meta.json +1 -1
- package/src/components/MlFeatureEditor/MlFeatureEditor.meta.json +2 -2
- package/src/components/MlFollowGps/MlFollowGps.js +46 -31
- 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 +27 -9
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.meta.json +1 -1
- package/src/components/MlGeoJsonLayer/util/transitionFunctions.js +19 -12
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.js +3 -4
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.test.js +6 -7
- package/src/components/MlLayer/MlLayer.js +2 -2
- 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 +26 -22
- package/src/components/MlScaleReference/MlScaleReference.meta.json +1 -1
- package/src/components/MlScaleReference/MlScaleReference.stories.js +25 -21
- 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 -7
- package/src/decorators/MapContextDecorator.js +7 -8
- package/src/decorators/MapContextKlokantechBasicDecorator.js +8 -9
- package/src/decorators/MultiMapContextDecorator.js +2 -6
- package/src/hooks/useMapState.stories.js +7 -2
- package/src/hooks/useWms.js +7 -6
- package/src/i18n.js +28 -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 → src/components}/MlGeoJsonLayer/MlGeoJsonLayer.js.html
RENAMED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
<html lang="en">
|
|
4
4
|
|
|
5
5
|
<head>
|
|
6
|
-
<title>Code coverage report for components/MlGeoJsonLayer/MlGeoJsonLayer.js</title>
|
|
6
|
+
<title>Code coverage report for src/components/MlGeoJsonLayer/MlGeoJsonLayer.js</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,34 +19,34 @@
|
|
|
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> / <a href="index.html">src/components/MlGeoJsonLayer</a> MlGeoJsonLayer.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">68.18% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>45/66</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">57.14% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>32/56</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">66.
|
|
47
|
+
<span class="strong">66.12% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>41/62</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 medium'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
@@ -279,7 +285,25 @@
|
|
|
279
285
|
<a name='L220'></a><a href='#L220'>220</a>
|
|
280
286
|
<a name='L221'></a><a href='#L221'>221</a>
|
|
281
287
|
<a name='L222'></a><a href='#L222'>222</a>
|
|
282
|
-
<a name='L223'></a><a href='#L223'>223</a
|
|
288
|
+
<a name='L223'></a><a href='#L223'>223</a>
|
|
289
|
+
<a name='L224'></a><a href='#L224'>224</a>
|
|
290
|
+
<a name='L225'></a><a href='#L225'>225</a>
|
|
291
|
+
<a name='L226'></a><a href='#L226'>226</a>
|
|
292
|
+
<a name='L227'></a><a href='#L227'>227</a>
|
|
293
|
+
<a name='L228'></a><a href='#L228'>228</a>
|
|
294
|
+
<a name='L229'></a><a href='#L229'>229</a>
|
|
295
|
+
<a name='L230'></a><a href='#L230'>230</a>
|
|
296
|
+
<a name='L231'></a><a href='#L231'>231</a>
|
|
297
|
+
<a name='L232'></a><a href='#L232'>232</a>
|
|
298
|
+
<a name='L233'></a><a href='#L233'>233</a>
|
|
299
|
+
<a name='L234'></a><a href='#L234'>234</a>
|
|
300
|
+
<a name='L235'></a><a href='#L235'>235</a>
|
|
301
|
+
<a name='L236'></a><a href='#L236'>236</a>
|
|
302
|
+
<a name='L237'></a><a href='#L237'>237</a>
|
|
303
|
+
<a name='L238'></a><a href='#L238'>238</a>
|
|
304
|
+
<a name='L239'></a><a href='#L239'>239</a>
|
|
305
|
+
<a name='L240'></a><a href='#L240'>240</a>
|
|
306
|
+
<a name='L241'></a><a href='#L241'>241</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
283
307
|
<span class="cline-any cline-neutral"> </span>
|
|
284
308
|
<span class="cline-any cline-neutral"> </span>
|
|
285
309
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -306,6 +330,7 @@
|
|
|
306
330
|
<span class="cline-any cline-yes">8x</span>
|
|
307
331
|
<span class="cline-any cline-yes">8x</span>
|
|
308
332
|
<span class="cline-any cline-yes">8x</span>
|
|
333
|
+
<span class="cline-any cline-yes">8x</span>
|
|
309
334
|
<span class="cline-any cline-neutral"> </span>
|
|
310
335
|
<span class="cline-any cline-neutral"> </span>
|
|
311
336
|
<span class="cline-any cline-yes">8x</span>
|
|
@@ -315,6 +340,9 @@
|
|
|
315
340
|
<span class="cline-any cline-yes">4x</span>
|
|
316
341
|
<span class="cline-any cline-neutral"> </span>
|
|
317
342
|
<span class="cline-any cline-yes">2x</span>
|
|
343
|
+
<span class="cline-any cline-no"> </span>
|
|
344
|
+
<span class="cline-any cline-neutral"> </span>
|
|
345
|
+
<span class="cline-any cline-yes">2x</span>
|
|
318
346
|
<span class="cline-any cline-yes">2x</span>
|
|
319
347
|
<span class="cline-any cline-neutral"> </span>
|
|
320
348
|
<span class="cline-any cline-yes">2x</span>
|
|
@@ -325,8 +353,14 @@
|
|
|
325
353
|
<span class="cline-any cline-yes">8x</span>
|
|
326
354
|
<span class="cline-any cline-yes">8x</span>
|
|
327
355
|
<span class="cline-any cline-neutral"> </span>
|
|
356
|
+
<span class="cline-any cline-no"> </span>
|
|
357
|
+
<span class="cline-any cline-no"> </span>
|
|
358
|
+
<span class="cline-any cline-neutral"> </span>
|
|
328
359
|
<span class="cline-any cline-neutral"> </span>
|
|
329
360
|
<span class="cline-any cline-neutral"> </span>
|
|
361
|
+
<span class="cline-any cline-yes">8x</span>
|
|
362
|
+
<span class="cline-any cline-yes">8x</span>
|
|
363
|
+
<span class="cline-any cline-neutral"> </span>
|
|
330
364
|
<span class="cline-any cline-no"> </span>
|
|
331
365
|
<span class="cline-any cline-no"> </span>
|
|
332
366
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -350,6 +384,7 @@
|
|
|
350
384
|
<span class="cline-any cline-neutral"> </span>
|
|
351
385
|
<span class="cline-any cline-neutral"> </span>
|
|
352
386
|
<span class="cline-any cline-neutral"> </span>
|
|
387
|
+
<span class="cline-any cline-neutral"> </span>
|
|
353
388
|
<span class="cline-any cline-yes">8x</span>
|
|
354
389
|
<span class="cline-any cline-yes">8x</span>
|
|
355
390
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -416,6 +451,7 @@
|
|
|
416
451
|
<span class="cline-any cline-neutral"> </span>
|
|
417
452
|
<span class="cline-any cline-neutral"> </span>
|
|
418
453
|
<span class="cline-any cline-neutral"> </span>
|
|
454
|
+
<span class="cline-any cline-neutral"> </span>
|
|
419
455
|
<span class="cline-any cline-yes">4x</span>
|
|
420
456
|
<span class="cline-any cline-no"> </span>
|
|
421
457
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -435,8 +471,6 @@
|
|
|
435
471
|
<span class="cline-any cline-neutral"> </span>
|
|
436
472
|
<span class="cline-any cline-no"> </span>
|
|
437
473
|
<span class="cline-any cline-no"> </span>
|
|
438
|
-
<span class="cline-any cline-no"> </span>
|
|
439
|
-
<span class="cline-any cline-neutral"> </span>
|
|
440
474
|
<span class="cline-any cline-neutral"> </span>
|
|
441
475
|
<span class="cline-any cline-neutral"> </span>
|
|
442
476
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -501,6 +535,14 @@
|
|
|
501
535
|
<span class="cline-any cline-neutral"> </span>
|
|
502
536
|
<span class="cline-any cline-neutral"> </span>
|
|
503
537
|
<span class="cline-any cline-neutral"> </span>
|
|
538
|
+
<span class="cline-any cline-neutral"> </span>
|
|
539
|
+
<span class="cline-any cline-neutral"> </span>
|
|
540
|
+
<span class="cline-any cline-neutral"> </span>
|
|
541
|
+
<span class="cline-any cline-neutral"> </span>
|
|
542
|
+
<span class="cline-any cline-neutral"> </span>
|
|
543
|
+
<span class="cline-any cline-neutral"> </span>
|
|
544
|
+
<span class="cline-any cline-neutral"> </span>
|
|
545
|
+
<span class="cline-any cline-neutral"> </span>
|
|
504
546
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, { useRef, useEffect, useContext, useCallback } from "react";
|
|
505
547
|
import PropTypes from "prop-types";
|
|
506
548
|
|
|
@@ -524,6 +566,7 @@ const MlGeoJsonLayer = (props) => {
|
|
|
524
566
|
const mapRef = useRef(null);
|
|
525
567
|
const initializedRef = useRef(false);
|
|
526
568
|
const transitionInProgressRef = useRef(false);
|
|
569
|
+
const transitionTimeoutRef = useRef(undefined);
|
|
527
570
|
const currentTransitionStepRef = useRef(false);
|
|
528
571
|
const transitionGeojsonDataRef = useRef([]);
|
|
529
572
|
const transitionGeojsonCommonDataRef = useRef([]);
|
|
@@ -536,6 +579,9 @@ const MlGeoJsonLayer = (props) => {
|
|
|
536
579
|
let _componentId = componentId.current;
|
|
537
580
|
return () => {
|
|
538
581
|
// This is the cleanup function, it is called when this react component is removed from react-dom
|
|
582
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (transitionTimeoutRef.current) {
|
|
583
|
+
<span class="cstat-no" title="statement not covered" > clearTimeout(transitionTimeoutRef.current);</span>
|
|
584
|
+
}
|
|
539
585
|
if (mapRef.current) {
|
|
540
586
|
mapRef.current.cleanup(_componentId);
|
|
541
587
|
|
|
@@ -546,11 +592,17 @@ const MlGeoJsonLayer = (props) => {
|
|
|
546
592
|
|
|
547
593
|
useEffect(() => {
|
|
548
594
|
if (!mapRef.current || <span class="branch-1 cbranch-no" title="branch not covered" >!initializedRef.current)</span> return;
|
|
549
|
-
|
|
550
|
-
|
|
595
|
+
|
|
596
|
+
<span class="cstat-no" title="statement not covered" > for (var key in props.layout) {</span>
|
|
597
|
+
<span class="cstat-no" title="statement not covered" > mapContext.getMap(props.mapId).setLayoutProperty(layerId.current, key, props.layout[key]);</span>
|
|
598
|
+
}
|
|
599
|
+
}, [props.layout, mapContext, props.mapId]);
|
|
600
|
+
|
|
601
|
+
useEffect(() => {
|
|
602
|
+
if (!mapRef.current || <span class="branch-1 cbranch-no" title="branch not covered" >!initializedRef.current)</span> return;
|
|
551
603
|
|
|
552
604
|
<span class="cstat-no" title="statement not covered" > for (var key in props.paint) {</span>
|
|
553
|
-
<span class="cstat-no" title="statement not covered" > mapContext.getMap(props.mapId).setPaintProperty(
|
|
605
|
+
<span class="cstat-no" title="statement not covered" > mapContext.getMap(props.mapId).setPaintProperty(layerId.current, key, props.paint[key]);</span>
|
|
554
606
|
}
|
|
555
607
|
}, [props.paint, mapContext, props.mapId]);
|
|
556
608
|
|
|
@@ -566,7 +618,8 @@ const MlGeoJsonLayer = (props) => {
|
|
|
566
618
|
msPerStep,
|
|
567
619
|
currentTransitionStepRef,
|
|
568
620
|
mapRef.current,
|
|
569
|
-
componentId.current
|
|
621
|
+
componentId.current,
|
|
622
|
+
transitionTimeoutRef
|
|
570
623
|
);
|
|
571
624
|
},
|
|
572
625
|
[props]
|
|
@@ -633,6 +686,7 @@ const MlGeoJsonLayer = (props) => {
|
|
|
633
686
|
"line-color": "rgb(100,200,100)",
|
|
634
687
|
"line-width": 10,
|
|
635
688
|
},
|
|
689
|
+
layout: props.layout || {},
|
|
636
690
|
},
|
|
637
691
|
props.insertBeforeLayer,
|
|
638
692
|
componentId.current
|
|
@@ -656,9 +710,7 @@ const MlGeoJsonLayer = (props) => {
|
|
|
656
710
|
<span class="branch-2 cbranch-no" title="branch not covered" > typeof props.geojson.geometry !== "undefined"</span>
|
|
657
711
|
) {
|
|
658
712
|
<span class="cstat-no" title="statement not covered" > transitionToGeojson(props.geojson);</span>
|
|
659
|
-
<span class="cstat-no" title="statement not covered" >
|
|
660
|
-
<span class="cstat-no" title="statement not covered" > oldGeojsonRef.current = props.geojson;</span>
|
|
661
|
-
}, props.transitionTime / 2);
|
|
713
|
+
<span class="cstat-no" title="statement not covered" > oldGeojsonRef.current = props.geojson;</span>
|
|
662
714
|
}
|
|
663
715
|
}
|
|
664
716
|
}, [mapContext.mapIds, mapContext, props, transitionToGeojson]);
|
|
@@ -677,8 +729,16 @@ MlGeoJsonLayer.propTypes = {
|
|
|
677
729
|
*/
|
|
678
730
|
type: PropTypes.string,
|
|
679
731
|
/**
|
|
680
|
-
*
|
|
681
|
-
* Possible
|
|
732
|
+
* Layout property object, that is passed to the addLayer call.
|
|
733
|
+
* Possible props depend on the layer type.
|
|
734
|
+
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#line
|
|
735
|
+
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
|
|
736
|
+
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
|
|
737
|
+
*/
|
|
738
|
+
layout: PropTypes.object,
|
|
739
|
+
/**
|
|
740
|
+
* Paint property object, that is passed to the addLayer call.
|
|
741
|
+
* Possible props depend on the layer type.
|
|
682
742
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#line
|
|
683
743
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
|
|
684
744
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
|
|
@@ -729,18 +789,18 @@ export default MlGeoJsonLayer;
|
|
|
729
789
|
</div><!-- /wrapper -->
|
|
730
790
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
731
791
|
Code coverage generated by
|
|
732
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
733
|
-
at
|
|
792
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
793
|
+
at Wed Dec 15 2021 17:14:00 GMT+0000 (Coordinated Universal Time)
|
|
734
794
|
</div>
|
|
735
795
|
</div>
|
|
736
|
-
<script src="
|
|
796
|
+
<script src="../../../prettify.js"></script>
|
|
737
797
|
<script>
|
|
738
798
|
window.onload = function () {
|
|
739
799
|
prettyPrint();
|
|
740
800
|
};
|
|
741
801
|
</script>
|
|
742
|
-
<script src="
|
|
743
|
-
<script src="
|
|
802
|
+
<script src="../../../sorter.js"></script>
|
|
803
|
+
<script src="../../../block-navigation.js"></script>
|
|
744
804
|
</body>
|
|
745
805
|
</html>
|
|
746
806
|
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
<html lang="en">
|
|
4
4
|
|
|
5
5
|
<head>
|
|
6
|
-
<title>Code coverage report for components/MlGeoJsonLayer</title>
|
|
6
|
+
<title>Code coverage report for src/components/MlGeoJsonLayer</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,34 +19,34 @@
|
|
|
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/MlGeoJsonLayer</h1>
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">68.18% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>45/66</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">57.14% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>32/56</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">66.
|
|
47
|
+
<span class="strong">66.12% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>41/62</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 medium'></div>
|
|
59
65
|
<div class="pad1">
|
|
@@ -74,17 +80,17 @@
|
|
|
74
80
|
</thead>
|
|
75
81
|
<tbody><tr>
|
|
76
82
|
<td class="file medium" data-value="MlGeoJsonLayer.js"><a href="MlGeoJsonLayer.js.html">MlGeoJsonLayer.js</a></td>
|
|
77
|
-
<td data-value="
|
|
78
|
-
<div class="chart"><div class="cover-fill" style="width:
|
|
83
|
+
<td data-value="68.18" class="pic medium">
|
|
84
|
+
<div class="chart"><div class="cover-fill" style="width: 68%"></div><div class="cover-empty" style="width: 32%"></div></div>
|
|
79
85
|
</td>
|
|
80
|
-
<td data-value="
|
|
81
|
-
<td data-value="
|
|
82
|
-
<td data-value="
|
|
83
|
-
<td data-value="
|
|
84
|
-
<td data-value="
|
|
85
|
-
<td data-value="8" class="abs
|
|
86
|
-
<td data-value="66.
|
|
87
|
-
<td data-value="
|
|
86
|
+
<td data-value="68.18" class="pct medium">68.18%</td>
|
|
87
|
+
<td data-value="66" class="abs medium">45/66</td>
|
|
88
|
+
<td data-value="57.14" class="pct medium">57.14%</td>
|
|
89
|
+
<td data-value="56" class="abs medium">32/56</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="66.12" class="pct medium">66.12%</td>
|
|
93
|
+
<td data-value="62" class="abs medium">41/62</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 Wed Dec 15 2021 17:14:00 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
|
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
<html lang="en">
|
|
4
4
|
|
|
5
5
|
<head>
|
|
6
|
-
<title>Code coverage report for components/MlImageMarkerLayer/MlImageMarkerLayer.js</title>
|
|
6
|
+
<title>Code coverage report for src/components/MlImageMarkerLayer/MlImageMarkerLayer.js</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,13 +19,13 @@
|
|
|
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> / <a href="index.html">src/components/MlImageMarkerLayer</a> MlImageMarkerLayer.js</h1>
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">79.
|
|
26
|
+
<span class="strong">79.54% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>35/44</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">81.39% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>35/43</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 medium'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
@@ -167,8 +173,7 @@
|
|
|
167
173
|
<a name='L108'></a><a href='#L108'>108</a>
|
|
168
174
|
<a name='L109'></a><a href='#L109'>109</a>
|
|
169
175
|
<a name='L110'></a><a href='#L110'>110</a>
|
|
170
|
-
<a name='L111'></a><a href='#L111'>111</a>
|
|
171
|
-
<a name='L112'></a><a href='#L112'>112</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
176
|
+
<a name='L111'></a><a href='#L111'>111</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
172
177
|
<span class="cline-any cline-neutral"> </span>
|
|
173
178
|
<span class="cline-any cline-neutral"> </span>
|
|
174
179
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -177,8 +182,6 @@
|
|
|
177
182
|
<span class="cline-any cline-neutral"> </span>
|
|
178
183
|
<span class="cline-any cline-yes">8x</span>
|
|
179
184
|
<span class="cline-any cline-yes">8x</span>
|
|
180
|
-
<span class="cline-any cline-neutral"> </span>
|
|
181
|
-
<span class="cline-any cline-neutral"> </span>
|
|
182
185
|
<span class="cline-any cline-yes">8x</span>
|
|
183
186
|
<span class="cline-any cline-yes">8x</span>
|
|
184
187
|
<span class="cline-any cline-yes">8x</span>
|
|
@@ -254,6 +257,7 @@
|
|
|
254
257
|
<span class="cline-any cline-neutral"> </span>
|
|
255
258
|
<span class="cline-any cline-yes">4x</span>
|
|
256
259
|
<span class="cline-any cline-yes">4x</span>
|
|
260
|
+
<span class="cline-any cline-yes">4x</span>
|
|
257
261
|
<span class="cline-any cline-no"> </span>
|
|
258
262
|
<span class="cline-any cline-no"> </span>
|
|
259
263
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -287,14 +291,12 @@ import { MapContext } from "@mapcomponents/react-core";
|
|
|
287
291
|
const MlImageMarkerLayer = (props) => {
|
|
288
292
|
// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks
|
|
289
293
|
const mapRef = useRef(null);
|
|
290
|
-
const componentId = useRef(
|
|
291
|
-
(props.idPrefix ? <span class="branch-0 cbranch-no" title="branch not covered" >props.idPrefix </span>: "MlOsmLayer-") + uuidv4()
|
|
292
|
-
);
|
|
294
|
+
const componentId = useRef((props.idPrefix ? <span class="branch-0 cbranch-no" title="branch not covered" >props.idPrefix </span>: "MlImageMarkerLayer-") + uuidv4());
|
|
293
295
|
const mapContext = useContext(MapContext);
|
|
294
296
|
const layerInitializedRef = useRef(false);
|
|
295
297
|
const idSuffixRef = useRef(props.idSuffix || new Date().getTime());
|
|
296
298
|
const imageIdRef = useRef(props.imageId || "img_" + new Date().getTime());
|
|
297
|
-
const layerId = useRef(
|
|
299
|
+
const layerId = useRef(props.layerId || componentId.current);
|
|
298
300
|
|
|
299
301
|
useEffect(() => {
|
|
300
302
|
let _componentId = componentId.current;
|
|
@@ -363,6 +365,7 @@ const MlImageMarkerLayer = (props) => {
|
|
|
363
365
|
|
|
364
366
|
layerInitializedRef.current = true;
|
|
365
367
|
|
|
368
|
+
console.log(props.imgSrc);
|
|
366
369
|
if (props.imgSrc) {
|
|
367
370
|
mapRef.current.loadImage(props.imgSrc, <span class="fstat-no" title="function not covered" >fu</span>nction (error, image) {
|
|
368
371
|
<span class="cstat-no" title="statement not covered" > if (error) <span class="cstat-no" title="statement not covered" >throw error;</span></span>
|
|
@@ -396,18 +399,18 @@ export default MlImageMarkerLayer;
|
|
|
396
399
|
</div><!-- /wrapper -->
|
|
397
400
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
398
401
|
Code coverage generated by
|
|
399
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
400
|
-
at
|
|
402
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
403
|
+
at Wed Dec 15 2021 17:14:00 GMT+0000 (Coordinated Universal Time)
|
|
401
404
|
</div>
|
|
402
405
|
</div>
|
|
403
|
-
<script src="
|
|
406
|
+
<script src="../../../prettify.js"></script>
|
|
404
407
|
<script>
|
|
405
408
|
window.onload = function () {
|
|
406
409
|
prettyPrint();
|
|
407
410
|
};
|
|
408
411
|
</script>
|
|
409
|
-
<script src="
|
|
410
|
-
<script src="
|
|
412
|
+
<script src="../../../sorter.js"></script>
|
|
413
|
+
<script src="../../../block-navigation.js"></script>
|
|
411
414
|
</body>
|
|
412
415
|
</html>
|
|
413
416
|
|