@mapcomponents/react-maplibre 0.1.10 → 0.1.14
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 +276 -90
- 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 +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/index.js +1 -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
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
<html lang="en">
|
|
4
4
|
|
|
5
5
|
<head>
|
|
6
|
-
<title>Code coverage report for components/MlFollowGps/MlFollowGps.js</title>
|
|
6
|
+
<title>Code coverage report for src/components/MlFollowGps/MlFollowGps.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/MlFollowGps</a> MlFollowGps.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">66.66% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>28/42</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">67.5% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>27/40</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">
|
|
@@ -213,7 +219,24 @@
|
|
|
213
219
|
<a name='L154'></a><a href='#L154'>154</a>
|
|
214
220
|
<a name='L155'></a><a href='#L155'>155</a>
|
|
215
221
|
<a name='L156'></a><a href='#L156'>156</a>
|
|
216
|
-
<a name='L157'></a><a href='#L157'>157</a
|
|
222
|
+
<a name='L157'></a><a href='#L157'>157</a>
|
|
223
|
+
<a name='L158'></a><a href='#L158'>158</a>
|
|
224
|
+
<a name='L159'></a><a href='#L159'>159</a>
|
|
225
|
+
<a name='L160'></a><a href='#L160'>160</a>
|
|
226
|
+
<a name='L161'></a><a href='#L161'>161</a>
|
|
227
|
+
<a name='L162'></a><a href='#L162'>162</a>
|
|
228
|
+
<a name='L163'></a><a href='#L163'>163</a>
|
|
229
|
+
<a name='L164'></a><a href='#L164'>164</a>
|
|
230
|
+
<a name='L165'></a><a href='#L165'>165</a>
|
|
231
|
+
<a name='L166'></a><a href='#L166'>166</a>
|
|
232
|
+
<a name='L167'></a><a href='#L167'>167</a>
|
|
233
|
+
<a name='L168'></a><a href='#L168'>168</a>
|
|
234
|
+
<a name='L169'></a><a href='#L169'>169</a>
|
|
235
|
+
<a name='L170'></a><a href='#L170'>170</a>
|
|
236
|
+
<a name='L171'></a><a href='#L171'>171</a>
|
|
237
|
+
<a name='L172'></a><a href='#L172'>172</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
238
|
+
<span class="cline-any cline-neutral"> </span>
|
|
239
|
+
<span class="cline-any cline-neutral"> </span>
|
|
217
240
|
<span class="cline-any cline-neutral"> </span>
|
|
218
241
|
<span class="cline-any cline-neutral"> </span>
|
|
219
242
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -244,11 +267,11 @@
|
|
|
244
267
|
<span class="cline-any cline-yes">7x</span>
|
|
245
268
|
<span class="cline-any cline-yes">7x</span>
|
|
246
269
|
<span class="cline-any cline-yes">7x</span>
|
|
270
|
+
<span class="cline-any cline-yes">7x</span>
|
|
247
271
|
<span class="cline-any cline-neutral"> </span>
|
|
248
272
|
<span class="cline-any cline-yes">7x</span>
|
|
249
273
|
<span class="cline-any cline-yes">2x</span>
|
|
250
274
|
<span class="cline-any cline-neutral"> </span>
|
|
251
|
-
<span class="cline-any cline-neutral"> </span>
|
|
252
275
|
<span class="cline-any cline-yes">2x</span>
|
|
253
276
|
<span class="cline-any cline-neutral"> </span>
|
|
254
277
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -277,11 +300,11 @@
|
|
|
277
300
|
<span class="cline-any cline-yes">2x</span>
|
|
278
301
|
<span class="cline-any cline-neutral"> </span>
|
|
279
302
|
<span class="cline-any cline-neutral"> </span>
|
|
280
|
-
<span class="cline-any cline-neutral"> </span>
|
|
281
303
|
<span class="cline-any cline-yes">7x</span>
|
|
282
304
|
<span class="cline-any cline-no"> </span>
|
|
283
305
|
<span class="cline-any cline-no"> </span>
|
|
284
306
|
<span class="cline-any cline-no"> </span>
|
|
307
|
+
<span class="cline-any cline-no"> </span>
|
|
285
308
|
<span class="cline-any cline-neutral"> </span>
|
|
286
309
|
<span class="cline-any cline-neutral"> </span>
|
|
287
310
|
<span class="cline-any cline-yes">7x</span>
|
|
@@ -323,6 +346,18 @@
|
|
|
323
346
|
<span class="cline-any cline-neutral"> </span>
|
|
324
347
|
<span class="cline-any cline-neutral"> </span>
|
|
325
348
|
<span class="cline-any cline-neutral"> </span>
|
|
349
|
+
<span class="cline-any cline-neutral"> </span>
|
|
350
|
+
<span class="cline-any cline-neutral"> </span>
|
|
351
|
+
<span class="cline-any cline-neutral"> </span>
|
|
352
|
+
<span class="cline-any cline-neutral"> </span>
|
|
353
|
+
<span class="cline-any cline-neutral"> </span>
|
|
354
|
+
<span class="cline-any cline-neutral"> </span>
|
|
355
|
+
<span class="cline-any cline-neutral"> </span>
|
|
356
|
+
<span class="cline-any cline-neutral"> </span>
|
|
357
|
+
<span class="cline-any cline-neutral"> </span>
|
|
358
|
+
<span class="cline-any cline-neutral"> </span>
|
|
359
|
+
<span class="cline-any cline-neutral"> </span>
|
|
360
|
+
<span class="cline-any cline-neutral"> </span>
|
|
326
361
|
<span class="cline-any cline-yes">3x</span>
|
|
327
362
|
<span class="cline-any cline-yes">1x</span>
|
|
328
363
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -358,6 +393,7 @@
|
|
|
358
393
|
<span class="cline-any cline-neutral"> </span>
|
|
359
394
|
<span class="cline-any cline-neutral"> </span>
|
|
360
395
|
<span class="cline-any cline-neutral"> </span>
|
|
396
|
+
<span class="cline-any cline-neutral"> </span>
|
|
361
397
|
<span class="cline-any cline-yes">1x</span>
|
|
362
398
|
<span class="cline-any cline-neutral"> </span>
|
|
363
399
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -380,6 +416,8 @@ import {point} from "@turf/turf"
|
|
|
380
416
|
import MlGeoJsonLayer from "../MlGeoJsonLayer/MlGeoJsonLayer";
|
|
381
417
|
import MlImageMarkerLayer from "../MlImageMarkerLayer/MlImageMarkerLayer";
|
|
382
418
|
|
|
419
|
+
import marker from "./assets/marker.png";
|
|
420
|
+
|
|
383
421
|
/**
|
|
384
422
|
* Adds a button that makes the map follow the users GPS position using
|
|
385
423
|
* navigator.geolocation.watchPosition if activated
|
|
@@ -400,10 +438,10 @@ const MlFollowGps = (props) => {
|
|
|
400
438
|
const initializedRef = useRef(false);
|
|
401
439
|
const mapRef = useRef(undefined);
|
|
402
440
|
const componentId = useRef((props.idPrefix ? <span class="branch-0 cbranch-no" title="branch not covered" >props.idPrefix </span>: "MlFollowGps-") + uuidv4());
|
|
441
|
+
const [accuracyRadius, setAccuracyRadius] = useState(30);
|
|
403
442
|
|
|
404
443
|
useEffect(() => {
|
|
405
444
|
let _componentId = componentId.current;
|
|
406
|
-
|
|
407
445
|
|
|
408
446
|
return <span class="fstat-no" title="function not covered" >()</span> => {
|
|
409
447
|
// This is the cleanup function, it is called when this react component is removed from react-dom
|
|
@@ -431,12 +469,12 @@ const MlFollowGps = (props) => {
|
|
|
431
469
|
initializedRef.current = true;
|
|
432
470
|
mapRef.current = mapContext.getMap(props.mapId);
|
|
433
471
|
mapRef.current.setCenter([7.132122000552613, 50.716405378037706]);
|
|
434
|
-
|
|
435
472
|
}, [mapContext.mapIds, mapContext, props.mapId]);
|
|
436
473
|
|
|
437
474
|
const getLocationSuccess = <span class="fstat-no" title="function not covered" >(p</span>os) => {
|
|
438
475
|
<span class="cstat-no" title="statement not covered" > if (!mapRef.current) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
439
476
|
<span class="cstat-no" title="statement not covered" > mapRef.current.setCenter([pos.coords.longitude, pos.coords.latitude]);</span>
|
|
477
|
+
<span class="cstat-no" title="statement not covered" > setAccuracyRadius(pos.coords.accuracy);</span>
|
|
440
478
|
<span class="cstat-no" title="statement not covered" > setGeoJson(point([pos.coords.longitude, pos.coords.latitude]));</span>
|
|
441
479
|
};
|
|
442
480
|
|
|
@@ -447,36 +485,48 @@ const MlFollowGps = (props) => {
|
|
|
447
485
|
|
|
448
486
|
return (
|
|
449
487
|
<>
|
|
450
|
-
{isFollowed && geoJson &&
|
|
451
|
-
<span class="branch-2 cbranch-no" title="branch not covered" >
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
488
|
+
{isFollowed && geoJson && (
|
|
489
|
+
<span class="branch-2 cbranch-no" title="branch not covered" > <MlGeoJsonLayer</span>
|
|
490
|
+
geojson={geoJson}
|
|
491
|
+
type={"circle"}
|
|
492
|
+
paint={{
|
|
493
|
+
"circle-radius": {
|
|
494
|
+
stops: [
|
|
495
|
+
[0, 0],
|
|
496
|
+
[
|
|
497
|
+
20,
|
|
498
|
+
accuracyRadius /
|
|
499
|
+
0.075 /
|
|
500
|
+
Math.cos((geoJson.geometry.coordinates[1] * Math.PI) / 180),
|
|
501
|
+
],
|
|
502
|
+
],
|
|
503
|
+
base: 2,
|
|
504
|
+
},
|
|
505
|
+
"circle-color": "#ee7700",
|
|
506
|
+
"circle-opacity": 0.5,
|
|
507
|
+
}}
|
|
508
|
+
/>
|
|
509
|
+
)}
|
|
459
510
|
|
|
460
|
-
{isFollowed && geoJson &&
|
|
461
|
-
<span class="branch-2 cbranch-no" title="branch not covered" >
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
}
|
|
511
|
+
{isFollowed && geoJson && (
|
|
512
|
+
<span class="branch-2 cbranch-no" title="branch not covered" > <MlImageMarkerLayer</span>
|
|
513
|
+
options={{
|
|
514
|
+
type: "symbol",
|
|
515
|
+
source: {
|
|
516
|
+
type: "geojson",
|
|
517
|
+
data: geoJson,
|
|
518
|
+
},
|
|
519
|
+
layout: {
|
|
520
|
+
"icon-size": 0.1,
|
|
521
|
+
"icon-offset": [0, -340],
|
|
522
|
+
},
|
|
523
|
+
}}
|
|
524
|
+
imgSrc={marker}
|
|
525
|
+
/>
|
|
526
|
+
)}
|
|
477
527
|
|
|
478
528
|
<Button
|
|
479
|
-
sx={{zIndex: 1002, color: isFollowed ? "#bbb" : "#666", ...props.style}}
|
|
529
|
+
sx={{ zIndex: 1002, color: isFollowed ? "#bbb" : "#666", ...props.style }}
|
|
480
530
|
disabled={locationAccessDenied}
|
|
481
531
|
onClick={() => {
|
|
482
532
|
if (isFollowed) {
|
|
@@ -491,7 +541,7 @@ const MlFollowGps = (props) => {
|
|
|
491
541
|
}}
|
|
492
542
|
>
|
|
493
543
|
{" "}
|
|
494
|
-
<RoomIcon sx={{}}/>{" "}
|
|
544
|
+
<RoomIcon sx={{fontSize: props.style.fontSize}}/>{" "}
|
|
495
545
|
</Button>
|
|
496
546
|
</>
|
|
497
547
|
);
|
|
@@ -507,6 +557,7 @@ MlFollowGps.defaultProps = {
|
|
|
507
557
|
backgroundColor: "#414141",
|
|
508
558
|
borderRadius: "23%",
|
|
509
559
|
margin: 0.15,
|
|
560
|
+
fontSize: "1.3em",
|
|
510
561
|
":hover": {
|
|
511
562
|
backgroundColor: "#515151",
|
|
512
563
|
color: "#ececec",
|
|
@@ -531,18 +582,18 @@ export default MlFollowGps;
|
|
|
531
582
|
</div><!-- /wrapper -->
|
|
532
583
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
533
584
|
Code coverage generated by
|
|
534
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
535
|
-
at
|
|
585
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
586
|
+
at Wed Dec 15 2021 17:41:09 GMT+0000 (Coordinated Universal Time)
|
|
536
587
|
</div>
|
|
537
588
|
</div>
|
|
538
|
-
<script src="
|
|
589
|
+
<script src="../../../prettify.js"></script>
|
|
539
590
|
<script>
|
|
540
591
|
window.onload = function () {
|
|
541
592
|
prettyPrint();
|
|
542
593
|
};
|
|
543
594
|
</script>
|
|
544
|
-
<script src="
|
|
545
|
-
<script src="
|
|
595
|
+
<script src="../../../sorter.js"></script>
|
|
596
|
+
<script src="../../../block-navigation.js"></script>
|
|
546
597
|
</body>
|
|
547
598
|
</html>
|
|
548
599
|
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
<html lang="en">
|
|
4
4
|
|
|
5
5
|
<head>
|
|
6
|
-
<title>Code coverage report for components/MlFollowGps</title>
|
|
6
|
+
<title>Code coverage report for src/components/MlFollowGps</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> src/components/MlFollowGps</h1>
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">66.66% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>28/42</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">67.5% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>27/40</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="MlFollowGps.js"><a href="MlFollowGps.js.html">MlFollowGps.js</a></td>
|
|
77
|
-
<td data-value="
|
|
78
|
-
<div class="chart"><div class="cover-fill" style="width:
|
|
83
|
+
<td data-value="66.66" class="pic medium">
|
|
84
|
+
<div class="chart"><div class="cover-fill" style="width: 66%"></div><div class="cover-empty" style="width: 34%"></div></div>
|
|
79
85
|
</td>
|
|
80
|
-
<td data-value="
|
|
81
|
-
<td data-value="
|
|
86
|
+
<td data-value="66.66" class="pct medium">66.66%</td>
|
|
87
|
+
<td data-value="42" class="abs medium">28/42</td>
|
|
82
88
|
<td data-value="59.09" class="pct medium">59.09%</td>
|
|
83
89
|
<td data-value="22" class="abs medium">13/22</td>
|
|
84
90
|
<td data-value="57.14" class="pct medium">57.14%</td>
|
|
85
91
|
<td data-value="7" class="abs medium">4/7</td>
|
|
86
|
-
<td data-value="
|
|
87
|
-
<td data-value="
|
|
92
|
+
<td data-value="67.5" class="pct medium">67.5%</td>
|
|
93
|
+
<td data-value="40" class="abs medium">27/40</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:41:09 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/MlGPXViewer/MlGPXViewer.js</title>
|
|
6
|
+
<title>Code coverage report for src/components/MlGPXViewer/MlGPXViewer.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,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> / <a href="index.html">src/components/MlGPXViewer</a> MlGPXViewer.js</h1>
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">51.
|
|
26
|
+
<span class="strong">51.56% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>66/128</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">26.66% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>8/30</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">52.
|
|
47
|
+
<span class="strong">52.89% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>64/121</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">
|
|
@@ -426,7 +432,10 @@
|
|
|
426
432
|
<a name='L367'></a><a href='#L367'>367</a>
|
|
427
433
|
<a name='L368'></a><a href='#L368'>368</a>
|
|
428
434
|
<a name='L369'></a><a href='#L369'>369</a>
|
|
429
|
-
<a name='L370'></a><a href='#L370'>370</a
|
|
435
|
+
<a name='L370'></a><a href='#L370'>370</a>
|
|
436
|
+
<a name='L371'></a><a href='#L371'>371</a>
|
|
437
|
+
<a name='L372'></a><a href='#L372'>372</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
438
|
+
<span class="cline-any cline-neutral"> </span>
|
|
430
439
|
<span class="cline-any cline-neutral"> </span>
|
|
431
440
|
<span class="cline-any cline-neutral"> </span>
|
|
432
441
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -466,6 +475,7 @@
|
|
|
466
475
|
<span class="cline-any cline-yes">12x</span>
|
|
467
476
|
<span class="cline-any cline-yes">12x</span>
|
|
468
477
|
<span class="cline-any cline-yes">12x</span>
|
|
478
|
+
<span class="cline-any cline-yes">12x</span>
|
|
469
479
|
<span class="cline-any cline-neutral"> </span>
|
|
470
480
|
<span class="cline-any cline-yes">12x</span>
|
|
471
481
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -795,24 +805,25 @@
|
|
|
795
805
|
<span class="cline-any cline-neutral"> </span>
|
|
796
806
|
<span class="cline-any cline-neutral"> </span>
|
|
797
807
|
<span class="cline-any cline-neutral"> </span>
|
|
798
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, {
|
|
808
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, {useContext, useRef, useEffect, useState} from "react";
|
|
799
809
|
import PropTypes from "prop-types";
|
|
800
|
-
import {
|
|
801
|
-
import {
|
|
810
|
+
import {MapContext} from "@mapcomponents/react-core";
|
|
811
|
+
import {bbox} from "@turf/turf";
|
|
802
812
|
import Divider from "@mui/material/Divider";
|
|
803
813
|
import Typography from "@mui/material/Typography";
|
|
804
814
|
import Drawer from "@mui/material/Drawer";
|
|
805
815
|
import IconButton from "@mui/material/IconButton";
|
|
806
816
|
import InfoIcon from "@mui/icons-material/Info";
|
|
807
817
|
import FileCopy from "@mui/icons-material/FileCopy";
|
|
808
|
-
import {
|
|
818
|
+
import {Popup} from "maplibre-gl";
|
|
809
819
|
import List from "@mui/material/List";
|
|
810
820
|
import ListItem from "@mui/material/ListItem";
|
|
811
821
|
import ListItemText from "@mui/material/ListItemText";
|
|
812
822
|
import GeoJsonContext from "./util/GeoJsonContext";
|
|
813
823
|
import toGeoJSON from "./gpxConverter";
|
|
824
|
+
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
814
825
|
|
|
815
|
-
import {
|
|
826
|
+
import {v4 as uuidv4} from "uuid";
|
|
816
827
|
|
|
817
828
|
/**
|
|
818
829
|
* MlGPXViewer returns a dropzone and a button to load a GPX Track into the map.
|
|
@@ -835,6 +846,7 @@ const MlGPXViewer = (props) => {
|
|
|
835
846
|
const [zIndex, setZIndex] = useState(0);
|
|
836
847
|
const [metaData, setMetaData] = useState([]);
|
|
837
848
|
const fileupload = useRef(null);
|
|
849
|
+
const mediaIsMobile = useMediaQuery("(max-width:900px)");
|
|
838
850
|
|
|
839
851
|
const popup = useRef(
|
|
840
852
|
new Popup({
|
|
@@ -1052,42 +1064,42 @@ const MlGPXViewer = (props) => {
|
|
|
1052
1064
|
};
|
|
1053
1065
|
return (
|
|
1054
1066
|
<>
|
|
1055
|
-
<
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
<
|
|
1090
|
-
</
|
|
1067
|
+
<div style={{
|
|
1068
|
+
position: "fixed",
|
|
1069
|
+
right: "5px",
|
|
1070
|
+
bottom: mediaIsMobile ? <span class="branch-0 cbranch-no" title="branch not covered" >"40px" </span>: "25px",
|
|
1071
|
+
display: "flex",
|
|
1072
|
+
flexDirection: "column",
|
|
1073
|
+
gap: "5px",
|
|
1074
|
+
zIndex: 1000,
|
|
1075
|
+
}}>
|
|
1076
|
+
<IconButton
|
|
1077
|
+
onClick={manualUpload}
|
|
1078
|
+
style={{
|
|
1079
|
+
backgroundColor: "rgba(255,255,255,1)",
|
|
1080
|
+
}}
|
|
1081
|
+
size="large"
|
|
1082
|
+
>
|
|
1083
|
+
<input
|
|
1084
|
+
ref={fileupload}
|
|
1085
|
+
onChange={fileUploadOnChange}
|
|
1086
|
+
type="file"
|
|
1087
|
+
id="input"
|
|
1088
|
+
multiple
|
|
1089
|
+
style={{display: "none"}}
|
|
1090
|
+
></input>
|
|
1091
|
+
<FileCopy/>
|
|
1092
|
+
</IconButton>
|
|
1093
|
+
<IconButton
|
|
1094
|
+
onClick={toogleDrawer}
|
|
1095
|
+
style={{
|
|
1096
|
+
backgroundColor: "rgba(255,255,255,1)",
|
|
1097
|
+
}}
|
|
1098
|
+
size="large"
|
|
1099
|
+
>
|
|
1100
|
+
<InfoIcon/>
|
|
1101
|
+
</IconButton>
|
|
1102
|
+
</div>
|
|
1091
1103
|
<Drawer variant="persistent" anchor="left" open={open}>
|
|
1092
1104
|
<Typography
|
|
1093
1105
|
variant="h6"
|
|
@@ -1099,11 +1111,11 @@ const MlGPXViewer = (props) => {
|
|
|
1099
1111
|
>
|
|
1100
1112
|
Informationen zur Route
|
|
1101
1113
|
</Typography>
|
|
1102
|
-
<Divider
|
|
1114
|
+
<Divider/>
|
|
1103
1115
|
<List>
|
|
1104
1116
|
{metaData.map(<span class="fstat-no" title="function not covered" >(i</span>tem) => (
|
|
1105
1117
|
<span class="cstat-no" title="statement not covered" > <ListItem key={`item--${item.id}`}></span>
|
|
1106
|
-
<ListItemText primary={item.value}
|
|
1118
|
+
<ListItemText primary={item.value}/>
|
|
1107
1119
|
</ListItem>
|
|
1108
1120
|
))}
|
|
1109
1121
|
</List>
|
|
@@ -1170,18 +1182,18 @@ export default MlGPXViewer;
|
|
|
1170
1182
|
</div><!-- /wrapper -->
|
|
1171
1183
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1172
1184
|
Code coverage generated by
|
|
1173
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
1174
|
-
at
|
|
1185
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
1186
|
+
at Wed Dec 15 2021 17:41:09 GMT+0000 (Coordinated Universal Time)
|
|
1175
1187
|
</div>
|
|
1176
1188
|
</div>
|
|
1177
|
-
<script src="
|
|
1189
|
+
<script src="../../../prettify.js"></script>
|
|
1178
1190
|
<script>
|
|
1179
1191
|
window.onload = function () {
|
|
1180
1192
|
prettyPrint();
|
|
1181
1193
|
};
|
|
1182
1194
|
</script>
|
|
1183
|
-
<script src="
|
|
1184
|
-
<script src="
|
|
1195
|
+
<script src="../../../sorter.js"></script>
|
|
1196
|
+
<script src="../../../block-navigation.js"></script>
|
|
1185
1197
|
</body>
|
|
1186
1198
|
</html>
|
|
1187
1199
|
|