@mapcomponents/react-maplibre 0.1.26 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/coverage/clover.xml +456 -479
- package/coverage/coverage-final.json +21 -20
- package/coverage/lcov-report/index.html +94 -79
- package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.js.html +22 -22
- package/coverage/lcov-report/src/components/MapLibreMap/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.js.html +11 -11
- package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +11 -11
- package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.js.html +1 -1
- package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.js.html +4 -4
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.js.html +212 -26
- package/coverage/lcov-report/src/components/MlFollowGps/index.html +19 -19
- package/coverage/lcov-report/src/components/MlGPXViewer/MlGPXViewer.js.html +129 -165
- package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +8 -8
- package/coverage/lcov-report/src/components/MlGPXViewer/index.html +20 -20
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.js.html +45 -297
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +19 -19
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.js.html +2 -2
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayer/MlLayer.js.html +2 -2
- package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.js.html +4 -4
- package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.js.html +3 -3
- package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
- package/coverage/lcov-report/src/components/MlMarker/MlMarker.js.html +1 -1
- package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.js.html +38 -104
- package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +19 -19
- package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.js.html +40 -139
- package/coverage/lcov-report/src/components/MlNavigationTools/index.html +15 -15
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +32 -155
- package/coverage/lcov-report/src/components/MlOsmLayer/index.html +19 -19
- package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +39 -198
- package/coverage/lcov-report/src/components/MlScaleReference/index.html +9 -9
- package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +1 -1
- package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +4 -4
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.js.html +580 -0
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +116 -0
- package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
- package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
- package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.js.html +3 -3
- package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.js.html +8 -11
- package/coverage/lcov-report/src/components/MlWmsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.js.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLoader/index.html +1 -1
- package/coverage/lcov-report/src/hooks/index.html +6 -6
- package/coverage/lcov-report/src/hooks/useMap.js.html +38 -26
- package/coverage/lcov-report/src/hooks/useMapState.js.html +47 -38
- package/coverage/lcov-report/src/hooks/useWms.js.html +1 -1
- package/coverage/lcov-report/src/i18n.js.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/translations/english.js.html +1 -1
- package/coverage/lcov-report/src/translations/german.js.html +1 -1
- package/coverage/lcov-report/src/translations/index.html +1 -1
- package/coverage/lcov.info +813 -858
- package/dist/index.esm.js +210 -425
- package/dist/index.esm.js.map +1 -1
- package/jsdoc.json +3 -3
- package/package.json +19 -13
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.js +6 -2
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.test.js +3 -3
- package/src/components/MlFeatureEditor/MlFeatureEditor.test.js +2 -2
- package/src/components/MlFollowGps/MlFollowGps.js +74 -12
- package/src/components/MlGPXViewer/MlGPXViewer.js +69 -81
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.js +6 -90
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.js +4 -22
- package/src/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.js +2 -2
- package/src/components/MlNavigationCompass/MlNavigationCompass.js +17 -39
- package/src/components/MlNavigationCompass/MlNavigationCompass.test.js +3 -3
- package/src/components/MlNavigationTools/MlNavigationTools.js +30 -63
- package/src/components/MlOsmLayer/MlOsmLayer.js +15 -56
- package/src/components/MlOsmLayer/MlOsmLayer.stories.js +21 -10
- package/src/components/MlOsmLayer/MlOsmLayer.test.js +4 -4
- package/src/components/MlScaleReference/MlScaleReference.js +29 -82
- package/src/components/MlShareMapState/MlShareMapState.stories.js +1 -3
- package/src/components/MlThreeJsLayer/lib/GLTFLoader.js +2369 -2591
- package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.doc.de.md +3 -0
- package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.js +165 -0
- package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.meta.json +15 -0
- package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.stories.js +52 -0
- package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.test.js +20 -0
- package/src/components/MlTransitionGeoJsonLayer/assets/sample_1.json +26 -0
- package/src/components/MlTransitionGeoJsonLayer/assets/sample_2.json +22 -0
- package/src/components/MlTransitionGeoJsonLayer/assets/sample_polygon_1.json +33 -0
- package/src/components/{MlGeoJsonLayer → MlTransitionGeoJsonLayer}/util/transitionFunctions.js +63 -97
- package/src/components/MlWmsLayer/MlWmsLayer.js +1 -2
- package/src/decorators/MapContextDecorator.js +5 -0
- package/src/decorators/MultiMapContextDecorator.js +6 -0
- package/src/hooks/useMap.js +8 -4
- package/src/hooks/useMapState.js +4 -1
- package/src/decorators/EmptyMapContextDecorator.js +0 -25
- package/src/decorators/MapContext3DDecorator.js +0 -39
- package/src/decorators/MapContextDashboardDecorator.js +0 -19
- package/src/decorators/MapContextKlokantechBasicDecorator.js +0 -39
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">60% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>30/50</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">65.21% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>15/23</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">70% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>7/10</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">61.7% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>29/47</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -219,7 +219,69 @@
|
|
|
219
219
|
<a name='L154'></a><a href='#L154'>154</a>
|
|
220
220
|
<a name='L155'></a><a href='#L155'>155</a>
|
|
221
221
|
<a name='L156'></a><a href='#L156'>156</a>
|
|
222
|
-
<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>
|
|
238
|
+
<a name='L173'></a><a href='#L173'>173</a>
|
|
239
|
+
<a name='L174'></a><a href='#L174'>174</a>
|
|
240
|
+
<a name='L175'></a><a href='#L175'>175</a>
|
|
241
|
+
<a name='L176'></a><a href='#L176'>176</a>
|
|
242
|
+
<a name='L177'></a><a href='#L177'>177</a>
|
|
243
|
+
<a name='L178'></a><a href='#L178'>178</a>
|
|
244
|
+
<a name='L179'></a><a href='#L179'>179</a>
|
|
245
|
+
<a name='L180'></a><a href='#L180'>180</a>
|
|
246
|
+
<a name='L181'></a><a href='#L181'>181</a>
|
|
247
|
+
<a name='L182'></a><a href='#L182'>182</a>
|
|
248
|
+
<a name='L183'></a><a href='#L183'>183</a>
|
|
249
|
+
<a name='L184'></a><a href='#L184'>184</a>
|
|
250
|
+
<a name='L185'></a><a href='#L185'>185</a>
|
|
251
|
+
<a name='L186'></a><a href='#L186'>186</a>
|
|
252
|
+
<a name='L187'></a><a href='#L187'>187</a>
|
|
253
|
+
<a name='L188'></a><a href='#L188'>188</a>
|
|
254
|
+
<a name='L189'></a><a href='#L189'>189</a>
|
|
255
|
+
<a name='L190'></a><a href='#L190'>190</a>
|
|
256
|
+
<a name='L191'></a><a href='#L191'>191</a>
|
|
257
|
+
<a name='L192'></a><a href='#L192'>192</a>
|
|
258
|
+
<a name='L193'></a><a href='#L193'>193</a>
|
|
259
|
+
<a name='L194'></a><a href='#L194'>194</a>
|
|
260
|
+
<a name='L195'></a><a href='#L195'>195</a>
|
|
261
|
+
<a name='L196'></a><a href='#L196'>196</a>
|
|
262
|
+
<a name='L197'></a><a href='#L197'>197</a>
|
|
263
|
+
<a name='L198'></a><a href='#L198'>198</a>
|
|
264
|
+
<a name='L199'></a><a href='#L199'>199</a>
|
|
265
|
+
<a name='L200'></a><a href='#L200'>200</a>
|
|
266
|
+
<a name='L201'></a><a href='#L201'>201</a>
|
|
267
|
+
<a name='L202'></a><a href='#L202'>202</a>
|
|
268
|
+
<a name='L203'></a><a href='#L203'>203</a>
|
|
269
|
+
<a name='L204'></a><a href='#L204'>204</a>
|
|
270
|
+
<a name='L205'></a><a href='#L205'>205</a>
|
|
271
|
+
<a name='L206'></a><a href='#L206'>206</a>
|
|
272
|
+
<a name='L207'></a><a href='#L207'>207</a>
|
|
273
|
+
<a name='L208'></a><a href='#L208'>208</a>
|
|
274
|
+
<a name='L209'></a><a href='#L209'>209</a>
|
|
275
|
+
<a name='L210'></a><a href='#L210'>210</a>
|
|
276
|
+
<a name='L211'></a><a href='#L211'>211</a>
|
|
277
|
+
<a name='L212'></a><a href='#L212'>212</a>
|
|
278
|
+
<a name='L213'></a><a href='#L213'>213</a>
|
|
279
|
+
<a name='L214'></a><a href='#L214'>214</a>
|
|
280
|
+
<a name='L215'></a><a href='#L215'>215</a>
|
|
281
|
+
<a name='L216'></a><a href='#L216'>216</a>
|
|
282
|
+
<a name='L217'></a><a href='#L217'>217</a>
|
|
283
|
+
<a name='L218'></a><a href='#L218'>218</a>
|
|
284
|
+
<a name='L219'></a><a href='#L219'>219</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
223
285
|
<span class="cline-any cline-neutral"> </span>
|
|
224
286
|
<span class="cline-any cline-neutral"> </span>
|
|
225
287
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -237,13 +299,13 @@
|
|
|
237
299
|
<span class="cline-any cline-neutral"> </span>
|
|
238
300
|
<span class="cline-any cline-neutral"> </span>
|
|
239
301
|
<span class="cline-any cline-neutral"> </span>
|
|
240
|
-
<span class="cline-any cline-yes">
|
|
302
|
+
<span class="cline-any cline-yes">2x</span>
|
|
241
303
|
<span class="cline-any cline-yes">9x</span>
|
|
242
304
|
<span class="cline-any cline-neutral"> </span>
|
|
243
305
|
<span class="cline-any cline-yes">9x</span>
|
|
244
306
|
<span class="cline-any cline-yes">9x</span>
|
|
245
307
|
<span class="cline-any cline-yes">9x</span>
|
|
246
|
-
<span class="cline-any cline-
|
|
308
|
+
<span class="cline-any cline-yes">9x</span>
|
|
247
309
|
<span class="cline-any cline-yes">9x</span>
|
|
248
310
|
<span class="cline-any cline-neutral"> </span>
|
|
249
311
|
<span class="cline-any cline-yes">9x</span>
|
|
@@ -259,15 +321,47 @@
|
|
|
259
321
|
<span class="cline-any cline-no"> </span>
|
|
260
322
|
<span class="cline-any cline-no"> </span>
|
|
261
323
|
<span class="cline-any cline-no"> </span>
|
|
324
|
+
<span class="cline-any cline-no"> </span>
|
|
325
|
+
<span class="cline-any cline-neutral"> </span>
|
|
262
326
|
<span class="cline-any cline-neutral"> </span>
|
|
263
327
|
<span class="cline-any cline-neutral"> </span>
|
|
264
328
|
<span class="cline-any cline-neutral"> </span>
|
|
329
|
+
<span class="cline-any cline-yes">9x</span>
|
|
330
|
+
<span class="cline-any cline-no"> </span>
|
|
331
|
+
<span class="cline-any cline-no"> </span>
|
|
332
|
+
<span class="cline-any cline-neutral"> </span>
|
|
265
333
|
<span class="cline-any cline-neutral"> </span>
|
|
266
334
|
<span class="cline-any cline-yes">9x</span>
|
|
335
|
+
<span class="cline-any cline-neutral"> </span>
|
|
336
|
+
<span class="cline-any cline-yes">2x</span>
|
|
337
|
+
<span class="cline-any cline-yes">2x</span>
|
|
338
|
+
<span class="cline-any cline-neutral"> </span>
|
|
339
|
+
<span class="cline-any cline-no"> </span>
|
|
340
|
+
<span class="cline-any cline-no"> </span>
|
|
341
|
+
<span class="cline-any cline-no"> </span>
|
|
342
|
+
<span class="cline-any cline-no"> </span>
|
|
343
|
+
<span class="cline-any cline-no"> </span>
|
|
344
|
+
<span class="cline-any cline-no"> </span>
|
|
345
|
+
<span class="cline-any cline-no"> </span>
|
|
267
346
|
<span class="cline-any cline-no"> </span>
|
|
268
347
|
<span class="cline-any cline-no"> </span>
|
|
269
348
|
<span class="cline-any cline-neutral"> </span>
|
|
270
349
|
<span class="cline-any cline-neutral"> </span>
|
|
350
|
+
<span class="cline-any cline-neutral"> </span>
|
|
351
|
+
<span class="cline-any cline-yes">9x</span>
|
|
352
|
+
<span class="cline-any cline-no"> </span>
|
|
353
|
+
<span class="cline-any cline-neutral"> </span>
|
|
354
|
+
<span class="cline-any cline-neutral"> </span>
|
|
355
|
+
<span class="cline-any cline-yes">9x</span>
|
|
356
|
+
<span class="cline-any cline-yes">5x</span>
|
|
357
|
+
<span class="cline-any cline-yes">2x</span>
|
|
358
|
+
<span class="cline-any cline-yes">2x</span>
|
|
359
|
+
<span class="cline-any cline-yes">2x</span>
|
|
360
|
+
<span class="cline-any cline-yes">1x</span>
|
|
361
|
+
<span class="cline-any cline-neutral"> </span>
|
|
362
|
+
<span class="cline-any cline-neutral"> </span>
|
|
363
|
+
<span class="cline-any cline-neutral"> </span>
|
|
364
|
+
<span class="cline-any cline-neutral"> </span>
|
|
271
365
|
<span class="cline-any cline-yes">9x</span>
|
|
272
366
|
<span class="cline-any cline-yes">7x</span>
|
|
273
367
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -314,6 +408,19 @@
|
|
|
314
408
|
<span class="cline-any cline-neutral"> </span>
|
|
315
409
|
<span class="cline-any cline-neutral"> </span>
|
|
316
410
|
<span class="cline-any cline-neutral"> </span>
|
|
411
|
+
<span class="cline-any cline-neutral"> </span>
|
|
412
|
+
<span class="cline-any cline-neutral"> </span>
|
|
413
|
+
<span class="cline-any cline-neutral"> </span>
|
|
414
|
+
<span class="cline-any cline-neutral"> </span>
|
|
415
|
+
<span class="cline-any cline-neutral"> </span>
|
|
416
|
+
<span class="cline-any cline-neutral"> </span>
|
|
417
|
+
<span class="cline-any cline-neutral"> </span>
|
|
418
|
+
<span class="cline-any cline-neutral"> </span>
|
|
419
|
+
<span class="cline-any cline-neutral"> </span>
|
|
420
|
+
<span class="cline-any cline-neutral"> </span>
|
|
421
|
+
<span class="cline-any cline-neutral"> </span>
|
|
422
|
+
<span class="cline-any cline-neutral"> </span>
|
|
423
|
+
<span class="cline-any cline-neutral"> </span>
|
|
317
424
|
<span class="cline-any cline-yes">3x</span>
|
|
318
425
|
<span class="cline-any cline-neutral"> </span>
|
|
319
426
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -324,7 +431,7 @@
|
|
|
324
431
|
<span class="cline-any cline-neutral"> </span>
|
|
325
432
|
<span class="cline-any cline-neutral"> </span>
|
|
326
433
|
<span class="cline-any cline-neutral"> </span>
|
|
327
|
-
<span class="cline-any cline-yes">
|
|
434
|
+
<span class="cline-any cline-yes">2x</span>
|
|
328
435
|
<span class="cline-any cline-neutral"> </span>
|
|
329
436
|
<span class="cline-any cline-neutral"> </span>
|
|
330
437
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -344,7 +451,24 @@
|
|
|
344
451
|
<span class="cline-any cline-neutral"> </span>
|
|
345
452
|
<span class="cline-any cline-neutral"> </span>
|
|
346
453
|
<span class="cline-any cline-neutral"> </span>
|
|
347
|
-
<span class="cline-any cline-
|
|
454
|
+
<span class="cline-any cline-neutral"> </span>
|
|
455
|
+
<span class="cline-any cline-neutral"> </span>
|
|
456
|
+
<span class="cline-any cline-neutral"> </span>
|
|
457
|
+
<span class="cline-any cline-yes">2x</span>
|
|
458
|
+
<span class="cline-any cline-neutral"> </span>
|
|
459
|
+
<span class="cline-any cline-neutral"> </span>
|
|
460
|
+
<span class="cline-any cline-neutral"> </span>
|
|
461
|
+
<span class="cline-any cline-neutral"> </span>
|
|
462
|
+
<span class="cline-any cline-neutral"> </span>
|
|
463
|
+
<span class="cline-any cline-neutral"> </span>
|
|
464
|
+
<span class="cline-any cline-neutral"> </span>
|
|
465
|
+
<span class="cline-any cline-neutral"> </span>
|
|
466
|
+
<span class="cline-any cline-neutral"> </span>
|
|
467
|
+
<span class="cline-any cline-neutral"> </span>
|
|
468
|
+
<span class="cline-any cline-neutral"> </span>
|
|
469
|
+
<span class="cline-any cline-neutral"> </span>
|
|
470
|
+
<span class="cline-any cline-neutral"> </span>
|
|
471
|
+
<span class="cline-any cline-neutral"> </span>
|
|
348
472
|
<span class="cline-any cline-neutral"> </span>
|
|
349
473
|
<span class="cline-any cline-neutral"> </span>
|
|
350
474
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -375,13 +499,13 @@
|
|
|
375
499
|
<span class="cline-any cline-neutral"> </span>
|
|
376
500
|
<span class="cline-any cline-neutral"> </span>
|
|
377
501
|
<span class="cline-any cline-neutral"> </span>
|
|
378
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, { useEffect, useState, useCallback } from "react";
|
|
502
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, { useEffect, useState, useCallback, useMemo } from "react";
|
|
379
503
|
import PropTypes from "prop-types";
|
|
380
504
|
import useMap from "../../hooks/useMap";
|
|
381
505
|
|
|
382
506
|
import Button from "@mui/material/Button";
|
|
383
|
-
import
|
|
384
|
-
import { point, circle } from "@turf/turf";
|
|
507
|
+
import GpsFixedIcon from "@mui/icons-material/GpsFixed";
|
|
508
|
+
import { point, circle, lineArc } from "@turf/turf";
|
|
385
509
|
import MlGeoJsonLayer from "../MlGeoJsonLayer/MlGeoJsonLayer";
|
|
386
510
|
|
|
387
511
|
/**
|
|
@@ -397,10 +521,10 @@ const MlFollowGps = (props) => {
|
|
|
397
521
|
const mapHook = useMap({ mapId: props.mapId, waitForLayer: props.insertBeforeLayer });
|
|
398
522
|
|
|
399
523
|
const [isFollowed, setIsFollowed] = useState(false);
|
|
400
|
-
const [
|
|
524
|
+
const [userLocationGeoJson, setUserLocationGeoJson] = useState(undefined);
|
|
401
525
|
const [locationAccessDenied, setLocationAccessDenied] = useState(false);
|
|
402
|
-
|
|
403
526
|
const [accuracyGeoJson, setAccuracyGeoJson] = useState();
|
|
527
|
+
const [deviceOrientation, setDeviceOrientation] = useState(0);
|
|
404
528
|
|
|
405
529
|
const getLocationSuccess = useCallback(
|
|
406
530
|
<span class="fstat-no" title="function not covered" > (p</span>os) => {
|
|
@@ -412,17 +536,49 @@ const MlFollowGps = (props) => {
|
|
|
412
536
|
speed: 1,
|
|
413
537
|
curve: 1,
|
|
414
538
|
});
|
|
539
|
+
<span class="cstat-no" title="statement not covered" > if (!props.showUserLocation) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
415
540
|
const geoJsonPoint = <span class="cstat-no" title="statement not covered" >point([pos.coords.longitude, pos.coords.latitude]);</span>
|
|
416
|
-
<span class="cstat-no" title="statement not covered" >
|
|
541
|
+
<span class="cstat-no" title="statement not covered" > setUserLocationGeoJson(geoJsonPoint);</span>
|
|
417
542
|
<span class="cstat-no" title="statement not covered" > setAccuracyGeoJson(circle(geoJsonPoint, pos.coords.accuracy / 1000));</span>
|
|
418
543
|
},
|
|
419
|
-
[mapHook.map]
|
|
544
|
+
[mapHook.map, props]
|
|
420
545
|
);
|
|
421
546
|
|
|
422
547
|
const getLocationError = <span class="fstat-no" title="function not covered" >(e</span>rr) => {
|
|
423
548
|
<span class="cstat-no" title="statement not covered" > console.log("Access of user location denied");</span>
|
|
424
549
|
<span class="cstat-no" title="statement not covered" > setLocationAccessDenied(true);</span>
|
|
425
550
|
};
|
|
551
|
+
|
|
552
|
+
const orientationCone = useMemo(
|
|
553
|
+
() => {
|
|
554
|
+
if (!userLocationGeoJson) {
|
|
555
|
+
return undefined;
|
|
556
|
+
}
|
|
557
|
+
let radius = <span class="cstat-no" title="statement not covered" >0.02;</span>
|
|
558
|
+
let bearing1 = <span class="cstat-no" title="statement not covered" >deviceOrientation - 15;</span>
|
|
559
|
+
let bearing2 = <span class="cstat-no" title="statement not covered" >deviceOrientation + 15;</span>
|
|
560
|
+
const options = <span class="cstat-no" title="statement not covered" >{steps: 65};</span>
|
|
561
|
+
let arc = <span class="cstat-no" title="statement not covered" >lineArc(userLocationGeoJson, radius, bearing1, bearing2, options);</span>
|
|
562
|
+
let copy = <span class="cstat-no" title="statement not covered" >arc;</span>
|
|
563
|
+
<span class="cstat-no" title="statement not covered" > copy.geometry.coordinates.push(userLocationGeoJson.geometry.coordinates);</span>
|
|
564
|
+
<span class="cstat-no" title="statement not covered" > copy.geometry.coordinates.slice(0, 0, userLocationGeoJson.geometry.coordinates);</span>
|
|
565
|
+
<span class="cstat-no" title="statement not covered" > return copy;</span>
|
|
566
|
+
}, [deviceOrientation, userLocationGeoJson]
|
|
567
|
+
)
|
|
568
|
+
|
|
569
|
+
const handleOrientation = <span class="fstat-no" title="function not covered" >(e</span>vent) => {
|
|
570
|
+
<span class="cstat-no" title="statement not covered" > setDeviceOrientation(-event.alpha)</span>
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
useEffect(() => {
|
|
574
|
+
if (isFollowed) {
|
|
575
|
+
let _handleOrientation = handleOrientation;
|
|
576
|
+
window.addEventListener('deviceorientation', _handleOrientation)
|
|
577
|
+
return () => {
|
|
578
|
+
window.removeEventListener('deviceorientation', _handleOrientation)
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}, [isFollowed]);
|
|
426
582
|
|
|
427
583
|
useEffect(() => {
|
|
428
584
|
if (!mapHook.map) return;
|
|
@@ -434,11 +590,11 @@ const MlFollowGps = (props) => {
|
|
|
434
590
|
navigator.geolocation.clearWatch(_watchId);
|
|
435
591
|
};
|
|
436
592
|
}
|
|
437
|
-
}, [isFollowed, getLocationSuccess]);
|
|
593
|
+
}, [mapHook.map, isFollowed, getLocationSuccess]);
|
|
438
594
|
|
|
439
595
|
return (
|
|
440
596
|
<>
|
|
441
|
-
{isFollowed &&
|
|
597
|
+
{isFollowed && userLocationGeoJson && (
|
|
442
598
|
<span class="branch-2 cbranch-no" title="branch not covered" > <MlGeoJsonLayer</span>
|
|
443
599
|
geojson={accuracyGeoJson}
|
|
444
600
|
type={"fill"}
|
|
@@ -451,9 +607,22 @@ const MlFollowGps = (props) => {
|
|
|
451
607
|
/>
|
|
452
608
|
)}
|
|
453
609
|
|
|
454
|
-
{isFollowed &&
|
|
610
|
+
{isFollowed && orientationCone && (
|
|
455
611
|
<span class="branch-2 cbranch-no" title="branch not covered" > <MlGeoJsonLayer</span>
|
|
456
|
-
geojson={
|
|
612
|
+
geojson={orientationCone}
|
|
613
|
+
type={"fill"}
|
|
614
|
+
paint={{
|
|
615
|
+
"fill-color": "#0000ff",
|
|
616
|
+
"fill-antialias": false,
|
|
617
|
+
"fill-opacity": 0.3,
|
|
618
|
+
}}
|
|
619
|
+
insertBeforeLayer={props.insertBeforeLayer}
|
|
620
|
+
/>
|
|
621
|
+
)}
|
|
622
|
+
|
|
623
|
+
{isFollowed && userLocationGeoJson && (
|
|
624
|
+
<span class="branch-2 cbranch-no" title="branch not covered" > <MlGeoJsonLayer</span>
|
|
625
|
+
geojson={userLocationGeoJson}
|
|
457
626
|
type={"circle"}
|
|
458
627
|
paint={{
|
|
459
628
|
"circle-color": "#009ee0",
|
|
@@ -474,7 +643,7 @@ const MlFollowGps = (props) => {
|
|
|
474
643
|
}}
|
|
475
644
|
>
|
|
476
645
|
{" "}
|
|
477
|
-
<
|
|
646
|
+
<GpsFixedIcon sx={{ fontSize: props.style.fontSize }} />{" "}
|
|
478
647
|
</Button>
|
|
479
648
|
</>
|
|
480
649
|
);
|
|
@@ -498,6 +667,9 @@ MlFollowGps.defaultProps = {
|
|
|
498
667
|
},
|
|
499
668
|
onColor: "#ececec",
|
|
500
669
|
offColor: "#666",
|
|
670
|
+
showAccuracyCircle: true,
|
|
671
|
+
showUserLocation: true,
|
|
672
|
+
showOrientation: true
|
|
501
673
|
};
|
|
502
674
|
|
|
503
675
|
MlFollowGps.propTypes = {
|
|
@@ -529,6 +701,20 @@ MlFollowGps.propTypes = {
|
|
|
529
701
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
|
|
530
702
|
*/
|
|
531
703
|
circlePaint: PropTypes.object,
|
|
704
|
+
/**
|
|
705
|
+
* By default, if showUserLocation is true, a transparent circle will be drawn around the user location
|
|
706
|
+
* indicating the accuracy (95% confidence level) of the user's location. Set to false to disable.
|
|
707
|
+
*/
|
|
708
|
+
showAccuracyCircle: PropTypes.bool,
|
|
709
|
+
/**
|
|
710
|
+
* By default a dot will be shown on the map at the user's location. Set to false to disable.
|
|
711
|
+
*/
|
|
712
|
+
showUserLocation: PropTypes.bool,
|
|
713
|
+
/**
|
|
714
|
+
* By default a cone will be shown on the map at the user's location to indicate the device's orientation.
|
|
715
|
+
* Set to false to disable.
|
|
716
|
+
*/
|
|
717
|
+
showOrientation: PropTypes.bool,
|
|
532
718
|
};
|
|
533
719
|
export default MlFollowGps;
|
|
534
720
|
</pre></td></tr></table></pre>
|
|
@@ -538,7 +724,7 @@ export default MlFollowGps;
|
|
|
538
724
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
539
725
|
Code coverage generated by
|
|
540
726
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
541
|
-
at
|
|
727
|
+
at Sun Feb 20 2022 16:39:08 GMT+0000 (Coordinated Universal Time)
|
|
542
728
|
</div>
|
|
543
729
|
<script src="../../../prettify.js"></script>
|
|
544
730
|
<script>
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">60% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>30/50</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">65.21% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>15/23</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">70% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>7/10</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">61.7% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>29/47</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -80,17 +80,17 @@
|
|
|
80
80
|
</thead>
|
|
81
81
|
<tbody><tr>
|
|
82
82
|
<td class="file medium" data-value="MlFollowGps.js"><a href="MlFollowGps.js.html">MlFollowGps.js</a></td>
|
|
83
|
-
<td data-value="
|
|
84
|
-
<div class="chart"><div class="cover-fill" style="width:
|
|
83
|
+
<td data-value="60" class="pic medium">
|
|
84
|
+
<div class="chart"><div class="cover-fill" style="width: 60%"></div><div class="cover-empty" style="width: 40%"></div></div>
|
|
85
85
|
</td>
|
|
86
|
-
<td data-value="
|
|
87
|
-
<td data-value="
|
|
88
|
-
<td data-value="
|
|
89
|
-
<td data-value="
|
|
90
|
-
<td data-value="
|
|
91
|
-
<td data-value="
|
|
92
|
-
<td data-value="
|
|
93
|
-
<td data-value="
|
|
86
|
+
<td data-value="60" class="pct medium">60%</td>
|
|
87
|
+
<td data-value="50" class="abs medium">30/50</td>
|
|
88
|
+
<td data-value="65.21" class="pct medium">65.21%</td>
|
|
89
|
+
<td data-value="23" class="abs medium">15/23</td>
|
|
90
|
+
<td data-value="70" class="pct medium">70%</td>
|
|
91
|
+
<td data-value="10" class="abs medium">7/10</td>
|
|
92
|
+
<td data-value="61.7" class="pct medium">61.7%</td>
|
|
93
|
+
<td data-value="47" class="abs medium">29/47</td>
|
|
94
94
|
</tr>
|
|
95
95
|
|
|
96
96
|
</tbody>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at
|
|
104
|
+
at Sun Feb 20 2022 16:39:08 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../../prettify.js"></script>
|
|
107
107
|
<script>
|