@mapcomponents/react-maplibre 0.1.66 → 0.1.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/node_version_test.yml +1 -1
- package/.storybook/main.js +37 -31
- package/.storybook/preview.js +21 -0
- package/CHANGELOG.md +13 -0
- package/coverage/clover.xml +545 -472
- package/coverage/coverage-final.json +18 -17
- package/coverage/lcov-report/index.html +80 -80
- package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +50 -26
- package/coverage/lcov-report/src/components/MapLibreMap/index.html +5 -5
- package/coverage/lcov-report/src/components/MlCenterPosition/MlCenterPosition.tsx.html +30 -51
- package/coverage/lcov-report/src/components/MlCenterPosition/index.html +3 -3
- package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.cy.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfForm/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +48 -105
- package/coverage/lcov-report/src/components/MlFollowGps/index.html +15 -15
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +2 -2
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.js.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.js.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGpxViewer/MlGpxViewer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGpxViewer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +52 -40
- package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +10 -10
- package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +4 -4
- 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.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
- package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlMeasureTool/index.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +41 -113
- package/coverage/lcov-report/src/components/MlNavigationTools/index.html +15 -15
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.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 → MlScaleReference.tsx.html} +57 -36
- package/coverage/lcov-report/src/components/MlScaleReference/index.html +2 -2
- package/coverage/lcov-report/src/components/MlShareMapState/{MlShareMapState.js.html → MlShareMapState.tsx.html} +192 -84
- package/coverage/lcov-report/src/components/MlShareMapState/index.html +20 -20
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/ColorPicker.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerList.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerListItem.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx.html +2 -2
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/index.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/MlSketchTool.tsx.html +2 -2
- package/coverage/lcov-report/src/components/MlSketchTool/index.html +1 -1
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.tsx.html +1 -1
- 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/MlThreejsLayer.tsx.html +769 -0
- package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +25 -10
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
- 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.tsx.html +22 -10
- package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +13 -13
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +11 -11
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +11 -11
- package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +27 -18
- package/coverage/lcov-report/src/components/MlWmsLoader/index.html +11 -11
- package/coverage/lcov-report/src/contexts/MapContext.tsx.html +72 -27
- package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
- package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
- package/coverage/lcov-report/src/contexts/index.html +1 -1
- package/coverage/lcov-report/src/hooks/index.html +21 -21
- package/coverage/lcov-report/src/hooks/useCameraFollowPath/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useCameraFollowPath/useCameraFollowPath.tsx.html +1 -1
- package/coverage/lcov-report/src/hooks/useExportMap/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useExportMap/index.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useExportMap/lib.ts.html +2 -2
- package/coverage/lcov-report/src/hooks/useGpx/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useGpx/useGpx.tsx.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayer.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayerEvent.js.html +9 -9
- package/coverage/lcov-report/src/hooks/useLayerFilter/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayerFilter/useLayerFilter.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayerHoverPopup/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx.html +9 -6
- package/coverage/lcov-report/src/hooks/useMap.ts.html +2 -2
- package/coverage/lcov-report/src/hooks/useMapState.ts.html +8 -29
- package/coverage/lcov-report/src/hooks/useSource.ts.html +10 -10
- package/coverage/lcov-report/src/hooks/useWms.ts.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.ts.html +105 -12
- package/coverage/lcov.info +1038 -917
- package/dist/components/MapLibreMap/MapLibreMap.d.ts +3 -3
- package/dist/components/MapLibreMap/MapLibreMap.stories.d.ts +5 -0
- package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +17 -15
- package/dist/components/MlCenterPosition/MlCenterPosition.d.ts +2 -15
- package/dist/components/MlCenterPosition/MlCenterPosition.stories.d.ts +2 -15
- package/dist/components/MlComponentTemplate/MlComponentTemplate.d.ts +1 -0
- package/dist/components/MlComponentTemplate/MlComponentTemplate.stories.d.ts +2 -1
- package/dist/components/MlCreatePdfButton/MlCreatePdfButton.d.ts +1 -0
- package/dist/components/MlCreatePdfButton/MlCreatePdfButton.stories.d.ts +2 -1
- package/dist/components/MlCreatePdfForm/MlCreatePdfForm.d.ts +1 -0
- package/dist/components/MlCreatePdfForm/MlCreatePdfForm.stories.d.ts +2 -1
- package/dist/components/MlCreatePdfForm/lib/PdfForm.d.ts +1 -0
- package/dist/components/MlCreatePdfForm/lib/_PdfPreview.d.ts +1 -0
- package/dist/components/MlFeatureEditor/MlFeatureEditor.d.ts +1 -0
- package/dist/components/MlFeatureEditor/lib/create_supplementary_points.d.ts +1 -1
- package/dist/components/MlFeatureEditor/lib/create_vertex.d.ts +1 -1
- package/dist/components/MlFillExtrusionLayer/MlFillExtrusionLayer.d.ts +1 -0
- package/dist/components/MlFollowGps/MlFollowGps.d.ts +5 -23
- package/dist/components/MlFollowGps/MlFollowGps.stories.d.ts +2 -2
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +1 -0
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +2 -1
- package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.d.ts +1 -0
- package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.d.ts +1 -0
- package/dist/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.d.ts +4 -1
- package/dist/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.d.ts +1 -0
- package/dist/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.stories.d.ts +2 -1
- package/dist/components/MlGpxViewer/MlGpxViewer.d.ts +1 -0
- package/dist/components/MlGpxViewer/MlGpxViewer.stories.d.ts +2 -1
- package/dist/components/MlGpxViewer/util/GeoJsonProvider.d.ts +1 -0
- package/dist/components/MlGpxViewer/util/MetadataDrawer.d.ts +1 -0
- package/dist/components/MlGpxViewer/util/MlGpxDemoLoader.d.ts +1 -0
- package/dist/components/MlGpxViewer/util/MlGpxViewerInstructions.d.ts +1 -0
- package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.d.ts +1 -0
- package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.d.ts +2 -1
- package/dist/components/MlLayer/MlLayer.d.ts +1 -0
- package/dist/components/MlLayerMagnify/MlLayerMagnify.stories.d.ts +2 -1
- package/dist/components/MlLayerSwipe/MlLayerSwipe.stories.d.ts +2 -1
- package/dist/components/MlMarker/MlMarker.d.ts +1 -0
- package/dist/components/MlMeasureTool/MlMeasureTool.d.ts +1 -0
- package/dist/components/MlNavigationCompass/MlNavigationCompass.d.ts +1 -0
- package/dist/components/MlNavigationTools/MlNavigationTools.d.ts +5 -0
- package/dist/components/MlScaleReference/MlScaleReference.d.ts +8 -1
- package/dist/components/MlShareMapState/MlShareMapState.d.ts +33 -13
- package/dist/components/MlShareMapState/MlShareMapState.stories.d.ts +16 -9
- package/dist/components/MlSketchTool/LayerList/ColorPicker.d.ts +1 -0
- package/dist/components/MlSketchTool/LayerList/LayerList.d.ts +1 -0
- package/dist/components/MlSketchTool/LayerList/LayerListItem.d.ts +1 -0
- package/dist/components/MlSketchTool/LayerList/LayerPropertyForm.d.ts +1 -0
- package/dist/components/MlSketchTool/MlSketchTool.d.ts +1 -0
- package/dist/components/MlSketchTool/MlSketchTool.stories.d.ts +2 -1
- package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.d.ts +1 -0
- package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.d.ts +2 -1
- package/dist/components/MlSpatialElevationProfile/util/getElevationData.d.ts +1 -1
- package/dist/components/MlThreeJsLayer/MlThreeJsLayer.stories.d.ts +2 -1
- package/dist/components/MlThreeJsLayer/MlThreejsLayer.d.ts +30 -0
- package/dist/components/MlThreeJsLayer/lib/GLTFLoader.d.ts +2 -1
- package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +1 -0
- package/dist/components/MlVectorTileLayer/MlVectorTileLayer.d.ts +3 -2
- package/dist/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.stories.d.ts +2 -1
- package/dist/components/MlWmsLayer/MlWmsLayer.d.ts +1 -0
- package/dist/components/MlWmsLoader/MlWmsLoader.d.ts +1 -0
- package/dist/components/MlWmsLoader/MlWmsLoader.stories.d.ts +2 -1
- package/dist/components/MlWmsLoader/utils/MlWmsLoaderInstructions.d.ts +1 -0
- package/dist/components/MlWmsLoader/utils/WMSLinks.d.ts +1 -0
- package/dist/contexts/MapContext.d.ts +13 -2
- package/dist/decorators/EmptyMapDecorator.d.ts +2 -0
- package/dist/decorators/MapContextDecorator.d.ts +1 -1
- package/dist/decorators/MapContextDecoratorHooks.d.ts +1 -1
- package/dist/decorators/MultiMapContextDecorator.d.ts +1 -1
- package/dist/decorators/NoNavToolsDecorator.d.ts +1 -1
- package/dist/decorators/ThemeDecorator.d.ts +2 -0
- package/dist/hooks/useCameraFollowPath/useCameraFollowPath.stories.d.ts +2 -1
- package/dist/hooks/useExportMap/lib.d.ts +1 -1
- package/dist/hooks/useLayerFilter/useLayerFilter.stories.d.ts +2 -1
- package/dist/hooks/useLayerHoverPopup/useLayerHoverPopup.d.ts +1 -0
- package/dist/index.d.ts +25 -8
- package/dist/index.esm.css +0 -97
- package/dist/index.esm.js +2187 -9306
- package/dist/index.esm.js.map +1 -1
- package/dist/setupTests.d.ts +6 -6
- package/dist/ui_components/Dropzone.d.ts +1 -0
- package/dist/ui_components/ImageLoader.d.ts +1 -0
- package/dist/ui_components/LayerList/LayerList.d.ts +6 -0
- package/dist/ui_components/LayerList/LayerList.stories.d.ts +12 -0
- package/dist/ui_components/LayerList/LayerListFolder.d.ts +9 -0
- package/dist/ui_components/LayerList/LayerListItem.d.ts +18 -0
- package/dist/ui_components/LayerList/util/LayerListItemVectorLayer.d.ts +15 -0
- package/dist/ui_components/LayerList/util/LayerPropertyForm.d.ts +10 -0
- package/dist/ui_components/LayerList/util/input/ColorPicker.d.ts +10 -0
- package/dist/ui_components/LoadingOverlayContext.d.ts +0 -1
- package/dist/ui_components/MapcomponentsTheme.d.ts +7 -0
- package/dist/ui_components/Tooltip.d.ts +1 -0
- package/dist/ui_components/TopToolbar.d.ts +1 -0
- package/dist/ui_components/UploadButton.d.ts +1 -0
- package/dist/util/Instructions.d.ts +1 -0
- package/package.json +67 -67
- package/public/thumbnails/{MlGPXViewer.png → MlGpxViewer.png} +0 -0
- package/rollup.config.js +68 -50
- package/src/@types/assets/index.d.ts +20 -0
- package/src/App.css +0 -55
- package/src/components/MapLibreMap/MapLibreMap.stories.js +38 -32
- package/src/components/MapLibreMap/MapLibreMap.tsx +29 -21
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +50 -40
- package/src/components/MlCenterPosition/MlCenterPosition.tsx +22 -29
- package/src/components/MlCreatePdfForm/lib/PdfForm.tsx +6 -6
- package/src/components/MlFollowGps/MlFollowGps.stories.js +28 -10
- package/src/components/MlFollowGps/MlFollowGps.tsx +38 -57
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +1 -1
- package/src/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.ts +16 -10
- package/src/components/MlGpxViewer/MlGpxViewer.stories.tsx +4 -13
- package/src/components/MlGpxViewer/util/MlGpxDemoLoader.tsx +3 -1
- package/src/components/MlLayerMagnify/MlLayerMagnify.tsx +21 -17
- package/src/components/MlLayerSwipe/MlLayerSwipe.tsx +3 -3
- package/src/components/MlNavigationTools/MlNavigationTools.stories.js +4 -5
- package/src/components/MlNavigationTools/MlNavigationTools.tsx +30 -54
- package/src/components/MlScaleReference/{MlScaleReference.js → MlScaleReference.tsx} +38 -31
- package/src/components/MlShareMapState/MlShareMapState.stories.tsx +100 -0
- package/src/components/MlShareMapState/{MlShareMapState.js → MlShareMapState.tsx} +94 -58
- package/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx +1 -1
- package/src/components/MlSketchTool/MlSketchTool.tsx +1 -1
- package/src/components/MlThreeJsLayer/MlThreejsLayer.tsx +228 -0
- package/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx +7 -3
- package/src/components/MlWmsLoader/MlWmsLoader.stories.tsx +3 -11
- package/src/components/MlWmsLoader/MlWmsLoader.tsx +7 -4
- package/src/components/MlWmsLoader/utils/MlWmsLoaderInstructions.tsx +2 -2
- package/src/components/MlWmsLoader/utils/WMSLinks.tsx +1 -1
- package/src/contexts/MapContext.tsx +34 -20
- package/src/custom.d.ts +4 -0
- package/src/decorators/EmptyMapDecorator.js +38 -0
- package/src/decorators/MapContextDecorator.js +31 -26
- package/src/decorators/MapContextDecoratorHooks.js +29 -24
- package/src/decorators/MultiMapContextDecorator.js +71 -71
- package/src/decorators/NoNavToolsDecorator.js +25 -23
- package/src/decorators/ThemeDecorator.js +24 -0
- package/src/decorators/style.css +0 -2
- package/src/hooks/useCameraFollowPath/useCameraFollowPath.stories.tsx +13 -19
- package/src/hooks/useExportMap/lib.ts +1 -1
- package/src/hooks/useGpx/useGpx.stories.js +1 -1
- package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.stories.js +1 -1
- package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx +5 -4
- package/src/hooks/useMap.ts +1 -1
- package/src/hooks/useMapState.stories.js +1 -1
- package/src/hooks/useMapState.ts +6 -13
- package/src/hooks/useSource.ts +1 -1
- package/src/hooks/useSources.stories.js +1 -1
- package/src/index.ts +40 -8
- package/src/ui_components/LayerList/LayerList.stories.tsx +136 -0
- package/src/ui_components/LayerList/LayerList.tsx +12 -0
- package/src/ui_components/LayerList/LayerListFolder.tsx +82 -0
- package/src/ui_components/LayerList/LayerListItem.tsx +180 -0
- package/src/ui_components/LayerList/assets/sample_1.json +26 -0
- package/src/ui_components/LayerList/assets/sample_2.json +22 -0
- package/src/ui_components/LayerList/assets/sample_polygon_1.json +33 -0
- package/src/ui_components/LayerList/assets/style.json +2599 -0
- package/src/ui_components/LayerList/util/LayerListItemVectorLayer.tsx +92 -0
- package/src/ui_components/LayerList/util/LayerPropertyForm.tsx +125 -0
- package/src/ui_components/LayerList/util/input/ColorPicker.tsx +44 -0
- package/src/ui_components/MapcomponentsTheme.tsx +133 -0
- package/src/ui_components/Sidebar.tsx +16 -11
- package/src/ui_components/TopToolbar.tsx +1 -3
- package/src/util/BubbleForInstructions.js +14 -12
- package/tsconfig.json +3 -9
- package/dist/components/MlGPXViewer/MlGPXViewer.d.ts +0 -29
- package/dist/components/MlGPXViewer/MlGPXViewer.stories.d.ts +0 -16
- package/dist/components/MlGPXViewer/MlGPXViewer.test.d.ts +0 -1
- package/dist/components/MlGPXViewer/gpxConverter.d.ts +0 -11
- package/dist/components/MlGPXViewer/util/GeoJsonContext.d.ts +0 -10
- package/dist/components/MlGPXViewer/util/GeoJsonProvider.d.ts +0 -4
- package/dist/components/MlLayer/MlLayer.stories.d.ts +0 -10
- package/dist/custom.d.d.ts +0 -22
- package/dist/decorators/ThemeWrapper.d.ts +0 -3
- package/dist/hooks/exportMap/index.d.ts +0 -11
- package/dist/hooks/exportMap/lib.d.ts +0 -36
- package/dist/ui_components/Legend.d.ts +0 -1
- package/dist/ui_components/LoadingOverlay.d.ts +0 -2
- package/src/components/MlShareMapState/MlShareMapState.stories.js +0 -100
- package/src/custom.d.tsx +0 -26
- package/src/decorators/ThemeWrapper.tsx +0 -9
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>0/
|
|
35
|
+
<span class='fraction'>0/2</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -142,14 +142,7 @@
|
|
|
142
142
|
<a name='L77'></a><a href='#L77'>77</a>
|
|
143
143
|
<a name='L78'></a><a href='#L78'>78</a>
|
|
144
144
|
<a name='L79'></a><a href='#L79'>79</a>
|
|
145
|
-
<a name='L80'></a><a href='#L80'>80</a>
|
|
146
|
-
<a name='L81'></a><a href='#L81'>81</a>
|
|
147
|
-
<a name='L82'></a><a href='#L82'>82</a>
|
|
148
|
-
<a name='L83'></a><a href='#L83'>83</a>
|
|
149
|
-
<a name='L84'></a><a href='#L84'>84</a>
|
|
150
|
-
<a name='L85'></a><a href='#L85'>85</a>
|
|
151
|
-
<a name='L86'></a><a href='#L86'>86</a>
|
|
152
|
-
<a name='L87'></a><a href='#L87'>87</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
145
|
+
<a name='L80'></a><a href='#L80'>80</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
153
146
|
<span class="cline-any cline-neutral"> </span>
|
|
154
147
|
<span class="cline-any cline-neutral"> </span>
|
|
155
148
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -187,26 +180,25 @@
|
|
|
187
180
|
<span class="cline-any cline-neutral"> </span>
|
|
188
181
|
<span class="cline-any cline-neutral"> </span>
|
|
189
182
|
<span class="cline-any cline-neutral"> </span>
|
|
190
|
-
<span class="cline-any cline-no"> </span>
|
|
191
183
|
<span class="cline-any cline-neutral"> </span>
|
|
192
184
|
<span class="cline-any cline-no"> </span>
|
|
193
|
-
<span class="cline-any cline-no"> </span>
|
|
194
|
-
<span class="cline-any cline-neutral"> </span>
|
|
195
185
|
<span class="cline-any cline-neutral"> </span>
|
|
196
186
|
<span class="cline-any cline-no"> </span>
|
|
197
187
|
<span class="cline-any cline-no"> </span>
|
|
198
188
|
<span class="cline-any cline-neutral"> </span>
|
|
199
189
|
<span class="cline-any cline-neutral"> </span>
|
|
200
190
|
<span class="cline-any cline-no"> </span>
|
|
201
|
-
<span class="cline-any cline-no"> </span>
|
|
202
|
-
<span class="cline-any cline-no"> </span>
|
|
203
191
|
<span class="cline-any cline-neutral"> </span>
|
|
204
192
|
<span class="cline-any cline-no"> </span>
|
|
205
193
|
<span class="cline-any cline-neutral"> </span>
|
|
206
194
|
<span class="cline-any cline-neutral"> </span>
|
|
207
195
|
<span class="cline-any cline-neutral"> </span>
|
|
208
196
|
<span class="cline-any cline-neutral"> </span>
|
|
197
|
+
<span class="cline-any cline-no"> </span>
|
|
198
|
+
<span class="cline-any cline-no"> </span>
|
|
199
|
+
<span class="cline-any cline-no"> </span>
|
|
209
200
|
<span class="cline-any cline-neutral"> </span>
|
|
201
|
+
<span class="cline-any cline-no"> </span>
|
|
210
202
|
<span class="cline-any cline-neutral"> </span>
|
|
211
203
|
<span class="cline-any cline-neutral"> </span>
|
|
212
204
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -215,13 +207,6 @@
|
|
|
215
207
|
<span class="cline-any cline-neutral"> </span>
|
|
216
208
|
<span class="cline-any cline-neutral"> </span>
|
|
217
209
|
<span class="cline-any cline-neutral"> </span>
|
|
218
|
-
<span class="cline-any cline-yes">10x</span>
|
|
219
|
-
<span class="cline-any cline-neutral"> </span>
|
|
220
|
-
<span class="cline-any cline-neutral"> </span>
|
|
221
|
-
<span class="cline-any cline-neutral"> </span>
|
|
222
|
-
<span class="cline-any cline-neutral"> </span>
|
|
223
|
-
<span class="cline-any cline-neutral"> </span>
|
|
224
|
-
<span class="cline-any cline-neutral"> </span>
|
|
225
210
|
<span class="cline-any cline-neutral"> </span>
|
|
226
211
|
<span class="cline-any cline-neutral"> </span>
|
|
227
212
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -230,6 +215,7 @@
|
|
|
230
215
|
<span class="cline-any cline-neutral"> </span>
|
|
231
216
|
<span class="cline-any cline-neutral"> </span>
|
|
232
217
|
<span class="cline-any cline-neutral"> </span>
|
|
218
|
+
<span class="cline-any cline-yes">10x</span>
|
|
233
219
|
<span class="cline-any cline-neutral"> </span>
|
|
234
220
|
<span class="cline-any cline-neutral"> </span>
|
|
235
221
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -237,8 +223,8 @@
|
|
|
237
223
|
<span class="cline-any cline-neutral"> </span>
|
|
238
224
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, { useState, useCallback } from "react";
|
|
239
225
|
import useMap from "../../hooks/useMap";
|
|
240
|
-
import { Button, SxProps, Theme } from
|
|
241
|
-
import
|
|
226
|
+
import { Button, SxProps, Theme } from '@mui/material';
|
|
227
|
+
import GpsFixedIcon from '@mui/icons-material/GpsFixed';
|
|
242
228
|
|
|
243
229
|
export interface MlCenterPositionProps {
|
|
244
230
|
/**
|
|
@@ -273,52 +259,45 @@ const MlCenterPosition = <span class="fstat-no" title="function not covered" >(p
|
|
|
273
259
|
mapId: props.mapId,
|
|
274
260
|
waitForLayer: props.insertBeforeLayer,
|
|
275
261
|
});
|
|
262
|
+
|
|
276
263
|
const [locationAccessDenied, setLocationAccessDenied] = <span class="cstat-no" title="statement not covered" >useState(false);</span>
|
|
277
264
|
|
|
278
265
|
const centerCurrentLocation = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
279
266
|
<span class="cstat-no" title="statement not covered" > navigator.geolocation.getCurrentPosition(getLocationSuccess, getLocationError);</span>
|
|
280
267
|
};
|
|
281
268
|
|
|
282
|
-
const getLocationSuccess = <span class="cstat-no" title="statement not covered" >useCallback(
|
|
283
|
-
<span class="
|
|
284
|
-
|
|
269
|
+
const getLocationSuccess = <span class="cstat-no" title="statement not covered" >useCallback(</span>
|
|
270
|
+
<span class="fstat-no" title="function not covered" > (l</span>ocation: GeolocationPosition) => {
|
|
271
|
+
<span class="cstat-no" title="statement not covered" > mapHook.map?.map.setCenter?.([location.coords.longitude, location.coords.latitude]);</span>
|
|
272
|
+
},
|
|
273
|
+
[mapHook.map]
|
|
274
|
+
);
|
|
285
275
|
|
|
286
276
|
const getLocationError = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
287
|
-
<span class="cstat-no" title="statement not covered" > console.log(
|
|
277
|
+
<span class="cstat-no" title="statement not covered" > console.log('Access of user location denied');</span>
|
|
288
278
|
<span class="cstat-no" title="statement not covered" > setLocationAccessDenied(true);</span>
|
|
289
279
|
};
|
|
290
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
291
|
-
|
|
280
|
+
<span class="cstat-no" title="statement not covered" > return (</span>
|
|
281
|
+
<>
|
|
282
|
+
<Button
|
|
283
|
+
variant="navtools"
|
|
292
284
|
sx={{
|
|
293
285
|
zIndex: 1002,
|
|
294
286
|
color: !locationAccessDenied ? props.onColor : props.offColor,
|
|
295
|
-
...props.style,
|
|
296
287
|
}}
|
|
297
|
-
|
|
298
|
-
|
|
288
|
+
onClick={centerCurrentLocation}
|
|
289
|
+
disabled={locationAccessDenied}
|
|
290
|
+
>
|
|
291
|
+
<GpsFixedIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />
|
|
299
292
|
</Button>
|
|
300
|
-
|
|
301
|
-
|
|
293
|
+
</>
|
|
294
|
+
);
|
|
302
295
|
};
|
|
303
296
|
|
|
304
297
|
MlCenterPosition.defaultProps = {
|
|
305
298
|
mapId: undefined,
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
minHeight: "30px",
|
|
309
|
-
width: "30px",
|
|
310
|
-
height: "30px",
|
|
311
|
-
backgroundColor: "#414141",
|
|
312
|
-
borderRadius: "23%",
|
|
313
|
-
margin: 0.15,
|
|
314
|
-
fontSize: "1.3em",
|
|
315
|
-
":hover": {
|
|
316
|
-
backgroundColor: "#515151",
|
|
317
|
-
color: "#ececec",
|
|
318
|
-
},
|
|
319
|
-
},
|
|
320
|
-
onColor: "#ececec",
|
|
321
|
-
offColor: "#666",
|
|
299
|
+
onColor: '#ececec',
|
|
300
|
+
offColor: '#666',
|
|
322
301
|
};
|
|
323
302
|
export default MlCenterPosition;
|
|
324
303
|
</pre></td></tr></table></pre>
|
|
@@ -328,7 +307,7 @@ export default MlCenterPosition;
|
|
|
328
307
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
329
308
|
Code coverage generated by
|
|
330
309
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
331
|
-
at 2023-
|
|
310
|
+
at 2023-02-07T08:13:43.414Z
|
|
332
311
|
</div>
|
|
333
312
|
<script src="../../../prettify.js"></script>
|
|
334
313
|
<script>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>0/
|
|
35
|
+
<span class='fraction'>0/2</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
<td data-value="16.66" class="pct low">16.66%</td>
|
|
87
87
|
<td data-value="12" class="abs low">2/12</td>
|
|
88
88
|
<td data-value="0" class="pct low">0%</td>
|
|
89
|
-
<td data-value="
|
|
89
|
+
<td data-value="2" class="abs low">0/2</td>
|
|
90
90
|
<td data-value="0" class="pct low">0%</td>
|
|
91
91
|
<td data-value="4" class="abs low">0/4</td>
|
|
92
92
|
<td data-value="16.66" class="pct low">16.66%</td>
|
|
@@ -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 2023-
|
|
104
|
+
at 2023-02-07T08:13:43.414Z
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -223,7 +223,7 @@ export default MlCreatePdfButton;
|
|
|
223
223
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
224
224
|
Code coverage generated by
|
|
225
225
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
226
|
-
at 2023-
|
|
226
|
+
at 2023-02-07T08:13:43.414Z
|
|
227
227
|
</div>
|
|
228
228
|
<script src="../../../prettify.js"></script>
|
|
229
229
|
<script>
|
|
@@ -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 2023-
|
|
104
|
+
at 2023-02-07T08:13:43.414Z
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -133,7 +133,7 @@ const {ExampleConfig } = <span class="cstat-no" title="statement not covered" >c
|
|
|
133
133
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
134
134
|
Code coverage generated by
|
|
135
135
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
136
|
-
at 2023-
|
|
136
|
+
at 2023-02-07T08:13:43.414Z
|
|
137
137
|
</div>
|
|
138
138
|
<script src="../../../prettify.js"></script>
|
|
139
139
|
<script>
|
|
@@ -181,7 +181,7 @@ export default MlCreatePdfForm;
|
|
|
181
181
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
182
182
|
Code coverage generated by
|
|
183
183
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
184
|
-
at 2023-
|
|
184
|
+
at 2023-02-07T08:13:43.414Z
|
|
185
185
|
</div>
|
|
186
186
|
<script src="../../../prettify.js"></script>
|
|
187
187
|
<script>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at 2023-
|
|
119
|
+
at 2023-02-07T08:13:43.414Z
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../../../prettify.js"></script>
|
|
122
122
|
<script>
|
|
@@ -520,7 +520,7 @@ export default MlFeatureEditor;
|
|
|
520
520
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
521
521
|
Code coverage generated by
|
|
522
522
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
523
|
-
at 2023-
|
|
523
|
+
at 2023-02-07T08:13:43.414Z
|
|
524
524
|
</div>
|
|
525
525
|
<script src="../../../prettify.js"></script>
|
|
526
526
|
<script>
|
|
@@ -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 2023-
|
|
104
|
+
at 2023-02-07T08:13:43.414Z
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../../prettify.js"></script>
|
|
107
107
|
<script>
|
package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html
CHANGED
|
@@ -325,7 +325,7 @@ export default MlFillExtrusionLayer;
|
|
|
325
325
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
326
326
|
Code coverage generated by
|
|
327
327
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
328
|
-
at 2023-
|
|
328
|
+
at 2023-02-07T08:13:43.414Z
|
|
329
329
|
</div>
|
|
330
330
|
<script src="../../../prettify.js"></script>
|
|
331
331
|
<script>
|
|
@@ -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 2023-
|
|
104
|
+
at 2023-02-07T08:13:43.414Z
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">56.89% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>33/
|
|
28
|
+
<span class='fraction'>33/58</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">46.87% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>15/32</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">58.18% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>32/
|
|
49
|
+
<span class='fraction'>32/55</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -304,30 +304,7 @@
|
|
|
304
304
|
<a name='L239'></a><a href='#L239'>239</a>
|
|
305
305
|
<a name='L240'></a><a href='#L240'>240</a>
|
|
306
306
|
<a name='L241'></a><a href='#L241'>241</a>
|
|
307
|
-
<a name='L242'></a><a href='#L242'>242</a>
|
|
308
|
-
<a name='L243'></a><a href='#L243'>243</a>
|
|
309
|
-
<a name='L244'></a><a href='#L244'>244</a>
|
|
310
|
-
<a name='L245'></a><a href='#L245'>245</a>
|
|
311
|
-
<a name='L246'></a><a href='#L246'>246</a>
|
|
312
|
-
<a name='L247'></a><a href='#L247'>247</a>
|
|
313
|
-
<a name='L248'></a><a href='#L248'>248</a>
|
|
314
|
-
<a name='L249'></a><a href='#L249'>249</a>
|
|
315
|
-
<a name='L250'></a><a href='#L250'>250</a>
|
|
316
|
-
<a name='L251'></a><a href='#L251'>251</a>
|
|
317
|
-
<a name='L252'></a><a href='#L252'>252</a>
|
|
318
|
-
<a name='L253'></a><a href='#L253'>253</a>
|
|
319
|
-
<a name='L254'></a><a href='#L254'>254</a>
|
|
320
|
-
<a name='L255'></a><a href='#L255'>255</a>
|
|
321
|
-
<a name='L256'></a><a href='#L256'>256</a>
|
|
322
|
-
<a name='L257'></a><a href='#L257'>257</a>
|
|
323
|
-
<a name='L258'></a><a href='#L258'>258</a>
|
|
324
|
-
<a name='L259'></a><a href='#L259'>259</a>
|
|
325
|
-
<a name='L260'></a><a href='#L260'>260</a>
|
|
326
|
-
<a name='L261'></a><a href='#L261'>261</a></td><td class="line-coverage quiet"><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>
|
|
307
|
+
<a name='L242'></a><a href='#L242'>242</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
331
308
|
<span class="cline-any cline-neutral"> </span>
|
|
332
309
|
<span class="cline-any cline-neutral"> </span>
|
|
333
310
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -465,6 +442,8 @@
|
|
|
465
442
|
<span class="cline-any cline-neutral"> </span>
|
|
466
443
|
<span class="cline-any cline-yes">9x</span>
|
|
467
444
|
<span class="cline-any cline-no"> </span>
|
|
445
|
+
<span class="cline-any cline-no"> </span>
|
|
446
|
+
<span class="cline-any cline-neutral"> </span>
|
|
468
447
|
<span class="cline-any cline-neutral"> </span>
|
|
469
448
|
<span class="cline-any cline-neutral"> </span>
|
|
470
449
|
<span class="cline-any cline-yes">9x</span>
|
|
@@ -554,9 +533,6 @@
|
|
|
554
533
|
<span class="cline-any cline-neutral"> </span>
|
|
555
534
|
<span class="cline-any cline-neutral"> </span>
|
|
556
535
|
<span class="cline-any cline-neutral"> </span>
|
|
557
|
-
<span class="cline-any cline-neutral"> </span>
|
|
558
|
-
<span class="cline-any cline-neutral"> </span>
|
|
559
|
-
<span class="cline-any cline-neutral"> </span>
|
|
560
536
|
<span class="cline-any cline-yes">11x</span>
|
|
561
537
|
<span class="cline-any cline-neutral"> </span>
|
|
562
538
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -569,29 +545,15 @@
|
|
|
569
545
|
<span class="cline-any cline-neutral"> </span>
|
|
570
546
|
<span class="cline-any cline-neutral"> </span>
|
|
571
547
|
<span class="cline-any cline-neutral"> </span>
|
|
572
|
-
<span class="cline-any cline-neutral"> </span>
|
|
573
|
-
<span class="cline-any cline-neutral"> </span>
|
|
574
|
-
<span class="cline-any cline-neutral"> </span>
|
|
575
|
-
<span class="cline-any cline-neutral"> </span>
|
|
576
|
-
<span class="cline-any cline-neutral"> </span>
|
|
577
|
-
<span class="cline-any cline-neutral"> </span>
|
|
578
|
-
<span class="cline-any cline-neutral"> </span>
|
|
579
|
-
<span class="cline-any cline-neutral"> </span>
|
|
580
|
-
<span class="cline-any cline-neutral"> </span>
|
|
581
|
-
<span class="cline-any cline-neutral"> </span>
|
|
582
|
-
<span class="cline-any cline-neutral"> </span>
|
|
583
|
-
<span class="cline-any cline-neutral"> </span>
|
|
584
|
-
<span class="cline-any cline-neutral"> </span>
|
|
585
|
-
<span class="cline-any cline-neutral"> </span>
|
|
586
548
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, { useRef, useEffect, useState, useCallback, useMemo } from "react";
|
|
587
549
|
import useMap from "../../hooks/useMap";
|
|
588
550
|
import MlGeoJsonLayer from "../MlGeoJsonLayer/MlGeoJsonLayer";
|
|
589
551
|
|
|
590
|
-
import { Button
|
|
591
|
-
import GpsFixedIcon from
|
|
552
|
+
import { Button } from '@mui/material';
|
|
553
|
+
import GpsFixedIcon from '@mui/icons-material/GpsFixed';
|
|
592
554
|
|
|
593
|
-
import { point, circle, lineArc, Feature, Point } from
|
|
594
|
-
import { CircleLayerSpecification, FillLayerSpecification } from
|
|
555
|
+
import { point, circle, lineArc, Feature, Point } from '@turf/turf';
|
|
556
|
+
import { CircleLayerSpecification, FillLayerSpecification } from 'maplibre-gl';
|
|
595
557
|
|
|
596
558
|
interface MlFollowGpsProps {
|
|
597
559
|
/**
|
|
@@ -632,13 +594,13 @@ interface MlFollowGpsProps {
|
|
|
632
594
|
* Use any available paint prop from layer type "fill".
|
|
633
595
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
|
|
634
596
|
*/
|
|
635
|
-
orientationConePaint?: FillLayerSpecification[
|
|
597
|
+
orientationConePaint?: FillLayerSpecification['paint'];
|
|
636
598
|
/**
|
|
637
599
|
* Position circle paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the position circle.
|
|
638
600
|
* Use any available paint prop from layer type "circle".
|
|
639
601
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
|
|
640
602
|
*/
|
|
641
|
-
circlePaint?: CircleLayerSpecification[
|
|
603
|
+
circlePaint?: CircleLayerSpecification['paint'];
|
|
642
604
|
/**
|
|
643
605
|
* Active button font color
|
|
644
606
|
*/
|
|
@@ -652,11 +614,7 @@ interface MlFollowGpsProps {
|
|
|
652
614
|
* Use any available paint prop from layer type "fill".
|
|
653
615
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
|
|
654
616
|
*/
|
|
655
|
-
accuracyPaint?: FillLayerSpecification[
|
|
656
|
-
/**
|
|
657
|
-
* CSS style object that is applied to the button component
|
|
658
|
-
*/
|
|
659
|
-
buttonSx?: SxProps | any;
|
|
617
|
+
accuracyPaint?: FillLayerSpecification['paint'];
|
|
660
618
|
}
|
|
661
619
|
|
|
662
620
|
/**
|
|
@@ -678,7 +636,7 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
|
|
|
678
636
|
const initiallyCentered = useRef(false);
|
|
679
637
|
|
|
680
638
|
const getLocationSuccess = useCallback(
|
|
681
|
-
<span class="fstat-no" title="function not covered" > (p</span>os) => {
|
|
639
|
+
<span class="fstat-no" title="function not covered" > (p</span>os: GeolocationPosition) => {
|
|
682
640
|
<span class="cstat-no" title="statement not covered" > if (!mapHook.map) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
683
641
|
|
|
684
642
|
<span class="cstat-no" title="statement not covered" > if ((!props.centerUserPosition && !initiallyCentered.current) || props.centerUserPosition) {</span>
|
|
@@ -704,7 +662,7 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
|
|
|
704
662
|
);
|
|
705
663
|
|
|
706
664
|
const getLocationError = <span class="fstat-no" title="function not covered" >()</span> => {
|
|
707
|
-
<span class="cstat-no" title="statement not covered" > console.log(
|
|
665
|
+
<span class="cstat-no" title="statement not covered" > console.log('Access of user location denied');</span>
|
|
708
666
|
<span class="cstat-no" title="statement not covered" > setLocationAccessDenied(true);</span>
|
|
709
667
|
};
|
|
710
668
|
|
|
@@ -712,27 +670,29 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
|
|
|
712
670
|
<span class="missing-if-branch" title="else path not taken" >E</span>if (!userLocationGeoJson) {
|
|
713
671
|
return undefined;
|
|
714
672
|
}
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
673
|
+
const radius = <span class="cstat-no" title="statement not covered" >0.02;</span>
|
|
674
|
+
const bearing1 = <span class="cstat-no" title="statement not covered" >deviceOrientation - 15;</span>
|
|
675
|
+
const bearing2 = <span class="cstat-no" title="statement not covered" >deviceOrientation + 15;</span>
|
|
718
676
|
const options = <span class="cstat-no" title="statement not covered" >{ steps: 65 };</span>
|
|
719
|
-
|
|
720
|
-
|
|
677
|
+
const arc = <span class="cstat-no" title="statement not covered" >lineArc(userLocationGeoJson, radius, bearing1, bearing2, options);</span>
|
|
678
|
+
const copy = <span class="cstat-no" title="statement not covered" >arc;</span>
|
|
721
679
|
<span class="cstat-no" title="statement not covered" > copy.geometry.coordinates.push(userLocationGeoJson.geometry.coordinates);</span>
|
|
722
680
|
<span class="cstat-no" title="statement not covered" > copy.geometry.coordinates.slice(0, 0);</span>
|
|
723
681
|
<span class="cstat-no" title="statement not covered" > return copy;</span>
|
|
724
682
|
}, [deviceOrientation, userLocationGeoJson]);
|
|
725
683
|
|
|
726
|
-
const handleOrientation = <span class="fstat-no" title="function not covered" >(e</span>vent:
|
|
727
|
-
<span class="cstat-no" title="statement not covered" >
|
|
684
|
+
const handleOrientation = <span class="fstat-no" title="function not covered" >(e</span>vent: DeviceOrientationEvent) => {
|
|
685
|
+
<span class="cstat-no" title="statement not covered" > if (event?.alpha) {</span>
|
|
686
|
+
<span class="cstat-no" title="statement not covered" > setDeviceOrientation(-event.alpha);</span>
|
|
687
|
+
}
|
|
728
688
|
};
|
|
729
689
|
|
|
730
690
|
useEffect(() => {
|
|
731
691
|
if (isFollowed) {
|
|
732
|
-
|
|
733
|
-
window.addEventListener(
|
|
692
|
+
const _handleOrientation = handleOrientation;
|
|
693
|
+
window.addEventListener('deviceorientation', _handleOrientation);
|
|
734
694
|
return () => {
|
|
735
|
-
window.removeEventListener(
|
|
695
|
+
window.removeEventListener('deviceorientation', _handleOrientation);
|
|
736
696
|
};
|
|
737
697
|
} else {
|
|
738
698
|
initiallyCentered.current = false;
|
|
@@ -744,7 +704,7 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
|
|
|
744
704
|
if (!mapHook.map) return;
|
|
745
705
|
|
|
746
706
|
if (isFollowed) {
|
|
747
|
-
|
|
707
|
+
const _watchId = navigator.geolocation.watchPosition(getLocationSuccess, getLocationError);
|
|
748
708
|
|
|
749
709
|
return () => {
|
|
750
710
|
navigator.geolocation.clearWatch(_watchId);
|
|
@@ -758,10 +718,10 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
|
|
|
758
718
|
{isFollowed && userLocationGeoJson && (
|
|
759
719
|
<span class="branch-2 cbranch-no" title="branch not covered" > <MlGeoJsonLayer</span>
|
|
760
720
|
geojson={accuracyGeoJson}
|
|
761
|
-
type={
|
|
721
|
+
type={'fill'}
|
|
762
722
|
paint={{
|
|
763
|
-
|
|
764
|
-
|
|
723
|
+
'fill-color': '#cbd300',
|
|
724
|
+
'fill-opacity': 0.3,
|
|
765
725
|
...props.accuracyPaint,
|
|
766
726
|
}}
|
|
767
727
|
insertBeforeLayer={props.insertBeforeLayer}
|
|
@@ -771,11 +731,11 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
|
|
|
771
731
|
{isFollowed && orientationCone && (
|
|
772
732
|
<span class="branch-2 cbranch-no" title="branch not covered" > <MlGeoJsonLayer</span>
|
|
773
733
|
geojson={orientationCone}
|
|
774
|
-
type={
|
|
734
|
+
type={'fill'}
|
|
775
735
|
paint={{
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
736
|
+
'fill-color': '#0000ff',
|
|
737
|
+
'fill-antialias': false,
|
|
738
|
+
'fill-opacity': 0.3,
|
|
779
739
|
...props.orientationConePaint,
|
|
780
740
|
}}
|
|
781
741
|
insertBeforeLayer={props.insertBeforeLayer}
|
|
@@ -785,12 +745,12 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
|
|
|
785
745
|
{isFollowed && userLocationGeoJson && (
|
|
786
746
|
<span class="branch-2 cbranch-no" title="branch not covered" > <MlGeoJsonLayer</span>
|
|
787
747
|
geojson={userLocationGeoJson}
|
|
788
|
-
type={
|
|
748
|
+
type={'circle'}
|
|
789
749
|
paint={{
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
750
|
+
'circle-color': '#009ee0',
|
|
751
|
+
'circle-radius': 5,
|
|
752
|
+
'circle-stroke-color': '#fafaff',
|
|
753
|
+
'circle-stroke-width': 1,
|
|
794
754
|
...props.circlePaint,
|
|
795
755
|
}}
|
|
796
756
|
insertBeforeLayer={props.insertBeforeLayer}
|
|
@@ -798,20 +758,17 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
|
|
|
798
758
|
)}
|
|
799
759
|
|
|
800
760
|
<Button
|
|
761
|
+
variant="navtools"
|
|
801
762
|
sx={{
|
|
802
763
|
zIndex: 1002,
|
|
803
764
|
color: isFollowed ? props.onColor : props.offColor,
|
|
804
|
-
...props.buttonSx,
|
|
805
765
|
}}
|
|
806
766
|
disabled={locationAccessDenied}
|
|
807
767
|
onClick={() => {
|
|
808
768
|
setIsFollowed(!isFollowed);
|
|
809
769
|
}}
|
|
810
770
|
>
|
|
811
|
-
{
|
|
812
|
-
<GpsFixedIcon
|
|
813
|
-
sx={{ ...(props.buttonSx?.fontSize ? { fontSize: props.buttonSx?.fontSize } : <span class="branch-1 cbranch-no" title="branch not covered" >{})</span> }}
|
|
814
|
-
/>{" "}
|
|
771
|
+
<GpsFixedIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />
|
|
815
772
|
</Button>
|
|
816
773
|
</>
|
|
817
774
|
);
|
|
@@ -819,22 +776,8 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
|
|
|
819
776
|
|
|
820
777
|
MlFollowGps.defaultProps = {
|
|
821
778
|
mapId: undefined,
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
minHeight: "30px",
|
|
825
|
-
width: "30px",
|
|
826
|
-
height: "30px",
|
|
827
|
-
backgroundColor: "#414141",
|
|
828
|
-
borderRadius: "23%",
|
|
829
|
-
margin: 0.15,
|
|
830
|
-
fontSize: "1.3em",
|
|
831
|
-
":hover": {
|
|
832
|
-
backgroundColor: "#515151",
|
|
833
|
-
color: "#ececec",
|
|
834
|
-
},
|
|
835
|
-
},
|
|
836
|
-
onColor: "#ececec",
|
|
837
|
-
offColor: "#666",
|
|
779
|
+
onColor: '#ececec',
|
|
780
|
+
offColor: '#666',
|
|
838
781
|
showAccuracyCircle: true,
|
|
839
782
|
showUserLocation: true,
|
|
840
783
|
showOrientation: true,
|
|
@@ -850,7 +793,7 @@ export default MlFollowGps;
|
|
|
850
793
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
851
794
|
Code coverage generated by
|
|
852
795
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
853
|
-
at 2023-
|
|
796
|
+
at 2023-02-07T08:13:43.414Z
|
|
854
797
|
</div>
|
|
855
798
|
<script src="../../../prettify.js"></script>
|
|
856
799
|
<script>
|