@mapcomponents/react-maplibre 0.1.25 → 0.1.29
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 +78 -7
- package/coverage/clover.xml +463 -486
- 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 +234 -36
- 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 +1 -1
- 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 +2 -2
- 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 +827 -872
- package/dist/index.esm.js +281 -490
- package/dist/index.esm.js.map +1 -1
- package/jsdoc.json +3 -3
- package/package.json +13 -10
- 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 +85 -19
- 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/hooks/useWms.js +1 -1
- package/dist/b556faa3bc6829d2.png +0 -0
- package/src/components/MlFollowGps/assets/marker.png +0 -0
- 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
|
|
|
@@ -215,7 +215,73 @@
|
|
|
215
215
|
<a name='L150'></a><a href='#L150'>150</a>
|
|
216
216
|
<a name='L151'></a><a href='#L151'>151</a>
|
|
217
217
|
<a name='L152'></a><a href='#L152'>152</a>
|
|
218
|
-
<a name='L153'></a><a href='#L153'>153</a
|
|
218
|
+
<a name='L153'></a><a href='#L153'>153</a>
|
|
219
|
+
<a name='L154'></a><a href='#L154'>154</a>
|
|
220
|
+
<a name='L155'></a><a href='#L155'>155</a>
|
|
221
|
+
<a name='L156'></a><a href='#L156'>156</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>
|
|
219
285
|
<span class="cline-any cline-neutral"> </span>
|
|
220
286
|
<span class="cline-any cline-neutral"> </span>
|
|
221
287
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -233,16 +299,13 @@
|
|
|
233
299
|
<span class="cline-any cline-neutral"> </span>
|
|
234
300
|
<span class="cline-any cline-neutral"> </span>
|
|
235
301
|
<span class="cline-any cline-neutral"> </span>
|
|
236
|
-
<span class="cline-any cline-
|
|
237
|
-
<span class="cline-any cline-neutral"> </span>
|
|
238
|
-
<span class="cline-any cline-neutral"> </span>
|
|
239
|
-
<span class="cline-any cline-yes">1x</span>
|
|
302
|
+
<span class="cline-any cline-yes">2x</span>
|
|
240
303
|
<span class="cline-any cline-yes">9x</span>
|
|
241
304
|
<span class="cline-any cline-neutral"> </span>
|
|
242
305
|
<span class="cline-any cline-yes">9x</span>
|
|
243
306
|
<span class="cline-any cline-yes">9x</span>
|
|
244
307
|
<span class="cline-any cline-yes">9x</span>
|
|
245
|
-
<span class="cline-any cline-
|
|
308
|
+
<span class="cline-any cline-yes">9x</span>
|
|
246
309
|
<span class="cline-any cline-yes">9x</span>
|
|
247
310
|
<span class="cline-any cline-neutral"> </span>
|
|
248
311
|
<span class="cline-any cline-yes">9x</span>
|
|
@@ -250,6 +313,12 @@
|
|
|
250
313
|
<span class="cline-any cline-no"> </span>
|
|
251
314
|
<span class="cline-any cline-neutral"> </span>
|
|
252
315
|
<span class="cline-any cline-no"> </span>
|
|
316
|
+
<span class="cline-any cline-neutral"> </span>
|
|
317
|
+
<span class="cline-any cline-neutral"> </span>
|
|
318
|
+
<span class="cline-any cline-neutral"> </span>
|
|
319
|
+
<span class="cline-any cline-neutral"> </span>
|
|
320
|
+
<span class="cline-any cline-neutral"> </span>
|
|
321
|
+
<span class="cline-any cline-no"> </span>
|
|
253
322
|
<span class="cline-any cline-no"> </span>
|
|
254
323
|
<span class="cline-any cline-no"> </span>
|
|
255
324
|
<span class="cline-any cline-no"> </span>
|
|
@@ -263,6 +332,37 @@
|
|
|
263
332
|
<span class="cline-any cline-neutral"> </span>
|
|
264
333
|
<span class="cline-any cline-neutral"> </span>
|
|
265
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>
|
|
346
|
+
<span class="cline-any cline-no"> </span>
|
|
347
|
+
<span class="cline-any cline-no"> </span>
|
|
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-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>
|
|
365
|
+
<span class="cline-any cline-yes">9x</span>
|
|
266
366
|
<span class="cline-any cline-yes">7x</span>
|
|
267
367
|
<span class="cline-any cline-neutral"> </span>
|
|
268
368
|
<span class="cline-any cline-yes">5x</span>
|
|
@@ -306,6 +406,21 @@
|
|
|
306
406
|
<span class="cline-any cline-neutral"> </span>
|
|
307
407
|
<span class="cline-any cline-neutral"> </span>
|
|
308
408
|
<span class="cline-any cline-neutral"> </span>
|
|
409
|
+
<span class="cline-any cline-neutral"> </span>
|
|
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>
|
|
309
424
|
<span class="cline-any cline-yes">3x</span>
|
|
310
425
|
<span class="cline-any cline-neutral"> </span>
|
|
311
426
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -316,7 +431,7 @@
|
|
|
316
431
|
<span class="cline-any cline-neutral"> </span>
|
|
317
432
|
<span class="cline-any cline-neutral"> </span>
|
|
318
433
|
<span class="cline-any cline-neutral"> </span>
|
|
319
|
-
<span class="cline-any cline-yes">
|
|
434
|
+
<span class="cline-any cline-yes">2x</span>
|
|
320
435
|
<span class="cline-any cline-neutral"> </span>
|
|
321
436
|
<span class="cline-any cline-neutral"> </span>
|
|
322
437
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -336,7 +451,22 @@
|
|
|
336
451
|
<span class="cline-any cline-neutral"> </span>
|
|
337
452
|
<span class="cline-any cline-neutral"> </span>
|
|
338
453
|
<span class="cline-any cline-neutral"> </span>
|
|
339
|
-
<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>
|
|
340
470
|
<span class="cline-any cline-neutral"> </span>
|
|
341
471
|
<span class="cline-any cline-neutral"> </span>
|
|
342
472
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -367,17 +497,16 @@
|
|
|
367
497
|
<span class="cline-any cline-neutral"> </span>
|
|
368
498
|
<span class="cline-any cline-neutral"> </span>
|
|
369
499
|
<span class="cline-any cline-neutral"> </span>
|
|
370
|
-
<span class="cline-any cline-neutral"> </span
|
|
500
|
+
<span class="cline-any cline-neutral"> </span>
|
|
501
|
+
<span class="cline-any cline-neutral"> </span>
|
|
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";
|
|
371
503
|
import PropTypes from "prop-types";
|
|
372
504
|
import useMap from "../../hooks/useMap";
|
|
373
505
|
|
|
374
506
|
import Button from "@mui/material/Button";
|
|
375
|
-
import
|
|
376
|
-
import { point, circle } from "@turf/turf";
|
|
507
|
+
import GpsFixedIcon from "@mui/icons-material/GpsFixed";
|
|
508
|
+
import { point, circle, lineArc } from "@turf/turf";
|
|
377
509
|
import MlGeoJsonLayer from "../MlGeoJsonLayer/MlGeoJsonLayer";
|
|
378
|
-
import MlImageMarkerLayer from "../MlImageMarkerLayer/MlImageMarkerLayer";
|
|
379
|
-
|
|
380
|
-
import marker from "./assets/marker.png";
|
|
381
510
|
|
|
382
511
|
/**
|
|
383
512
|
* Adds a button that makes the map follow the users GPS position using
|
|
@@ -392,27 +521,64 @@ const MlFollowGps = (props) => {
|
|
|
392
521
|
const mapHook = useMap({ mapId: props.mapId, waitForLayer: props.insertBeforeLayer });
|
|
393
522
|
|
|
394
523
|
const [isFollowed, setIsFollowed] = useState(false);
|
|
395
|
-
const [
|
|
524
|
+
const [userLocationGeoJson, setUserLocationGeoJson] = useState(undefined);
|
|
396
525
|
const [locationAccessDenied, setLocationAccessDenied] = useState(false);
|
|
397
|
-
|
|
398
526
|
const [accuracyGeoJson, setAccuracyGeoJson] = useState();
|
|
527
|
+
const [deviceOrientation, setDeviceOrientation] = useState(0);
|
|
399
528
|
|
|
400
529
|
const getLocationSuccess = useCallback(
|
|
401
530
|
<span class="fstat-no" title="function not covered" > (p</span>os) => {
|
|
402
531
|
<span class="cstat-no" title="statement not covered" > if (!mapHook.map) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
403
532
|
|
|
404
|
-
<span class="cstat-no" title="statement not covered" > mapHook.map.
|
|
533
|
+
<span class="cstat-no" title="statement not covered" > mapHook.map.flyTo({</span>
|
|
534
|
+
center: [pos.coords.longitude, pos.coords.latitude],
|
|
535
|
+
zoom: 18,
|
|
536
|
+
speed: 1,
|
|
537
|
+
curve: 1,
|
|
538
|
+
});
|
|
539
|
+
<span class="cstat-no" title="statement not covered" > if (!props.showUserLocation) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
405
540
|
const geoJsonPoint = <span class="cstat-no" title="statement not covered" >point([pos.coords.longitude, pos.coords.latitude]);</span>
|
|
406
|
-
<span class="cstat-no" title="statement not covered" >
|
|
541
|
+
<span class="cstat-no" title="statement not covered" > setUserLocationGeoJson(geoJsonPoint);</span>
|
|
407
542
|
<span class="cstat-no" title="statement not covered" > setAccuracyGeoJson(circle(geoJsonPoint, pos.coords.accuracy / 1000));</span>
|
|
408
543
|
},
|
|
409
|
-
[mapHook.map]
|
|
544
|
+
[mapHook.map, props]
|
|
410
545
|
);
|
|
411
546
|
|
|
412
547
|
const getLocationError = <span class="fstat-no" title="function not covered" >(e</span>rr) => {
|
|
413
548
|
<span class="cstat-no" title="statement not covered" > console.log("Access of user location denied");</span>
|
|
414
549
|
<span class="cstat-no" title="statement not covered" > setLocationAccessDenied(true);</span>
|
|
415
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]);
|
|
416
582
|
|
|
417
583
|
useEffect(() => {
|
|
418
584
|
if (!mapHook.map) return;
|
|
@@ -424,30 +590,45 @@ const MlFollowGps = (props) => {
|
|
|
424
590
|
navigator.geolocation.clearWatch(_watchId);
|
|
425
591
|
};
|
|
426
592
|
}
|
|
427
|
-
}, [isFollowed, getLocationSuccess]);
|
|
593
|
+
}, [mapHook.map, isFollowed, getLocationSuccess]);
|
|
428
594
|
|
|
429
595
|
return (
|
|
430
596
|
<>
|
|
431
|
-
{isFollowed &&
|
|
597
|
+
{isFollowed && userLocationGeoJson && (
|
|
432
598
|
<span class="branch-2 cbranch-no" title="branch not covered" > <MlGeoJsonLayer</span>
|
|
433
599
|
geojson={accuracyGeoJson}
|
|
434
600
|
type={"fill"}
|
|
435
601
|
paint={{
|
|
436
|
-
"fill-color": "#
|
|
437
|
-
"fill-opacity": 0.
|
|
602
|
+
"fill-color": "#cbd300",
|
|
603
|
+
"fill-opacity": 0.3,
|
|
438
604
|
...props.accuracyPaint,
|
|
439
605
|
}}
|
|
440
606
|
insertBeforeLayer={props.insertBeforeLayer}
|
|
441
607
|
/>
|
|
442
608
|
)}
|
|
443
609
|
|
|
444
|
-
{isFollowed &&
|
|
610
|
+
{isFollowed && orientationCone && (
|
|
445
611
|
<span class="branch-2 cbranch-no" title="branch not covered" > <MlGeoJsonLayer</span>
|
|
446
|
-
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}
|
|
447
626
|
type={"circle"}
|
|
448
627
|
paint={{
|
|
449
|
-
"circle-color": "#
|
|
628
|
+
"circle-color": "#009ee0",
|
|
450
629
|
"circle-radius": 5,
|
|
630
|
+
"circle-stroke-color": "#fafaff",
|
|
631
|
+
"circle-stroke-width": 1,
|
|
451
632
|
...props.circlePaint,
|
|
452
633
|
}}
|
|
453
634
|
insertBeforeLayer={props.insertBeforeLayer}
|
|
@@ -462,7 +643,7 @@ const MlFollowGps = (props) => {
|
|
|
462
643
|
}}
|
|
463
644
|
>
|
|
464
645
|
{" "}
|
|
465
|
-
<
|
|
646
|
+
<GpsFixedIcon sx={{ fontSize: props.style.fontSize }} />{" "}
|
|
466
647
|
</Button>
|
|
467
648
|
</>
|
|
468
649
|
);
|
|
@@ -486,6 +667,9 @@ MlFollowGps.defaultProps = {
|
|
|
486
667
|
},
|
|
487
668
|
onColor: "#ececec",
|
|
488
669
|
offColor: "#666",
|
|
670
|
+
showAccuracyCircle: true,
|
|
671
|
+
showUserLocation: true,
|
|
672
|
+
showOrientation: true
|
|
489
673
|
};
|
|
490
674
|
|
|
491
675
|
MlFollowGps.propTypes = {
|
|
@@ -517,6 +701,20 @@ MlFollowGps.propTypes = {
|
|
|
517
701
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
|
|
518
702
|
*/
|
|
519
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,
|
|
520
718
|
};
|
|
521
719
|
export default MlFollowGps;
|
|
522
720
|
</pre></td></tr></table></pre>
|
|
@@ -526,7 +724,7 @@ export default MlFollowGps;
|
|
|
526
724
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
527
725
|
Code coverage generated by
|
|
528
726
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
529
|
-
at
|
|
727
|
+
at Sun Feb 20 2022 15:15:59 GMT+0000 (Coordinated Universal Time)
|
|
530
728
|
</div>
|
|
531
729
|
<script src="../../../prettify.js"></script>
|
|
532
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 15:15:59 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../../prettify.js"></script>
|
|
107
107
|
<script>
|