@mapcomponents/react-maplibre 0.1.11 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/storybook.yml +10 -5
- package/coverage/clover.xml +894 -747
- package/coverage/coverage-final.json +22 -17
- package/coverage/lcov-report/block-navigation.js +8 -0
- package/coverage/lcov-report/index.html +188 -122
- package/coverage/lcov-report/sorter.js +26 -0
- package/coverage/lcov-report/{components → src/components}/MapLibreMap/MapLibreMap.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MapLibreMap/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlCreatePdfButton/MlCreatePdfButton.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlCreatePdfButton/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlFeatureEditor/MlFeatureEditor.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlFeatureEditor/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlFillExtrusionLayer/MlFillExtrusionLayer.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlFillExtrusionLayer/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlFollowGps/MlFollowGps.js.html +84 -69
- package/coverage/lcov-report/{components → src/components}/MlFollowGps/index.html +27 -21
- package/coverage/lcov-report/{components → src/components}/MlGPXViewer/MlGPXViewer.js.html +73 -61
- package/coverage/lcov-report/{components → src/components}/MlGPXViewer/gpxConverter.js.html +56 -71
- package/coverage/lcov-report/{components → src/components}/MlGPXViewer/index.html +32 -26
- package/coverage/lcov-report/{components → src/components}/MlGeoJsonLayer/MlGeoJsonLayer.js.html +162 -48
- package/coverage/lcov-report/{components → src/components}/MlGeoJsonLayer/index.html +35 -29
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.js.html +311 -0
- package/coverage/lcov-report/{components → src/components}/MlImageMarkerLayer/index.html +35 -29
- package/coverage/lcov-report/{components/MlImageMarkerLayer/MlImageMarkerLayer.js.html → src/components/MlLayer/MlLayer.js.html} +123 -126
- package/coverage/lcov-report/src/components/MlLayer/index.html +117 -0
- package/coverage/lcov-report/{components → src/components}/MlLayerMagnify/MlLayerMagnify.js.html +48 -42
- package/coverage/lcov-report/{components → src/components}/MlLayerMagnify/index.html +31 -25
- package/coverage/lcov-report/{components → src/components}/MlLayerSwipe/MlLayerSwipe.js.html +45 -42
- package/coverage/lcov-report/{components → src/components}/MlLayerSwipe/index.html +31 -25
- package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +755 -0
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +380 -0
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +117 -0
- package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +117 -0
- package/coverage/lcov-report/{components → src/components}/MlMarker/MlMarker.js.html +18 -12
- package/coverage/lcov-report/{components → src/components}/MlMarker/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlNavigationCompass/MlNavigationCompass.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlNavigationCompass/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlNavigationTools/MlNavigationTools.js.html +57 -42
- package/coverage/lcov-report/{components → src/components}/MlNavigationTools/index.html +25 -19
- package/coverage/lcov-report/{components → src/components}/MlOsmLayer/MlOsmLayer.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlOsmLayer/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlScaleReference/MlScaleReference.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlScaleReference/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlShareMapState/MlShareMapState.js.html +224 -26
- package/coverage/lcov-report/{components → src/components}/MlShareMapState/index.html +25 -19
- package/coverage/lcov-report/{components → src/components}/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlSpatialElevationProfile/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlThreeJsLayer/MlThreeJsLayer.js.html +37 -55
- package/coverage/lcov-report/{components → src/components}/MlThreeJsLayer/index.html +31 -25
- package/coverage/lcov-report/{components → src/components}/MlUseMapDebugger/MlUseMapDebugger.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlUseMapDebugger/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlVectorTileLayer/MlVectorTileLayer.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlVectorTileLayer/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlWmsFeatureInfoPopup/index.html +17 -11
- package/coverage/lcov-report/{components → src/components}/MlWmsLayer/MlWmsLayer.js.html +20 -14
- package/coverage/lcov-report/{components → src/components}/MlWmsLayer/index.html +21 -15
- package/coverage/lcov-report/{components → src/components}/MlWmsLoader/MlWmsLoader.js.html +38 -20
- package/coverage/lcov-report/{components → src/components}/MlWmsLoader/index.html +23 -17
- package/coverage/lcov-report/src/hooks/index.html +147 -0
- package/coverage/lcov-report/{components/MlLayer/MlLayer.js.html → src/hooks/useMap.js.html} +86 -119
- package/coverage/lcov-report/{hooks → src/hooks}/useMapState.js.html +98 -92
- package/coverage/lcov-report/{hooks → src/hooks}/useWms.js.html +25 -19
- package/coverage/lcov-report/src/i18n.js.html +167 -0
- package/coverage/lcov-report/src/index.html +117 -0
- package/coverage/lcov-report/src/translations/english.js.html +95 -0
- package/coverage/lcov-report/src/translations/german.js.html +95 -0
- package/coverage/lcov-report/src/translations/index.html +132 -0
- package/coverage/lcov.info +1620 -1306
- package/dist/b556faa3bc6829d2.png +0 -0
- package/dist/index.esm.js +976 -688
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -1
- package/public/assets/dop.png +0 -0
- package/public/assets/historic.png +0 -0
- package/public/assets/osm.png +0 -0
- package/public/thumbnails/MlFollowGps.png +0 -0
- package/public/thumbnails/MlThreeJsLayer.png +0 -0
- package/rollup.config.js +7 -1
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.js +53 -67
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.meta.json +1 -1
- package/src/components/MlFeatureEditor/MlFeatureEditor.meta.json +2 -2
- package/src/components/MlFollowGps/MlFollowGps.js +49 -46
- package/src/components/MlFollowGps/MlFollowGps.meta.json +2 -2
- package/src/components/MlFollowGps/assets/marker.png +0 -0
- package/src/components/MlGPXViewer/MlGPXViewer.js +45 -43
- package/src/components/MlGPXViewer/gpxConverter.js +22 -29
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.js +45 -9
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.meta.json +1 -1
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.js +21 -57
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.test.js +6 -7
- package/src/components/MlLayer/MlLayer.js +28 -6
- package/src/components/MlLayer/MlLayer.test.js +12 -10
- package/src/components/MlLayerMagnify/MlLayerMagnify.js +3 -3
- package/src/components/MlLayerSwipe/MlLayerSwipe.js +4 -5
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.css +17 -0
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.doc.de.md +3 -0
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.js +223 -0
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.meta_.json +15 -0
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.stories.js +106 -0
- package/src/components/MlLayerSwitcher/assets/sample_1.json +26 -0
- package/src/components/MlLayerSwitcher/assets/sample_2.json +22 -0
- package/src/components/MlLayerSwitcher/components/LayerBox.js +98 -0
- package/src/components/MlMarker/MlMarker.js +1 -1
- package/src/components/MlNavigationTools/MlNavigationTools.js +29 -26
- package/src/components/MlScaleReference/MlScaleReference.meta.json +1 -1
- package/src/components/MlScaleReference/MlScaleReference.stories.js +25 -21
- package/src/components/MlShareMapState/MlShareMapState.js +73 -9
- package/src/components/MlShareMapState/MlShareMapState.stories.js +24 -1
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.js +12 -6
- package/src/components/MlThreeJsLayer/MlThreeJsLayer.js +8 -15
- package/src/components/MlVectorTileLayer/MlVectorTileLayer.meta.json +3 -3
- package/src/components/MlWmsLayer/MlWmsLayer.js +1 -1
- package/src/components/MlWmsLoader/MlWmsLoader.js +8 -4
- package/src/components/MlWmsLoader/MlWmsLoader.meta.json +1 -1
- package/src/components/MlWmsLoader/MlWmsLoader.stories.js +5 -4
- package/src/decorators/EmptyMapContextDecorator.js +11 -6
- package/src/decorators/MapContext3DDecorator.js +25 -20
- package/src/decorators/MapContextDashboardDecorator.js +7 -2
- package/src/decorators/MapContextDecorator.js +7 -3
- package/src/decorators/MapContextKlokantechBasicDecorator.js +8 -4
- package/src/decorators/MultiMapContextDecorator.js +2 -1
- package/src/hooks/useMap.js +36 -62
- package/src/hooks/useMapState.js +3 -3
- package/src/hooks/useWms.js +7 -6
- package/src/i18n.js +28 -0
- package/src/index.js +3 -0
- package/src/translations/english.js +4 -0
- package/src/translations/german.js +4 -0
- package/src/ui_components/ImageLoader.js +73 -0
- package/src/ui_components/Sidebar.js +76 -22
- package/src/ui_components/TopToolbar.js +18 -18
- package/coverage/lcov-report/components/MlLayer/index.html +0 -111
- package/coverage/lcov-report/hooks/index.html +0 -141
- package/coverage/lcov-report/hooks/useMap.js.html +0 -377
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
<html lang="en">
|
|
4
4
|
|
|
5
5
|
<head>
|
|
6
|
-
<title>Code coverage report for components/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 Tue Dec 21 2021 11:51:22 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
|
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
<html lang="en">
|
|
4
4
|
|
|
5
5
|
<head>
|
|
6
|
-
<title>Code coverage report for components/MlGPXViewer/gpxConverter.js</title>
|
|
6
|
+
<title>Code coverage report for src/components/MlGPXViewer/gpxConverter.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,7 +19,7 @@
|
|
|
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> gpxConverter.js</h1>
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">2.
|
|
47
|
+
<span class="strong">2.53% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>7/
|
|
49
|
+
<span class='fraction'>7/276</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line low'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
@@ -577,14 +583,20 @@
|
|
|
577
583
|
<a name='L518'></a><a href='#L518'>518</a>
|
|
578
584
|
<a name='L519'></a><a href='#L519'>519</a>
|
|
579
585
|
<a name='L520'></a><a href='#L520'>520</a>
|
|
580
|
-
<a name='L521'></a><a href='#L521'>521</a>
|
|
581
|
-
<
|
|
582
|
-
<
|
|
583
|
-
<
|
|
584
|
-
<
|
|
585
|
-
<
|
|
586
|
-
<
|
|
587
|
-
<
|
|
586
|
+
<a name='L521'></a><a href='#L521'>521</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
587
|
+
<span class="cline-any cline-neutral"> </span>
|
|
588
|
+
<span class="cline-any cline-neutral"> </span>
|
|
589
|
+
<span class="cline-any cline-neutral"> </span>
|
|
590
|
+
<span class="cline-any cline-neutral"> </span>
|
|
591
|
+
<span class="cline-any cline-neutral"> </span>
|
|
592
|
+
<span class="cline-any cline-neutral"> </span>
|
|
593
|
+
<span class="cline-any cline-neutral"> </span>
|
|
594
|
+
<span class="cline-any cline-neutral"> </span>
|
|
595
|
+
<span class="cline-any cline-neutral"> </span>
|
|
596
|
+
<span class="cline-any cline-neutral"> </span>
|
|
597
|
+
<span class="cline-any cline-neutral"> </span>
|
|
598
|
+
<span class="cline-any cline-neutral"> </span>
|
|
599
|
+
<span class="cline-any cline-yes">1x</span>
|
|
588
600
|
<span class="cline-any cline-yes">1x</span>
|
|
589
601
|
<span class="cline-any cline-yes">1x</span>
|
|
590
602
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -732,15 +744,11 @@
|
|
|
732
744
|
<span class="cline-any cline-neutral"> </span>
|
|
733
745
|
<span class="cline-any cline-no"> </span>
|
|
734
746
|
<span class="cline-any cline-no"> </span>
|
|
735
|
-
<span class="cline-any cline-neutral"> </span>
|
|
736
|
-
<span class="cline-any cline-neutral"> </span>
|
|
737
747
|
<span class="cline-any cline-no"> </span>
|
|
738
748
|
<span class="cline-any cline-no"> </span>
|
|
739
749
|
<span class="cline-any cline-no"> </span>
|
|
740
750
|
<span class="cline-any cline-no"> </span>
|
|
741
751
|
<span class="cline-any cline-neutral"> </span>
|
|
742
|
-
<span class="cline-any cline-neutral"> </span>
|
|
743
|
-
<span class="cline-any cline-neutral"> </span>
|
|
744
752
|
<span class="cline-any cline-no"> </span>
|
|
745
753
|
<span class="cline-any cline-neutral"> </span>
|
|
746
754
|
<span class="cline-any cline-no"> </span>
|
|
@@ -773,7 +781,6 @@
|
|
|
773
781
|
<span class="cline-any cline-no"> </span>
|
|
774
782
|
<span class="cline-any cline-no"> </span>
|
|
775
783
|
<span class="cline-any cline-no"> </span>
|
|
776
|
-
<span class="cline-any cline-no"> </span>
|
|
777
784
|
<span class="cline-any cline-neutral"> </span>
|
|
778
785
|
<span class="cline-any cline-neutral"> </span>
|
|
779
786
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -910,10 +917,7 @@
|
|
|
910
917
|
<span class="cline-any cline-no"> </span>
|
|
911
918
|
<span class="cline-any cline-no"> </span>
|
|
912
919
|
<span class="cline-any cline-no"> </span>
|
|
913
|
-
<span class="cline-any cline-neutral"> </span>
|
|
914
920
|
<span class="cline-any cline-no"> </span>
|
|
915
|
-
<span class="cline-any cline-no"> </span>
|
|
916
|
-
<span class="cline-any cline-neutral"> </span>
|
|
917
921
|
<span class="cline-any cline-neutral"> </span>
|
|
918
922
|
<span class="cline-any cline-no"> </span>
|
|
919
923
|
<span class="cline-any cline-no"> </span>
|
|
@@ -922,14 +926,10 @@
|
|
|
922
926
|
<span class="cline-any cline-no"> </span>
|
|
923
927
|
<span class="cline-any cline-no"> </span>
|
|
924
928
|
<span class="cline-any cline-neutral"> </span>
|
|
925
|
-
<span class="cline-any cline-neutral"> </span>
|
|
926
|
-
<span class="cline-any cline-neutral"> </span>
|
|
927
929
|
<span class="cline-any cline-no"> </span>
|
|
928
930
|
<span class="cline-any cline-no"> </span>
|
|
929
931
|
<span class="cline-any cline-neutral"> </span>
|
|
930
932
|
<span class="cline-any cline-neutral"> </span>
|
|
931
|
-
<span class="cline-any cline-neutral"> </span>
|
|
932
|
-
<span class="cline-any cline-neutral"> </span>
|
|
933
933
|
<span class="cline-any cline-no"> </span>
|
|
934
934
|
<span class="cline-any cline-no"> </span>
|
|
935
935
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1034,7 +1034,6 @@
|
|
|
1034
1034
|
<span class="cline-any cline-no"> </span>
|
|
1035
1035
|
<span class="cline-any cline-no"> </span>
|
|
1036
1036
|
<span class="cline-any cline-no"> </span>
|
|
1037
|
-
<span class="cline-any cline-no"> </span>
|
|
1038
1037
|
<span class="cline-any cline-neutral"> </span>
|
|
1039
1038
|
<span class="cline-any cline-neutral"> </span>
|
|
1040
1039
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1088,13 +1087,6 @@
|
|
|
1088
1087
|
<span class="cline-any cline-neutral"> </span>
|
|
1089
1088
|
<span class="cline-any cline-neutral"> </span>
|
|
1090
1089
|
<span class="cline-any cline-no"> </span>
|
|
1091
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1092
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1093
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1094
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1095
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1096
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1097
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1098
1090
|
<span class="cline-any cline-no"> </span>
|
|
1099
1091
|
<span class="cline-any cline-no"> </span>
|
|
1100
1092
|
<span class="cline-any cline-no"> </span>
|
|
@@ -1111,7 +1103,20 @@
|
|
|
1111
1103
|
<span class="cline-any cline-neutral"> </span>
|
|
1112
1104
|
<span class="cline-any cline-neutral"> </span>
|
|
1113
1105
|
<span class="cline-any cline-neutral"> </span>
|
|
1114
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js"
|
|
1106
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">/**
|
|
1107
|
+
* https://github.com/mapbox/togeojson
|
|
1108
|
+
*
|
|
1109
|
+
* Copyright (c) 2016 Mapbox All rights reserved.
|
|
1110
|
+
*
|
|
1111
|
+
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
1112
|
+
*
|
|
1113
|
+
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
1114
|
+
*
|
|
1115
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
1116
|
+
*
|
|
1117
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1118
|
+
*/
|
|
1119
|
+
var toGeoJSON = (function () {
|
|
1115
1120
|
var removeSpace = /\s*/g,
|
|
1116
1121
|
trimSpace = /^\s*|\s*$/g,
|
|
1117
1122
|
splitSpace = /\s+/;
|
|
@@ -1258,15 +1263,11 @@
|
|
|
1258
1263
|
<span class="cstat-no" title="statement not covered" > styleByHash[hash] = styles[k];</span>
|
|
1259
1264
|
}
|
|
1260
1265
|
<span class="cstat-no" title="statement not covered" > for (var l = <span class="cstat-no" title="statement not covered" >0;</span> l < styleMaps.length; l++) {</span>
|
|
1261
|
-
<span class="cstat-no" title="statement not covered" > styleIndex["#" + attr(styleMaps[l], "id")] = okhash(
|
|
1262
|
-
xml2str(styleMaps[l])
|
|
1263
|
-
).toString(16);
|
|
1266
|
+
<span class="cstat-no" title="statement not covered" > styleIndex["#" + attr(styleMaps[l], "id")] = okhash(xml2str(styleMaps[l])).toString(16);</span>
|
|
1264
1267
|
var pairs = <span class="cstat-no" title="statement not covered" >get(styleMaps[l], "Pair");</span>
|
|
1265
1268
|
var pairsMap = <span class="cstat-no" title="statement not covered" >{};</span>
|
|
1266
1269
|
<span class="cstat-no" title="statement not covered" > for (var m = <span class="cstat-no" title="statement not covered" >0;</span> m < pairs.length; m++) {</span>
|
|
1267
|
-
<span class="cstat-no" title="statement not covered" > pairsMap[nodeVal(get1(pairs[m], "key"))] = nodeVal(
|
|
1268
|
-
get1(pairs[m], "styleUrl")
|
|
1269
|
-
);
|
|
1270
|
+
<span class="cstat-no" title="statement not covered" > pairsMap[nodeVal(get1(pairs[m], "key"))] = nodeVal(get1(pairs[m], "styleUrl"));</span>
|
|
1270
1271
|
}
|
|
1271
1272
|
<span class="cstat-no" title="statement not covered" > styleMapIndex["#" + attr(styleMaps[l], "id")] = pairsMap;</span>
|
|
1272
1273
|
}
|
|
@@ -1296,8 +1297,7 @@
|
|
|
1296
1297
|
coords = <span class="cstat-no" title="statement not covered" >[],</span>
|
|
1297
1298
|
times = <span class="cstat-no" title="statement not covered" >[];</span>
|
|
1298
1299
|
<span class="cstat-no" title="statement not covered" > if (elems.length === 0) <span class="cstat-no" title="statement not covered" >elems = get(root, "gx:coord");</span></span>
|
|
1299
|
-
<span class="cstat-no" title="statement not covered" > for (var i = <span class="cstat-no" title="statement not covered" >0;</span> i < elems.length; i++)
|
|
1300
|
-
<span class="cstat-no" title="statement not covered" > coords.push(gxCoord(nodeVal(elems[i])));</span>
|
|
1300
|
+
<span class="cstat-no" title="statement not covered" > for (var i = <span class="cstat-no" title="statement not covered" >0;</span> i < elems.length; i++) <span class="cstat-no" title="statement not covered" >coords.push(gxCoord(nodeVal(elems[i])));</span></span>
|
|
1301
1301
|
var timeElems = <span class="cstat-no" title="statement not covered" >get(root, "when");</span>
|
|
1302
1302
|
<span class="cstat-no" title="statement not covered" > for (var j = <span class="cstat-no" title="statement not covered" >0;</span> j < timeElems.length; j++) <span class="cstat-no" title="statement not covered" >times.push(nodeVal(timeElems[j]));</span></span>
|
|
1303
1303
|
<span class="cstat-no" title="statement not covered" > return {</span>
|
|
@@ -1435,26 +1435,19 @@
|
|
|
1435
1435
|
outline = <span class="cstat-no" title="statement not covered" >nodeVal(get1(polyStyle, "outline"));</span>
|
|
1436
1436
|
<span class="cstat-no" title="statement not covered" > if (pcolor) <span class="cstat-no" title="statement not covered" >properties.fill = pcolor;</span></span>
|
|
1437
1437
|
<span class="cstat-no" title="statement not covered" > if (!isNaN(popacity)) <span class="cstat-no" title="statement not covered" >properties["fill-opacity"] = popacity;</span></span>
|
|
1438
|
-
<span class="cstat-no" title="statement not covered" > if (fill)
|
|
1439
|
-
<span class="cstat-no" title="statement not covered" > properties["fill-opacity"] =</span>
|
|
1440
|
-
fill === "1" ? properties["fill-opacity"] || 1 : 0;
|
|
1438
|
+
<span class="cstat-no" title="statement not covered" > if (fill) <span class="cstat-no" title="statement not covered" >properties["fill-opacity"] = fill === "1" ? properties["fill-opacity"] || 1 : 0;</span></span>
|
|
1441
1439
|
<span class="cstat-no" title="statement not covered" > if (outline)</span>
|
|
1442
|
-
<span class="cstat-no" title="statement not covered" > properties["stroke-opacity"]
|
|
1443
|
-
outline === "1" ? properties["stroke-opacity"] || 1 : 0;
|
|
1440
|
+
<span class="cstat-no" title="statement not covered" > properties["stroke-opacity"] = outline === "1" ? properties["stroke-opacity"] || 1 : 0;</span>
|
|
1444
1441
|
}
|
|
1445
1442
|
<span class="cstat-no" title="statement not covered" > if (extendedData) {</span>
|
|
1446
1443
|
var datas = <span class="cstat-no" title="statement not covered" >get(extendedData, "Data"),</span>
|
|
1447
1444
|
simpleDatas = <span class="cstat-no" title="statement not covered" >get(extendedData, "SimpleData");</span>
|
|
1448
1445
|
|
|
1449
1446
|
<span class="cstat-no" title="statement not covered" > for (i = 0; i < datas.length; i++) {</span>
|
|
1450
|
-
<span class="cstat-no" title="statement not covered" > properties[datas[i].getAttribute("name")] = nodeVal(
|
|
1451
|
-
get1(datas[i], "value")
|
|
1452
|
-
);
|
|
1447
|
+
<span class="cstat-no" title="statement not covered" > properties[datas[i].getAttribute("name")] = nodeVal(get1(datas[i], "value"));</span>
|
|
1453
1448
|
}
|
|
1454
1449
|
<span class="cstat-no" title="statement not covered" > for (i = 0; i < simpleDatas.length; i++) {</span>
|
|
1455
|
-
<span class="cstat-no" title="statement not covered" > properties[simpleDatas[i].getAttribute("name")] = nodeVal(
|
|
1456
|
-
simpleDatas[i]
|
|
1457
|
-
);
|
|
1450
|
+
<span class="cstat-no" title="statement not covered" > properties[simpleDatas[i].getAttribute("name")] = nodeVal(simpleDatas[i]);</span>
|
|
1458
1451
|
}
|
|
1459
1452
|
}
|
|
1460
1453
|
<span class="cstat-no" title="statement not covered" > if (visibility) {</span>
|
|
@@ -1557,8 +1550,7 @@
|
|
|
1557
1550
|
<span class="cstat-no" title="statement not covered" > if (track.length === 0) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
1558
1551
|
var properties = <span class="cstat-no" title="statement not covered" >getProperties(node);</span>
|
|
1559
1552
|
<span class="cstat-no" title="statement not covered" > extend(properties, getLineStyle(get1(node, "extensions")));</span>
|
|
1560
|
-
<span class="cstat-no" title="statement not covered" > if (times.length)
|
|
1561
|
-
<span class="cstat-no" title="statement not covered" > properties.coordTimes = track.length === 1 ? times[0] : times;</span>
|
|
1553
|
+
<span class="cstat-no" title="statement not covered" > if (times.length) <span class="cstat-no" title="statement not covered" >properties.coordTimes = track.length === 1 ? times[0] : times;</span></span>
|
|
1562
1554
|
<span class="cstat-no" title="statement not covered" > if (heartRates.length)</span>
|
|
1563
1555
|
<span class="cstat-no" title="statement not covered" > properties.heartRates = track.length === 1 ? heartRates[0] : heartRates;</span>
|
|
1564
1556
|
<span class="cstat-no" title="statement not covered" > return {</span>
|
|
@@ -1614,14 +1606,7 @@
|
|
|
1614
1606
|
<span class="cstat-no" title="statement not covered" > return style;</span>
|
|
1615
1607
|
}
|
|
1616
1608
|
function <span class="fstat-no" title="function not covered" >getProperties(</span>node) {
|
|
1617
|
-
var prop = <span class="cstat-no" title="statement not covered" >getMulti(node, [
|
|
1618
|
-
"name",
|
|
1619
|
-
"cmt",
|
|
1620
|
-
"desc",
|
|
1621
|
-
"type",
|
|
1622
|
-
"time",
|
|
1623
|
-
"keywords",
|
|
1624
|
-
]),
|
|
1609
|
+
var prop = <span class="cstat-no" title="statement not covered" >getMulti(node, ["name", "cmt", "desc", "type", "time", "keywords"]),</span>
|
|
1625
1610
|
links = <span class="cstat-no" title="statement not covered" >get(node, "link");</span>
|
|
1626
1611
|
<span class="cstat-no" title="statement not covered" > if (links.length) <span class="cstat-no" title="statement not covered" >prop.links = [];</span></span>
|
|
1627
1612
|
<span class="cstat-no" title="statement not covered" > for (var i = <span class="cstat-no" title="statement not covered" >0,</span> link; i < links.length; i++) {</span>
|
|
@@ -1644,18 +1629,18 @@ export default toGeoJSON;
|
|
|
1644
1629
|
</div><!-- /wrapper -->
|
|
1645
1630
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1646
1631
|
Code coverage generated by
|
|
1647
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
1648
|
-
at
|
|
1632
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
1633
|
+
at Tue Dec 21 2021 11:51:22 GMT+0000 (Coordinated Universal Time)
|
|
1649
1634
|
</div>
|
|
1650
1635
|
</div>
|
|
1651
|
-
<script src="
|
|
1636
|
+
<script src="../../../prettify.js"></script>
|
|
1652
1637
|
<script>
|
|
1653
1638
|
window.onload = function () {
|
|
1654
1639
|
prettyPrint();
|
|
1655
1640
|
};
|
|
1656
1641
|
</script>
|
|
1657
|
-
<script src="
|
|
1658
|
-
<script src="
|
|
1642
|
+
<script src="../../../sorter.js"></script>
|
|
1643
|
+
<script src="../../../block-navigation.js"></script>
|
|
1659
1644
|
</body>
|
|
1660
1645
|
</html>
|
|
1661
1646
|
|