@mapcomponents/react-maplibre 0.1.33 → 0.1.36
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/.babelrc +3 -0
- package/.github/workflows/storybook.yml +1 -1
- package/.storybook/.babelrc +26 -0
- package/.storybook/main.js +15 -1
- package/.storybook/mapcomponents_logo.png +0 -0
- package/CHANGELOG.md +10 -0
- package/config/env.js +106 -0
- package/config/getHttpsConfig.js +66 -0
- package/config/jest/babelTransform.js +29 -0
- package/config/jest/cssTransform.js +14 -0
- package/config/jest/fileTransform.js +40 -0
- package/config/modules.js +134 -0
- package/config/paths.js +75 -0
- package/config/pnpTs.js +35 -0
- package/config/webpack.config.js +757 -0
- package/config/webpackDevServer.config.js +130 -0
- package/coverage/clover.xml +822 -900
- package/coverage/coverage-final.json +23 -24
- package/coverage/lcov-report/index.html +135 -150
- package/coverage/lcov-report/src/components/MapLibreMap/{MapLibreMap.js.html → MapLibreMap.tsx.html} +77 -68
- package/coverage/lcov-report/src/components/MapLibreMap/index.html +6 -6
- package/coverage/lcov-report/src/components/MlCreatePdfButton/{MlCreatePdfButton.js.html → MlCreatePdfButton.tsx.html} +40 -43
- package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +10 -10
- package/coverage/lcov-report/src/components/MlFeatureEditor/{MlFeatureEditor.js.html → MlFeatureEditor.tsx.html} +145 -85
- package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +21 -21
- package/coverage/lcov-report/src/components/{MlImageMarkerLayer/MlImageMarkerLayer.js.html → MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html} +141 -111
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +20 -20
- package/coverage/lcov-report/src/components/MlFollowGps/{MlFollowGps.js.html → MlFollowGps.tsx.html} +177 -138
- package/coverage/lcov-report/src/components/MlFollowGps/index.html +15 -15
- package/coverage/lcov-report/src/components/MlGPXViewer/{MlGPXViewer.js.html → MlGPXViewer.tsx.html} +134 -80
- package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +1 -1
- package/coverage/lcov-report/src/components/MlGPXViewer/index.html +16 -16
- package/coverage/lcov-report/src/components/{MlLayer/MlLayer.js.html → MlGeoJsonLayer/MlGeoJsonLayer.tsx.html} +151 -154
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +19 -19
- package/coverage/lcov-report/src/components/{MlFillExtrusionLayer/MlFillExtrusionLayer.js.html → MlImageMarkerLayer/MlImageMarkerLayer.tsx.html} +151 -223
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +16 -16
- package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +229 -0
- package/coverage/lcov-report/src/components/MlLayer/index.html +21 -21
- package/coverage/lcov-report/src/components/MlLayerMagnify/{MlLayerMagnify.js.html → MlLayerMagnify.tsx.html} +134 -77
- package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +20 -20
- package/coverage/lcov-report/src/components/MlLayerSwipe/{MlLayerSwipe.js.html → MlLayerSwipe.tsx.html} +83 -41
- package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +2 -2
- package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +3 -15
- 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 → MlMarker.tsx.html} +89 -137
- package/coverage/lcov-report/src/components/MlMarker/index.html +10 -10
- package/coverage/lcov-report/src/components/MlNavigationCompass/{MlNavigationCompass.js.html → MlNavigationCompass.tsx.html} +76 -25
- package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +17 -17
- package/coverage/lcov-report/src/components/MlNavigationTools/{MlNavigationTools.js.html → MlNavigationTools.tsx.html} +67 -52
- package/coverage/lcov-report/src/components/MlNavigationTools/index.html +10 -10
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +1 -1
- package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
- 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 +3 -3
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +5 -5
- package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/{MlTransitionGeoJsonLayer.js.html → MlTransitionGeoJsonLayer.tsx.html} +127 -118
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +11 -11
- 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 → MlVectorTileLayer.tsx.html} +59 -11
- package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +2 -2
- 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 → MlWmsLayer.tsx.html} +56 -11
- package/coverage/lcov-report/src/components/MlWmsLayer/index.html +2 -2
- package/coverage/lcov-report/src/components/MlWmsLoader/{MlWmsLoader.js.html → MlWmsLoader.tsx.html} +102 -78
- package/coverage/lcov-report/src/components/MlWmsLoader/index.html +8 -8
- package/coverage/lcov-report/src/hooks/index.html +44 -29
- package/coverage/lcov-report/src/{components/MlGeoJsonLayer/MlGeoJsonLayer.js.html → hooks/useLayer.ts.html} +328 -184
- package/coverage/lcov-report/src/hooks/{useMap.js.html → useMap.ts.html} +140 -50
- package/coverage/lcov-report/src/hooks/{useMapState.js.html → useMapState.ts.html} +166 -61
- package/coverage/lcov-report/src/hooks/useWms.js.html +1 -1
- package/coverage/lcov-report/src/index.html +15 -15
- package/coverage/lcov-report/src/{i18n.js.html → index.ts.html} +50 -32
- package/coverage/lcov.info +1540 -1669
- package/dist/index.esm.css +195 -0
- package/dist/index.esm.js +17059 -4275
- package/dist/index.esm.js.map +1 -1
- package/docs-build/0.d0c23b79.iframe.bundle.js +2 -0
- package/docs-build/0.d0c23b79.iframe.bundle.js.map +1 -0
- package/docs-build/0.fd1aa3ea21956d993519.manager.bundle.js +1 -0
- package/docs-build/1.34075652.iframe.bundle.js +10 -0
- package/docs-build/1.34075652.iframe.bundle.js.map +1 -0
- package/docs-build/16.ca488dae.iframe.bundle.js +2 -0
- package/docs-build/16.ca488dae.iframe.bundle.js.map +1 -0
- package/docs-build/17.e40eac7f.iframe.bundle.js +17 -0
- package/docs-build/17.e40eac7f.iframe.bundle.js.map +1 -0
- package/docs-build/18.62af0912.iframe.bundle.js +14 -0
- package/docs-build/18.62af0912.iframe.bundle.js.map +1 -0
- package/docs-build/19.0a217189.iframe.bundle.js +2 -0
- package/docs-build/19.0a217189.iframe.bundle.js.map +1 -0
- package/docs-build/2.f15ae19a.iframe.bundle.js +2 -0
- package/docs-build/2.f15ae19a.iframe.bundle.js.map +1 -0
- package/docs-build/20.4c43e27c.iframe.bundle.js +4 -0
- package/docs-build/20.4c43e27c.iframe.bundle.js.map +1 -0
- package/docs-build/21.19c21085.iframe.bundle.js +22 -0
- package/docs-build/21.19c21085.iframe.bundle.js.map +1 -0
- package/docs-build/3.5dd9e88b.iframe.bundle.js +2 -0
- package/docs-build/3.5dd9e88b.iframe.bundle.js.map +1 -0
- package/docs-build/4.f741dafe1833630ec8bf.manager.bundle.js +2 -0
- package/docs-build/4.f741dafe1833630ec8bf.manager.bundle.js.LICENSE.txt +8 -0
- package/docs-build/5.d4de191e7daeefb036ca.manager.bundle.js +1 -0
- package/docs-build/6.2b178c5444648ee5c0fa.manager.bundle.js +2 -0
- package/docs-build/6.2b178c5444648ee5c0fa.manager.bundle.js.LICENSE.txt +12 -0
- package/docs-build/7.7c16aea8ec7ea6e91994.manager.bundle.js +1 -0
- package/docs-build/8.52fa838fdf937b29676a.manager.bundle.js +1 -0
- package/docs-build/assets/dop.png +0 -0
- package/docs-build/assets/historic.png +0 -0
- package/docs-build/assets/marker.png +0 -0
- package/docs-build/assets/osm.png +0 -0
- package/docs-build/assets/sample.gpx +716 -0
- package/docs-build/{.gitkeep → catalogue/.gitkeep} +0 -0
- package/docs-build/catalogue/mc_meta.json +1 -0
- package/docs-build/favicon.ico +0 -0
- package/docs-build/iframe.html +348 -0
- package/docs-build/index.html +59 -0
- package/docs-build/logo.png +0 -0
- package/docs-build/main.8a7ec710ea1c16b5e13f.manager.bundle.js +1 -0
- package/docs-build/main~24120820.ba6665a8.iframe.bundle.js +2 -0
- package/docs-build/main~24120820.ba6665a8.iframe.bundle.js.map +1 -0
- package/docs-build/manifest.json +25 -0
- package/docs-build/robots.txt +3 -0
- package/docs-build/runtime~main.67aa1de2d72f40a81164.manager.bundle.js +1 -0
- package/docs-build/static/media/mapcomponents_logo.98b01a05.png +0 -0
- package/docs-build/static/media/wg-marker.bf3eeb2d.png +0 -0
- package/docs-build/stories.json +331 -0
- package/docs-build/thumbnails/MapLibreMap.png +0 -0
- package/docs-build/thumbnails/MlCameraFollowPath.png +0 -0
- package/docs-build/thumbnails/MlCreatePdfButton.png +0 -0
- package/docs-build/thumbnails/MlDeckGlLayer.png +0 -0
- package/docs-build/thumbnails/MlDeckGlTerrainLayer.png +0 -0
- package/docs-build/thumbnails/MlDemoDashboard.png +0 -0
- package/docs-build/thumbnails/MlFeatureEditor.png +0 -0
- package/docs-build/thumbnails/MlFillExtrusionLayer.png +0 -0
- package/docs-build/thumbnails/MlFollowGps.png +0 -0
- package/docs-build/thumbnails/MlGPXViewer.png +0 -0
- package/docs-build/thumbnails/MlGeoJsonLayer.png +0 -0
- package/docs-build/thumbnails/MlHillshadeLayer.png +0 -0
- package/docs-build/thumbnails/MlIconLayer.png +0 -0
- package/docs-build/thumbnails/MlLaermkarte.png +0 -0
- package/docs-build/thumbnails/MlLayerMagnify.png +0 -0
- package/docs-build/thumbnails/MlLayerSwipe.png +0 -0
- package/docs-build/thumbnails/MlMapDrawTools.png +0 -0
- package/docs-build/thumbnails/MlMobilerImker.png +0 -0
- package/docs-build/thumbnails/MlNavigationCompass.png +0 -0
- package/docs-build/thumbnails/MlNavigationTools.png +0 -0
- package/docs-build/thumbnails/MlOsmLayer.png +0 -0
- package/docs-build/thumbnails/MlScaleReference.png +0 -0
- package/docs-build/thumbnails/MlSpatialElevationProfile.png +0 -0
- package/docs-build/thumbnails/MlThreeJsLayer.png +0 -0
- package/docs-build/thumbnails/MlTransitionGeoJsonLayer.png +0 -0
- package/docs-build/thumbnails/MlVectorTileLayer.png +0 -0
- package/docs-build/thumbnails/MlWanderApp.png +0 -0
- package/docs-build/thumbnails/MlWmsLayer.png +0 -0
- package/docs-build/thumbnails/MlWmsLoader.png +0 -0
- package/docs-build/vendors~main.351900838c49e9200954.manager.bundle.js +2 -0
- package/docs-build/vendors~main.351900838c49e9200954.manager.bundle.js.LICENSE.txt +101 -0
- package/docs-build/vendors~main~0ad7406a.a6abfed7.iframe.bundle.js +8 -0
- package/docs-build/vendors~main~0ad7406a.a6abfed7.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~0f485567.1d7a15b7.iframe.bundle.js +2 -0
- package/docs-build/vendors~main~0f485567.1d7a15b7.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~41a6ab2c.525ecc56.iframe.bundle.js +2 -0
- package/docs-build/vendors~main~41a6ab2c.525ecc56.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~52589227.1d1558cd.iframe.bundle.js +8 -0
- package/docs-build/vendors~main~52589227.1d1558cd.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~73914085.227c6747.iframe.bundle.js +293 -0
- package/docs-build/vendors~main~73914085.227c6747.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~9c5b28f6.f02cc741.iframe.bundle.js +7 -0
- package/docs-build/vendors~main~9c5b28f6.f02cc741.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~b5906859.4083ac60.iframe.bundle.js +21 -0
- package/docs-build/vendors~main~b5906859.4083ac60.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~b8f44717.7a612c34.iframe.bundle.js +89 -0
- package/docs-build/vendors~main~b8f44717.7a612c34.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~b9cf3951.45da142d.iframe.bundle.js +68 -0
- package/docs-build/vendors~main~b9cf3951.45da142d.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~d939e436.92c27fbf.iframe.bundle.js +2 -0
- package/docs-build/vendors~main~d939e436.92c27fbf.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~dab50aa4.b0d58038.iframe.bundle.js +107 -0
- package/docs-build/vendors~main~dab50aa4.b0d58038.iframe.bundle.js.map +1 -0
- package/package.json +134 -116
- package/public/favicon.ico +0 -0
- package/public/logo.png +0 -0
- package/rollup.config.js +26 -3
- package/scripts/start.js +166 -0
- package/scripts/test.js +53 -0
- package/src/components/MapLibreMap/MapLibreMap.stories.js +14 -5
- package/src/components/MapLibreMap/MapLibreMap.test.js +1 -1
- package/src/components/MapLibreMap/{MapLibreMap.js → MapLibreMap.tsx} +40 -37
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.test.js +3 -3
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +636 -0
- package/src/components/MlComponentTemplate/MlComponentTemplate.stories.js +0 -2
- package/src/components/MlComponentTemplate/MlComponentTemplate.tsx +42 -0
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.stories.js +0 -5
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx +51 -0
- package/src/components/MlCreatePdfButton/lib/{createPdf.js → createPdf.ts} +26 -23
- package/src/components/MlCreatePdfButton/lib/{nominatimMap.js → nominatimMap.ts} +3 -3
- package/src/components/MlFeatureEditor/MlFeatureEditor.tsx +139 -0
- package/src/components/MlFeatureEditor/custom-direct-select-mode.js +12 -8
- package/src/components/MlFeatureEditor/custom-polygon-mode.js +9 -5
- package/src/components/MlFeatureEditor/custom-select-mode.js +11 -7
- package/src/components/MlFeatureEditor/lib/LICENSE.md +18 -0
- package/src/components/MlFeatureEditor/lib/common_selectors.js +4 -0
- package/src/components/MlFeatureEditor/lib/constants.js +4 -0
- package/src/components/MlFeatureEditor/lib/constrain_feature_movement.js +4 -0
- package/src/components/MlFeatureEditor/lib/create_midpoint.js +4 -0
- package/src/components/MlFeatureEditor/lib/create_supplementary_points.js +4 -0
- package/src/components/MlFeatureEditor/lib/create_vertex.js +4 -0
- package/src/components/MlFeatureEditor/lib/double_click_zoom.js +4 -0
- package/src/components/MlFeatureEditor/lib/euclidean_distance.js +4 -0
- package/src/components/MlFeatureEditor/lib/features_at.js +4 -0
- package/src/components/MlFeatureEditor/lib/get_features_and_set_cursor.js +4 -0
- package/src/components/MlFeatureEditor/lib/is_click.js +4 -0
- package/src/components/MlFeatureEditor/lib/is_event_at_coordinates.js +4 -0
- package/src/components/MlFeatureEditor/lib/is_tap.js +4 -0
- package/src/components/MlFeatureEditor/lib/map_event_to_bounding_box.js +4 -0
- package/src/components/MlFeatureEditor/lib/mode_handler.js +4 -0
- package/src/components/MlFeatureEditor/lib/mouse_event_point.js +4 -0
- package/src/components/MlFeatureEditor/lib/move_features.js +4 -0
- package/src/components/MlFeatureEditor/lib/sort_features.js +4 -0
- package/src/components/MlFeatureEditor/lib/string_set.js +4 -0
- package/src/components/MlFeatureEditor/lib/string_sets_are_equal.js +4 -0
- package/src/components/MlFeatureEditor/lib/theme.js +4 -0
- package/src/components/MlFeatureEditor/lib/to_dense_array.js +4 -0
- package/src/components/MlFeatureEditor/lib/utils.js +4 -0
- package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.stories.js +6 -11
- package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx +85 -0
- package/src/components/MlFollowGps/MlFollowGps.stories.js +0 -2
- package/src/components/MlFollowGps/{MlFollowGps.js → MlFollowGps.tsx} +99 -86
- package/src/components/MlGPXViewer/{MlGPXViewer.js → MlGPXViewer.tsx} +68 -50
- package/src/components/MlGPXViewer/util/GeoJsonContext.ts +13 -0
- package/src/components/MlGPXViewer/util/{GeoJsonProvider.js → GeoJsonProvider.tsx} +3 -7
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.js +8 -3
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +106 -0
- package/src/components/MlGeoJsonLayer/util/{getDefaultLayerTypeByGeometry.js → getDefaultLayerTypeByGeometry.ts} +6 -1
- package/src/components/MlGeoJsonLayer/util/{getDefaultPaintPropsByType.js → getDefaultPaintPropsByType.ts} +1 -1
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.js +1 -4
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx +129 -0
- package/src/components/MlLayer/MlLayer.stories.js +0 -2
- package/src/components/MlLayer/MlLayer.tsx +48 -0
- package/src/components/MlLayerMagnify/MlLayerMagnify.stories.js +3 -3
- package/src/components/MlLayerMagnify/{MlLayerMagnify.js → MlLayerMagnify.tsx} +62 -43
- package/src/components/MlLayerSwipe/MlLayerSwipe.stories.js +0 -2
- package/src/components/MlLayerSwipe/{MlLayerSwipe.js → MlLayerSwipe.tsx} +38 -24
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.js +0 -4
- package/src/components/MlMarker/MlMarker.tsx +140 -0
- package/src/components/MlNavigationCompass/{MlNavigationCompass.js → MlNavigationCompass.tsx} +27 -10
- package/src/components/MlNavigationTools/{MlNavigationTools.js → MlNavigationTools.tsx} +37 -32
- package/src/components/MlTransitionGeoJsonLayer/{MlTransitionGeoJsonLayer.js → MlTransitionGeoJsonLayer.tsx} +76 -73
- package/src/components/MlVectorTileLayer/{MlVectorTileLayer.js → MlVectorTileLayer.tsx} +23 -7
- package/src/components/MlWmsLayer/{MlWmsLayer.js → MlWmsLayer.tsx} +22 -7
- package/src/components/MlWmsLoader/{MlWmsLoader.js → MlWmsLoader.tsx} +55 -47
- package/src/custom.d.tsx +26 -0
- package/src/hooks/useLayer.ts +221 -0
- package/src/hooks/{useMap.js → useMap.ts} +48 -17
- package/src/hooks/{useMapState.js → useMapState.ts} +42 -7
- package/src/{index.js → index.ts} +15 -8
- package/tsconfig.json +18 -24
- package/.env +0 -1
- package/.storybook/main.bck.js +0 -56
- package/babel.config.json +0 -4
- package/coverage/lcov-report/src/translations/english.js.html +0 -94
- package/coverage/lcov-report/src/translations/german.js.html +0 -94
- package/coverage/lcov-report/src/translations/index.html +0 -131
- package/jest.config.json +0 -16
- package/jsdoc.json +0 -21
- package/public/assets/3D/posttower.gltf +0 -103
- package/public/assets/3D/posttower_simple.gltf +0 -103
- package/public/assets/3D/posttower_wh.gltf.glb +0 -0
- package/public/bee.png +0 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.js +0 -528
- package/src/components/MlComponentTemplate/MlComponentTemplate.js +0 -39
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.js +0 -52
- package/src/components/MlFeatureEditor/MlFeatureEditor.js +0 -119
- package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.js +0 -153
- package/src/components/MlGPXViewer/util/GeoJsonContext.js +0 -6
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.js +0 -173
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.js +0 -75
- package/src/components/MlLayer/MlLayer.js +0 -107
- package/src/components/MlLayerMagnify/utils/compareMagnify.js +0 -173
- package/src/components/MlLayerSwipe/utils/swipeCompare.js +0 -220
- package/src/components/MlMarker/MlMarker.js +0 -156
- package/src/components/index.js +0 -6
- package/src/i18n.js +0 -28
- package/src/react-app-env.d.ts +0 -1
- package/src/stories/IntroductionCore.stories.mdx +0 -3
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/src/stories/components/ComponentTeaser.js +0 -64
- package/src/translations/english.js +0 -4
- package/src/translations/german.js +0 -4
package/coverage/lcov-report/src/components/MlFollowGps/{MlFollowGps.js.html → MlFollowGps.tsx.html}
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<html lang="en">
|
|
4
4
|
|
|
5
5
|
<head>
|
|
6
|
-
<title>Code coverage report for src/components/MlFollowGps/MlFollowGps.
|
|
6
|
+
<title>Code coverage report for src/components/MlFollowGps/MlFollowGps.tsx</title>
|
|
7
7
|
<meta charset="utf-8" />
|
|
8
8
|
<link rel="stylesheet" href="../../../prettify.css" />
|
|
9
9
|
<link rel="stylesheet" href="../../../base.css" />
|
|
@@ -19,20 +19,20 @@
|
|
|
19
19
|
<body>
|
|
20
20
|
<div class='wrapper'>
|
|
21
21
|
<div class='pad1'>
|
|
22
|
-
<h1><a href="../../../index.html">All files</a> / <a href="index.html">src/components/MlFollowGps</a> MlFollowGps.
|
|
22
|
+
<h1><a href="../../../index.html">All files</a> / <a href="index.html">src/components/MlFollowGps</a> MlFollowGps.tsx</h1>
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">60% </span>
|
|
26
|
+
<span class="strong">60.78% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>31/51</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">64% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>16/25</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">
|
|
47
|
+
<span class="strong">62.5% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>30/48</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -281,7 +281,66 @@
|
|
|
281
281
|
<a name='L216'></a><a href='#L216'>216</a>
|
|
282
282
|
<a name='L217'></a><a href='#L217'>217</a>
|
|
283
283
|
<a name='L218'></a><a href='#L218'>218</a>
|
|
284
|
-
<a name='L219'></a><a href='#L219'>219</a
|
|
284
|
+
<a name='L219'></a><a href='#L219'>219</a>
|
|
285
|
+
<a name='L220'></a><a href='#L220'>220</a>
|
|
286
|
+
<a name='L221'></a><a href='#L221'>221</a>
|
|
287
|
+
<a name='L222'></a><a href='#L222'>222</a>
|
|
288
|
+
<a name='L223'></a><a href='#L223'>223</a>
|
|
289
|
+
<a name='L224'></a><a href='#L224'>224</a>
|
|
290
|
+
<a name='L225'></a><a href='#L225'>225</a>
|
|
291
|
+
<a name='L226'></a><a href='#L226'>226</a>
|
|
292
|
+
<a name='L227'></a><a href='#L227'>227</a>
|
|
293
|
+
<a name='L228'></a><a href='#L228'>228</a>
|
|
294
|
+
<a name='L229'></a><a href='#L229'>229</a>
|
|
295
|
+
<a name='L230'></a><a href='#L230'>230</a>
|
|
296
|
+
<a name='L231'></a><a href='#L231'>231</a>
|
|
297
|
+
<a name='L232'></a><a href='#L232'>232</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
298
|
+
<span class="cline-any cline-neutral"> </span>
|
|
299
|
+
<span class="cline-any cline-neutral"> </span>
|
|
300
|
+
<span class="cline-any cline-neutral"> </span>
|
|
301
|
+
<span class="cline-any cline-neutral"> </span>
|
|
302
|
+
<span class="cline-any cline-neutral"> </span>
|
|
303
|
+
<span class="cline-any cline-neutral"> </span>
|
|
304
|
+
<span class="cline-any cline-neutral"> </span>
|
|
305
|
+
<span class="cline-any cline-neutral"> </span>
|
|
306
|
+
<span class="cline-any cline-neutral"> </span>
|
|
307
|
+
<span class="cline-any cline-neutral"> </span>
|
|
308
|
+
<span class="cline-any cline-neutral"> </span>
|
|
309
|
+
<span class="cline-any cline-neutral"> </span>
|
|
310
|
+
<span class="cline-any cline-neutral"> </span>
|
|
311
|
+
<span class="cline-any cline-neutral"> </span>
|
|
312
|
+
<span class="cline-any cline-neutral"> </span>
|
|
313
|
+
<span class="cline-any cline-neutral"> </span>
|
|
314
|
+
<span class="cline-any cline-neutral"> </span>
|
|
315
|
+
<span class="cline-any cline-neutral"> </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-neutral"> </span>
|
|
322
|
+
<span class="cline-any cline-neutral"> </span>
|
|
323
|
+
<span class="cline-any cline-neutral"> </span>
|
|
324
|
+
<span class="cline-any cline-neutral"> </span>
|
|
325
|
+
<span class="cline-any cline-neutral"> </span>
|
|
326
|
+
<span class="cline-any cline-neutral"> </span>
|
|
327
|
+
<span class="cline-any cline-neutral"> </span>
|
|
328
|
+
<span class="cline-any cline-neutral"> </span>
|
|
329
|
+
<span class="cline-any cline-neutral"> </span>
|
|
330
|
+
<span class="cline-any cline-neutral"> </span>
|
|
331
|
+
<span class="cline-any cline-neutral"> </span>
|
|
332
|
+
<span class="cline-any cline-neutral"> </span>
|
|
333
|
+
<span class="cline-any cline-neutral"> </span>
|
|
334
|
+
<span class="cline-any cline-neutral"> </span>
|
|
335
|
+
<span class="cline-any cline-neutral"> </span>
|
|
336
|
+
<span class="cline-any cline-neutral"> </span>
|
|
337
|
+
<span class="cline-any cline-neutral"> </span>
|
|
338
|
+
<span class="cline-any cline-neutral"> </span>
|
|
339
|
+
<span class="cline-any cline-neutral"> </span>
|
|
340
|
+
<span class="cline-any cline-neutral"> </span>
|
|
341
|
+
<span class="cline-any cline-neutral"> </span>
|
|
342
|
+
<span class="cline-any cline-neutral"> </span>
|
|
343
|
+
<span class="cline-any cline-neutral"> </span>
|
|
285
344
|
<span class="cline-any cline-neutral"> </span>
|
|
286
345
|
<span class="cline-any cline-neutral"> </span>
|
|
287
346
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -302,7 +361,11 @@
|
|
|
302
361
|
<span class="cline-any cline-yes">1x</span>
|
|
303
362
|
<span class="cline-any cline-yes">9x</span>
|
|
304
363
|
<span class="cline-any cline-neutral"> </span>
|
|
364
|
+
<span class="cline-any cline-neutral"> </span>
|
|
365
|
+
<span class="cline-any cline-neutral"> </span>
|
|
366
|
+
<span class="cline-any cline-neutral"> </span>
|
|
305
367
|
<span class="cline-any cline-yes">9x</span>
|
|
368
|
+
<span class="cline-any cline-neutral"> </span>
|
|
306
369
|
<span class="cline-any cline-yes">9x</span>
|
|
307
370
|
<span class="cline-any cline-yes">9x</span>
|
|
308
371
|
<span class="cline-any cline-yes">9x</span>
|
|
@@ -332,7 +395,6 @@
|
|
|
332
395
|
<span class="cline-any cline-neutral"> </span>
|
|
333
396
|
<span class="cline-any cline-neutral"> </span>
|
|
334
397
|
<span class="cline-any cline-yes">9x</span>
|
|
335
|
-
<span class="cline-any cline-neutral"> </span>
|
|
336
398
|
<span class="cline-any cline-yes">2x</span>
|
|
337
399
|
<span class="cline-any cline-yes">2x</span>
|
|
338
400
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -347,7 +409,6 @@
|
|
|
347
409
|
<span class="cline-any cline-no"> </span>
|
|
348
410
|
<span class="cline-any cline-neutral"> </span>
|
|
349
411
|
<span class="cline-any cline-neutral"> </span>
|
|
350
|
-
<span class="cline-any cline-neutral"> </span>
|
|
351
412
|
<span class="cline-any cline-yes">9x</span>
|
|
352
413
|
<span class="cline-any cline-no"> </span>
|
|
353
414
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -360,6 +421,7 @@
|
|
|
360
421
|
<span class="cline-any cline-yes">1x</span>
|
|
361
422
|
<span class="cline-any cline-neutral"> </span>
|
|
362
423
|
<span class="cline-any cline-neutral"> </span>
|
|
424
|
+
<span class="cline-any cline-yes">3x</span>
|
|
363
425
|
<span class="cline-any cline-neutral"> </span>
|
|
364
426
|
<span class="cline-any cline-neutral"> </span>
|
|
365
427
|
<span class="cline-any cline-yes">9x</span>
|
|
@@ -368,31 +430,17 @@
|
|
|
368
430
|
<span class="cline-any cline-yes">5x</span>
|
|
369
431
|
<span class="cline-any cline-yes">2x</span>
|
|
370
432
|
<span class="cline-any cline-neutral"> </span>
|
|
371
|
-
<span class="cline-any cline-yes">2x</span>
|
|
372
|
-
<span class="cline-any cline-yes">1x</span>
|
|
373
|
-
<span class="cline-any cline-neutral"> </span>
|
|
374
|
-
<span class="cline-any cline-neutral"> </span>
|
|
375
|
-
<span class="cline-any cline-neutral"> </span>
|
|
376
|
-
<span class="cline-any cline-neutral"> </span>
|
|
377
|
-
<span class="cline-any cline-yes">9x</span>
|
|
378
|
-
<span class="cline-any cline-neutral"> </span>
|
|
379
|
-
<span class="cline-any cline-neutral"> </span>
|
|
380
|
-
<span class="cline-any cline-neutral"> </span>
|
|
381
|
-
<span class="cline-any cline-neutral"> </span>
|
|
382
|
-
<span class="cline-any cline-neutral"> </span>
|
|
383
|
-
<span class="cline-any cline-neutral"> </span>
|
|
384
|
-
<span class="cline-any cline-neutral"> </span>
|
|
385
|
-
<span class="cline-any cline-neutral"> </span>
|
|
386
|
-
<span class="cline-any cline-neutral"> </span>
|
|
387
|
-
<span class="cline-any cline-neutral"> </span>
|
|
388
|
-
<span class="cline-any cline-neutral"> </span>
|
|
389
433
|
<span class="cline-any cline-neutral"> </span>
|
|
390
434
|
<span class="cline-any cline-neutral"> </span>
|
|
391
435
|
<span class="cline-any cline-neutral"> </span>
|
|
436
|
+
<span class="cline-any cline-yes">2x</span>
|
|
437
|
+
<span class="cline-any cline-yes">1x</span>
|
|
392
438
|
<span class="cline-any cline-neutral"> </span>
|
|
393
439
|
<span class="cline-any cline-neutral"> </span>
|
|
440
|
+
<span class="cline-any cline-yes">3x</span>
|
|
394
441
|
<span class="cline-any cline-neutral"> </span>
|
|
395
442
|
<span class="cline-any cline-neutral"> </span>
|
|
443
|
+
<span class="cline-any cline-yes">9x</span>
|
|
396
444
|
<span class="cline-any cline-neutral"> </span>
|
|
397
445
|
<span class="cline-any cline-neutral"> </span>
|
|
398
446
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -421,7 +469,6 @@
|
|
|
421
469
|
<span class="cline-any cline-neutral"> </span>
|
|
422
470
|
<span class="cline-any cline-neutral"> </span>
|
|
423
471
|
<span class="cline-any cline-neutral"> </span>
|
|
424
|
-
<span class="cline-any cline-yes">3x</span>
|
|
425
472
|
<span class="cline-any cline-neutral"> </span>
|
|
426
473
|
<span class="cline-any cline-neutral"> </span>
|
|
427
474
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -431,7 +478,6 @@
|
|
|
431
478
|
<span class="cline-any cline-neutral"> </span>
|
|
432
479
|
<span class="cline-any cline-neutral"> </span>
|
|
433
480
|
<span class="cline-any cline-neutral"> </span>
|
|
434
|
-
<span class="cline-any cline-yes">1x</span>
|
|
435
481
|
<span class="cline-any cline-neutral"> </span>
|
|
436
482
|
<span class="cline-any cline-neutral"> </span>
|
|
437
483
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -445,6 +491,7 @@
|
|
|
445
491
|
<span class="cline-any cline-neutral"> </span>
|
|
446
492
|
<span class="cline-any cline-neutral"> </span>
|
|
447
493
|
<span class="cline-any cline-neutral"> </span>
|
|
494
|
+
<span class="cline-any cline-yes">3x</span>
|
|
448
495
|
<span class="cline-any cline-neutral"> </span>
|
|
449
496
|
<span class="cline-any cline-neutral"> </span>
|
|
450
497
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -478,59 +525,88 @@
|
|
|
478
525
|
<span class="cline-any cline-neutral"> </span>
|
|
479
526
|
<span class="cline-any cline-neutral"> </span>
|
|
480
527
|
<span class="cline-any cline-neutral"> </span>
|
|
481
|
-
<span class="cline-any cline-neutral"> </span>
|
|
482
|
-
<span class="cline-any cline-neutral"> </span>
|
|
483
|
-
<span class="cline-any cline-neutral"> </span>
|
|
484
|
-
<span class="cline-any cline-neutral"> </span>
|
|
485
|
-
<span class="cline-any cline-neutral"> </span>
|
|
486
|
-
<span class="cline-any cline-neutral"> </span>
|
|
487
|
-
<span class="cline-any cline-neutral"> </span>
|
|
488
|
-
<span class="cline-any cline-neutral"> </span>
|
|
489
|
-
<span class="cline-any cline-neutral"> </span>
|
|
490
|
-
<span class="cline-any cline-neutral"> </span>
|
|
491
|
-
<span class="cline-any cline-neutral"> </span>
|
|
492
|
-
<span class="cline-any cline-neutral"> </span>
|
|
493
|
-
<span class="cline-any cline-neutral"> </span>
|
|
494
|
-
<span class="cline-any cline-neutral"> </span>
|
|
495
|
-
<span class="cline-any cline-neutral"> </span>
|
|
496
|
-
<span class="cline-any cline-neutral"> </span>
|
|
497
|
-
<span class="cline-any cline-neutral"> </span>
|
|
498
|
-
<span class="cline-any cline-neutral"> </span>
|
|
499
|
-
<span class="cline-any cline-neutral"> </span>
|
|
500
|
-
<span class="cline-any cline-neutral"> </span>
|
|
501
|
-
<span class="cline-any cline-neutral"> </span>
|
|
502
528
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, { useEffect, useState, useCallback, useMemo } from "react";
|
|
503
|
-
import PropTypes from "prop-types";
|
|
504
529
|
import useMap from "../../hooks/useMap";
|
|
505
|
-
|
|
506
|
-
import Button from "@mui/material/Button";
|
|
507
|
-
import GpsFixedIcon from "@mui/icons-material/GpsFixed";
|
|
508
|
-
import { point, circle, lineArc } from "@turf/turf";
|
|
509
530
|
import MlGeoJsonLayer from "../MlGeoJsonLayer/MlGeoJsonLayer";
|
|
510
531
|
|
|
532
|
+
import { Button } from "@mui/material";
|
|
533
|
+
import GpsFixedIcon from "@mui/icons-material/GpsFixed";
|
|
534
|
+
|
|
535
|
+
import { point, circle, lineArc, Feature, Point } from "@turf/turf";
|
|
536
|
+
|
|
537
|
+
interface MlFollowGpsProps {
|
|
538
|
+
/**
|
|
539
|
+
* Id of the target MapLibre instance in mapContext
|
|
540
|
+
*/
|
|
541
|
+
mapId?: string;
|
|
542
|
+
/**
|
|
543
|
+
* The layerId of an existing layer this layer should be rendered visually beneath
|
|
544
|
+
* https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see "beforeId" property
|
|
545
|
+
*/
|
|
546
|
+
insertBeforeLayer?: string;
|
|
547
|
+
/**
|
|
548
|
+
* By default a dot will be shown on the map at the user's location. Set to false to disable.
|
|
549
|
+
*/
|
|
550
|
+
showUserLocation?: boolean;
|
|
551
|
+
/**
|
|
552
|
+
* By default a cone will be shown on the map at the user's location to indicate the device's orientation.
|
|
553
|
+
* Set to false to disable.
|
|
554
|
+
*/
|
|
555
|
+
showOrientation?: boolean;
|
|
556
|
+
/**
|
|
557
|
+
* By default, if showUserLocation is true, a transparent circle will be drawn around the user location
|
|
558
|
+
* indicating the accuracy (95% confidence level) of the user's location. Set to false to disable.
|
|
559
|
+
*/
|
|
560
|
+
showAccuracyCircle?: boolean,
|
|
561
|
+
/**
|
|
562
|
+
* position circle paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the accuracy circle.
|
|
563
|
+
* Use any available paint prop from layer type "fill".
|
|
564
|
+
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
|
|
565
|
+
*/
|
|
566
|
+
circlePaint?: any;
|
|
567
|
+
/**
|
|
568
|
+
* Active button font color
|
|
569
|
+
*/
|
|
570
|
+
onColor?: string;
|
|
571
|
+
/**
|
|
572
|
+
* Inactive button font color
|
|
573
|
+
*/
|
|
574
|
+
offColor?: string;
|
|
575
|
+
/**
|
|
576
|
+
* Accuracy paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the accuracy circle.
|
|
577
|
+
* Use any available paint prop from layer type "fill".
|
|
578
|
+
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
|
|
579
|
+
*/
|
|
580
|
+
accuracyPaint?: any;
|
|
581
|
+
/**
|
|
582
|
+
* CSS style object that is applied to the button component
|
|
583
|
+
*/
|
|
584
|
+
style?: any;
|
|
585
|
+
}
|
|
586
|
+
|
|
511
587
|
/**
|
|
512
588
|
* Adds a button that makes the map follow the users GPS position using
|
|
513
589
|
* navigator.geolocation.watchPosition if activated
|
|
514
590
|
*
|
|
515
|
-
* @param {object} props
|
|
516
|
-
* @param {string} props.mapId Id of the target MapLibre instance in mapContext
|
|
517
|
-
*
|
|
518
|
-
* @component
|
|
519
591
|
*/
|
|
520
|
-
const MlFollowGps = (props) => {
|
|
521
|
-
const mapHook = useMap({
|
|
592
|
+
const MlFollowGps = (props: MlFollowGpsProps) => {
|
|
593
|
+
const mapHook = useMap({
|
|
594
|
+
mapId: props.mapId,
|
|
595
|
+
waitForLayer: props.insertBeforeLayer,
|
|
596
|
+
});
|
|
522
597
|
|
|
523
598
|
const [isFollowed, setIsFollowed] = useState(false);
|
|
524
|
-
const [userLocationGeoJson, setUserLocationGeoJson] =
|
|
599
|
+
const [userLocationGeoJson, setUserLocationGeoJson] =
|
|
600
|
+
useState<Feature<Point>>();
|
|
525
601
|
const [locationAccessDenied, setLocationAccessDenied] = useState(false);
|
|
526
|
-
const [accuracyGeoJson, setAccuracyGeoJson] = useState();
|
|
602
|
+
const [accuracyGeoJson, setAccuracyGeoJson] = useState<Feature>();
|
|
527
603
|
const [deviceOrientation, setDeviceOrientation] = useState(0);
|
|
528
604
|
|
|
529
605
|
const getLocationSuccess = useCallback(
|
|
530
606
|
<span class="fstat-no" title="function not covered" > (p</span>os) => {
|
|
531
607
|
<span class="cstat-no" title="statement not covered" > if (!mapHook.map) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
532
608
|
|
|
533
|
-
<span class="cstat-no" title="statement not covered" > mapHook.map.flyTo({</span>
|
|
609
|
+
<span class="cstat-no" title="statement not covered" > mapHook.map.map.flyTo({</span>
|
|
534
610
|
center: [pos.coords.longitude, pos.coords.latitude],
|
|
535
611
|
zoom: 18,
|
|
536
612
|
speed: 1,
|
|
@@ -544,52 +620,55 @@ const MlFollowGps = (props) => {
|
|
|
544
620
|
[mapHook.map, props]
|
|
545
621
|
);
|
|
546
622
|
|
|
547
|
-
const getLocationError = <span class="fstat-no" title="function not covered" >(
|
|
623
|
+
const getLocationError = <span class="fstat-no" title="function not covered" >()</span> => {
|
|
548
624
|
<span class="cstat-no" title="statement not covered" > console.log("Access of user location denied");</span>
|
|
549
625
|
<span class="cstat-no" title="statement not covered" > setLocationAccessDenied(true);</span>
|
|
550
626
|
};
|
|
551
627
|
|
|
552
|
-
const orientationCone = useMemo(
|
|
553
|
-
()
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
<span class="cstat-no" title="statement not covered" >
|
|
564
|
-
<span class="cstat-no" title="statement not covered" >
|
|
565
|
-
|
|
566
|
-
}, [deviceOrientation, userLocationGeoJson]
|
|
567
|
-
)
|
|
628
|
+
const orientationCone = useMemo(() => {
|
|
629
|
+
<span class="missing-if-branch" title="else path not taken" >E</span>if (!userLocationGeoJson) {
|
|
630
|
+
return undefined;
|
|
631
|
+
}
|
|
632
|
+
let radius = <span class="cstat-no" title="statement not covered" >0.02;</span>
|
|
633
|
+
let bearing1 = <span class="cstat-no" title="statement not covered" >deviceOrientation - 15;</span>
|
|
634
|
+
let bearing2 = <span class="cstat-no" title="statement not covered" >deviceOrientation + 15;</span>
|
|
635
|
+
const options = <span class="cstat-no" title="statement not covered" >{ steps: 65 };</span>
|
|
636
|
+
let arc = <span class="cstat-no" title="statement not covered" >lineArc(userLocationGeoJson, radius, bearing1, bearing2, options);</span>
|
|
637
|
+
let copy = <span class="cstat-no" title="statement not covered" >arc;</span>
|
|
638
|
+
<span class="cstat-no" title="statement not covered" > copy.geometry.coordinates.push(userLocationGeoJson.geometry.coordinates);</span>
|
|
639
|
+
<span class="cstat-no" title="statement not covered" > copy.geometry.coordinates.slice(0, 0);</span>
|
|
640
|
+
<span class="cstat-no" title="statement not covered" > return copy;</span>
|
|
641
|
+
}, [deviceOrientation, userLocationGeoJson]);
|
|
568
642
|
|
|
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)
|
|
571
|
-
}
|
|
643
|
+
const handleOrientation = <span class="fstat-no" title="function not covered" >(e</span>vent: any) => {
|
|
644
|
+
<span class="cstat-no" title="statement not covered" > setDeviceOrientation(-event.alpha);</span>
|
|
645
|
+
};
|
|
572
646
|
|
|
573
647
|
useEffect(() => {
|
|
574
648
|
if (isFollowed) {
|
|
575
649
|
let _handleOrientation = handleOrientation;
|
|
576
|
-
window.addEventListener(
|
|
650
|
+
window.addEventListener("deviceorientation", _handleOrientation);
|
|
577
651
|
return () => {
|
|
578
|
-
window.removeEventListener(
|
|
579
|
-
}
|
|
652
|
+
window.removeEventListener("deviceorientation", _handleOrientation);
|
|
653
|
+
};
|
|
580
654
|
}
|
|
655
|
+
return;
|
|
581
656
|
}, [isFollowed]);
|
|
582
657
|
|
|
583
658
|
useEffect(() => {
|
|
584
659
|
if (!mapHook.map) return;
|
|
585
660
|
|
|
586
661
|
if (isFollowed) {
|
|
587
|
-
let _watchId = navigator.geolocation.watchPosition(
|
|
662
|
+
let _watchId = navigator.geolocation.watchPosition(
|
|
663
|
+
getLocationSuccess,
|
|
664
|
+
getLocationError
|
|
665
|
+
);
|
|
588
666
|
|
|
589
667
|
return () => {
|
|
590
668
|
navigator.geolocation.clearWatch(_watchId);
|
|
591
669
|
};
|
|
592
670
|
}
|
|
671
|
+
return;
|
|
593
672
|
}, [mapHook.map, isFollowed, getLocationSuccess]);
|
|
594
673
|
|
|
595
674
|
return (
|
|
@@ -636,14 +715,18 @@ const MlFollowGps = (props) => {
|
|
|
636
715
|
)}
|
|
637
716
|
|
|
638
717
|
<Button
|
|
639
|
-
sx={{
|
|
718
|
+
sx={{
|
|
719
|
+
zIndex: 1002,
|
|
720
|
+
color: isFollowed ? props.onColor : props.offColor,
|
|
721
|
+
...props.style,
|
|
722
|
+
}}
|
|
640
723
|
disabled={locationAccessDenied}
|
|
641
724
|
onClick={() => {
|
|
642
725
|
setIsFollowed(!isFollowed);
|
|
643
726
|
}}
|
|
644
727
|
>
|
|
645
728
|
{" "}
|
|
646
|
-
<GpsFixedIcon sx={{ fontSize: props.style
|
|
729
|
+
<GpsFixedIcon sx={{ ...(props.style?.fontSize?{fontSize: props.style?.fontSize}:<span class="branch-1 cbranch-no" title="branch not covered" >{})</span> }} />{" "}
|
|
647
730
|
</Button>
|
|
648
731
|
</>
|
|
649
732
|
);
|
|
@@ -669,53 +752,9 @@ MlFollowGps.defaultProps = {
|
|
|
669
752
|
offColor: "#666",
|
|
670
753
|
showAccuracyCircle: true,
|
|
671
754
|
showUserLocation: true,
|
|
672
|
-
showOrientation: true
|
|
755
|
+
showOrientation: true,
|
|
673
756
|
};
|
|
674
757
|
|
|
675
|
-
MlFollowGps.propTypes = {
|
|
676
|
-
/**
|
|
677
|
-
* Id of the target MapLibre instance in mapContext
|
|
678
|
-
*/
|
|
679
|
-
mapId: PropTypes.string,
|
|
680
|
-
/**
|
|
681
|
-
* CSS style object that is applied to the button component
|
|
682
|
-
*/
|
|
683
|
-
style: PropTypes.object,
|
|
684
|
-
/**
|
|
685
|
-
* Active button font color
|
|
686
|
-
*/
|
|
687
|
-
onColor: PropTypes.string,
|
|
688
|
-
/**
|
|
689
|
-
* Inactive button font color
|
|
690
|
-
*/
|
|
691
|
-
offColor: PropTypes.string,
|
|
692
|
-
/**
|
|
693
|
-
* Accuracy paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the accuracy circle.
|
|
694
|
-
* Use any available paint prop from layer type "fill".
|
|
695
|
-
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
|
|
696
|
-
*/
|
|
697
|
-
accuracyPaint: PropTypes.object,
|
|
698
|
-
/**
|
|
699
|
-
* position circle paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the accuracy circle.
|
|
700
|
-
* Use any available paint prop from layer type "fill".
|
|
701
|
-
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
|
|
702
|
-
*/
|
|
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,
|
|
718
|
-
};
|
|
719
758
|
export default MlFollowGps;
|
|
720
759
|
</pre></td></tr></table></pre>
|
|
721
760
|
|
|
@@ -724,7 +763,7 @@ export default MlFollowGps;
|
|
|
724
763
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
725
764
|
Code coverage generated by
|
|
726
765
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
727
|
-
at
|
|
766
|
+
at Wed Apr 20 2022 08:13:18 GMT+0000 (Coordinated Universal Time)
|
|
728
767
|
</div>
|
|
729
768
|
<script src="../../../prettify.js"></script>
|
|
730
769
|
<script>
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">60% </span>
|
|
26
|
+
<span class="strong">60.78% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>31/51</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">64% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>16/25</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">
|
|
47
|
+
<span class="strong">62.5% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>30/48</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -79,18 +79,18 @@
|
|
|
79
79
|
</tr>
|
|
80
80
|
</thead>
|
|
81
81
|
<tbody><tr>
|
|
82
|
-
<td class="file medium" data-value="MlFollowGps.
|
|
83
|
-
<td data-value="60" class="pic medium">
|
|
82
|
+
<td class="file medium" data-value="MlFollowGps.tsx"><a href="MlFollowGps.tsx.html">MlFollowGps.tsx</a></td>
|
|
83
|
+
<td data-value="60.78" class="pic medium">
|
|
84
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="60" class="pct medium">60%</td>
|
|
87
|
-
<td data-value="
|
|
88
|
-
<td data-value="
|
|
89
|
-
<td data-value="
|
|
86
|
+
<td data-value="60.78" class="pct medium">60.78%</td>
|
|
87
|
+
<td data-value="51" class="abs medium">31/51</td>
|
|
88
|
+
<td data-value="64" class="pct medium">64%</td>
|
|
89
|
+
<td data-value="25" class="abs medium">16/25</td>
|
|
90
90
|
<td data-value="70" class="pct medium">70%</td>
|
|
91
91
|
<td data-value="10" class="abs medium">7/10</td>
|
|
92
|
-
<td data-value="
|
|
93
|
-
<td data-value="
|
|
92
|
+
<td data-value="62.5" class="pct medium">62.5%</td>
|
|
93
|
+
<td data-value="48" class="abs medium">30/48</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 Wed Apr 20 2022 08:13:18 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../../prettify.js"></script>
|
|
107
107
|
<script>
|