@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
|
@@ -1,49 +1,52 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
|
|
3
|
-
import MapLibreMap from
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
3
|
+
import MapLibreMap from './MapLibreMap';
|
|
4
|
+
import MlGeoJsonLayer from '../MlGeoJsonLayer/MlGeoJsonLayer';
|
|
5
|
+
import { Button } from '@mui/material';
|
|
6
|
+
import TopToolbar from '../../ui_components/TopToolbar';
|
|
7
|
+
import sample_geojson_1 from '../MlGeoJsonLayer/assets/sample_1.json';
|
|
8
|
+
|
|
9
|
+
import themeDecorator from '../../decorators/ThemeDecorator';
|
|
9
10
|
|
|
10
11
|
const storyoptions = {
|
|
11
|
-
title:
|
|
12
|
+
title: 'Core/MapLibreMap',
|
|
12
13
|
component: MapLibreMap,
|
|
13
14
|
argTypes: {
|
|
14
15
|
options: {
|
|
15
16
|
control: {
|
|
16
|
-
type:
|
|
17
|
+
type: 'object',
|
|
17
18
|
},
|
|
18
19
|
},
|
|
19
20
|
},
|
|
21
|
+
decorators: themeDecorator,
|
|
22
|
+
parameters: {
|
|
23
|
+
sourceLink: 'components/MapLibreMap/MapLibreMap.tsx',
|
|
24
|
+
},
|
|
20
25
|
};
|
|
21
26
|
export default storyoptions;
|
|
22
27
|
|
|
23
28
|
const Template = (args) => {
|
|
24
29
|
return (
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/>
|
|
39
|
-
</MapComponentsProvider>
|
|
30
|
+
<MapLibreMap
|
|
31
|
+
options={{ ...args.options }}
|
|
32
|
+
style={{
|
|
33
|
+
position: 'absolute',
|
|
34
|
+
height: '100vh',
|
|
35
|
+
width: '100vw',
|
|
36
|
+
top: 0,
|
|
37
|
+
right: 0,
|
|
38
|
+
left: 0,
|
|
39
|
+
bottom: 0,
|
|
40
|
+
zIndex: 100,
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
40
43
|
);
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
export const ExampleConfig = Template.bind({});
|
|
44
47
|
ExampleConfig.args = {
|
|
45
48
|
options: {
|
|
46
|
-
style:
|
|
49
|
+
style: 'https://wms.wheregroup.com/tileserver/style/osm-bright.json',
|
|
47
50
|
center: [8.607, 53.1409349],
|
|
48
51
|
zoom: 14,
|
|
49
52
|
},
|
|
@@ -51,23 +54,26 @@ ExampleConfig.args = {
|
|
|
51
54
|
|
|
52
55
|
const StyleChangeTemplate = (args) => {
|
|
53
56
|
const [activeStyle, setActiveStyle] = useState(
|
|
54
|
-
|
|
57
|
+
'https://wms.wheregroup.com/tileserver/style/osm-fiord-color.json'
|
|
55
58
|
);
|
|
56
59
|
|
|
57
60
|
return (
|
|
58
|
-
|
|
61
|
+
<>
|
|
59
62
|
<TopToolbar>
|
|
60
63
|
<Button
|
|
61
64
|
onClick={() =>
|
|
62
|
-
setActiveStyle(
|
|
65
|
+
setActiveStyle('https://wms.wheregroup.com/tileserver/style/osm-bright.json')
|
|
63
66
|
}
|
|
67
|
+
variant="contained"
|
|
68
|
+
sx={{ marginRight: '5px' }}
|
|
64
69
|
>
|
|
65
70
|
OSM-Bright
|
|
66
71
|
</Button>
|
|
67
72
|
<Button
|
|
68
73
|
onClick={() =>
|
|
69
|
-
setActiveStyle(
|
|
74
|
+
setActiveStyle('https://wms.wheregroup.com/tileserver/style/osm-fiord-color.json')
|
|
70
75
|
}
|
|
76
|
+
variant="contained"
|
|
71
77
|
>
|
|
72
78
|
OSM-Fiord-Color
|
|
73
79
|
</Button>
|
|
@@ -75,9 +81,9 @@ const StyleChangeTemplate = (args) => {
|
|
|
75
81
|
<MapLibreMap
|
|
76
82
|
options={{ ...args.options, style: activeStyle }}
|
|
77
83
|
style={{
|
|
78
|
-
position:
|
|
79
|
-
height:
|
|
80
|
-
width:
|
|
84
|
+
position: 'absolute',
|
|
85
|
+
height: '100vh',
|
|
86
|
+
width: '100vw',
|
|
81
87
|
top: 0,
|
|
82
88
|
right: 0,
|
|
83
89
|
left: 0,
|
|
@@ -86,7 +92,7 @@ const StyleChangeTemplate = (args) => {
|
|
|
86
92
|
}}
|
|
87
93
|
/>
|
|
88
94
|
<MlGeoJsonLayer type="line" geojson={sample_geojson_1} />
|
|
89
|
-
|
|
95
|
+
</>
|
|
90
96
|
);
|
|
91
97
|
};
|
|
92
98
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useContext, FC,
|
|
1
|
+
import React, { useRef, useEffect, useContext, FC, RefObject } from 'react';
|
|
2
2
|
|
|
3
|
-
import MapContext from
|
|
4
|
-
import MapLibreGlWrapper from
|
|
3
|
+
import MapContext, { MapContextType } from '../../contexts/MapContext';
|
|
4
|
+
import MapLibreGlWrapper from './lib/MapLibreGlWrapper';
|
|
5
5
|
|
|
6
|
-
import { MapOptions as MapOptionsType } from
|
|
7
|
-
import
|
|
6
|
+
import { MapOptions as MapOptionsType, Map } from 'maplibre-gl';
|
|
7
|
+
import 'maplibre-gl/dist/maplibre-gl.css';
|
|
8
8
|
|
|
9
9
|
type MapLibreMapProps = {
|
|
10
10
|
/**
|
|
@@ -31,16 +31,18 @@ const defaultProps: MapLibreMapProps = {
|
|
|
31
31
|
container: '',
|
|
32
32
|
style: {
|
|
33
33
|
version: 8,
|
|
34
|
-
name:
|
|
34
|
+
name: 'blank',
|
|
35
35
|
center: [0, 0],
|
|
36
36
|
zoom: 0,
|
|
37
37
|
sources: {},
|
|
38
|
+
sprite: 'https://wms.wheregroup.com/tileserver/sprites/osm-bright',
|
|
39
|
+
glyphs: 'https://wms.wheregroup.com/tileserver/fonts/{fontstack}/{range}.pbf',
|
|
38
40
|
layers: [
|
|
39
41
|
{
|
|
40
|
-
id:
|
|
41
|
-
type:
|
|
42
|
+
id: '_background',
|
|
43
|
+
type: 'background',
|
|
42
44
|
paint: {
|
|
43
|
-
|
|
45
|
+
'background-color': 'rgba(0,0,0,0)',
|
|
44
46
|
},
|
|
45
47
|
},
|
|
46
48
|
],
|
|
@@ -59,22 +61,22 @@ const defaultProps: MapLibreMapProps = {
|
|
|
59
61
|
* @category Map components
|
|
60
62
|
*/
|
|
61
63
|
const MapLibreMap: FC<MapLibreMapProps> = (props: MapLibreMapProps) => {
|
|
62
|
-
const map
|
|
64
|
+
const map = useRef<MapLibreGlWrapper>();
|
|
63
65
|
const mapContainer = useRef<HTMLDivElement>();
|
|
64
66
|
|
|
65
|
-
const mapContext
|
|
67
|
+
const mapContext = useContext<MapContextType>(MapContext);
|
|
66
68
|
|
|
67
69
|
const mapIdRef = useRef(props.mapId);
|
|
68
70
|
const initializedRef = useRef(false);
|
|
69
71
|
const currentStyle = useRef(props.options?.style);
|
|
70
72
|
|
|
71
73
|
useEffect(() => {
|
|
72
|
-
|
|
74
|
+
const mapId = mapIdRef.current;
|
|
73
75
|
|
|
74
76
|
return () => {
|
|
75
77
|
mapContext.removeMap(mapId);
|
|
76
|
-
map.current?.remove?.();
|
|
77
|
-
map.current =
|
|
78
|
+
map.current?.map?.remove?.();
|
|
79
|
+
map.current = undefined;
|
|
78
80
|
};
|
|
79
81
|
}, []);
|
|
80
82
|
|
|
@@ -86,11 +88,12 @@ const MapLibreMap: FC<MapLibreMapProps> = (props: MapLibreMapProps) => {
|
|
|
86
88
|
map.current = new MapLibreGlWrapper({
|
|
87
89
|
mapOptions: {
|
|
88
90
|
style: '',
|
|
89
|
-
container: mapContainer.current,
|
|
90
91
|
...props.options,
|
|
92
|
+
...(props?.options?.style ? {} : { style: defaultProps?.options?.style }),
|
|
93
|
+
container: mapContainer.current,
|
|
91
94
|
},
|
|
92
|
-
onReady: (map:
|
|
93
|
-
map.once(
|
|
95
|
+
onReady: (map: Map, wrapper: MapLibreGlWrapper) => {
|
|
96
|
+
map.once('load', () => {
|
|
94
97
|
if (props.mapId) {
|
|
95
98
|
mapContext.registerMap(props.mapId, wrapper);
|
|
96
99
|
} else {
|
|
@@ -104,14 +107,19 @@ const MapLibreMap: FC<MapLibreMapProps> = (props: MapLibreMapProps) => {
|
|
|
104
107
|
|
|
105
108
|
useEffect(() => {
|
|
106
109
|
if (map.current?.map && props?.options?.style && currentStyle.current !== props.options.style) {
|
|
107
|
-
console.log(
|
|
110
|
+
console.log('set style');
|
|
108
111
|
currentStyle.current = props.options.style;
|
|
109
112
|
map.current.map.setStyle(props.options.style);
|
|
110
113
|
}
|
|
111
|
-
|
|
112
|
-
}, [props.options.style])
|
|
114
|
+
}, [props?.options?.style]);
|
|
113
115
|
|
|
114
|
-
return
|
|
116
|
+
return (
|
|
117
|
+
<div
|
|
118
|
+
ref={mapContainer as RefObject<HTMLDivElement>}
|
|
119
|
+
className="mapContainer"
|
|
120
|
+
style={props.style}
|
|
121
|
+
/>
|
|
122
|
+
);
|
|
115
123
|
};
|
|
116
124
|
|
|
117
125
|
MapLibreMap.defaultProps = defaultProps;
|
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
CustomLayerInterface,
|
|
10
10
|
SourceSpecification,
|
|
11
11
|
ControlPosition,
|
|
12
|
-
|
|
12
|
+
StyleImageMetadata,
|
|
13
|
+
} from 'maplibre-gl';
|
|
13
14
|
import { Map as MapType, Style } from 'maplibre-gl';
|
|
14
15
|
|
|
15
16
|
type WrapperEventArgArray = [string, (arg0: unknown) => void];
|
|
@@ -39,6 +40,34 @@ type ViewportState = {
|
|
|
39
40
|
* @class
|
|
40
41
|
*/
|
|
41
42
|
|
|
43
|
+
interface MapLibreGlWrapper extends MapType {
|
|
44
|
+
addImage: (
|
|
45
|
+
id: string,
|
|
46
|
+
image:
|
|
47
|
+
| HTMLImageElement
|
|
48
|
+
| ImageBitmap
|
|
49
|
+
| ImageData
|
|
50
|
+
| {
|
|
51
|
+
width: number;
|
|
52
|
+
height: number;
|
|
53
|
+
data: Uint8Array | Uint8ClampedArray;
|
|
54
|
+
}
|
|
55
|
+
| StyleImageInterface,
|
|
56
|
+
key?: Partial<StyleImageMetadata> | string | undefined,
|
|
57
|
+
componentId?: string | undefined
|
|
58
|
+
) => this;
|
|
59
|
+
addLayer: (
|
|
60
|
+
layer:
|
|
61
|
+
| (LayerSpecification & {
|
|
62
|
+
source?: string | SourceSpecification | undefined;
|
|
63
|
+
})
|
|
64
|
+
| (CustomLayerInterface & {
|
|
65
|
+
source?: string | SourceSpecification | undefined;
|
|
66
|
+
}),
|
|
67
|
+
beforeId?: string | undefined,
|
|
68
|
+
componentId?: string | undefined
|
|
69
|
+
) => this;
|
|
70
|
+
}
|
|
42
71
|
class MapLibreGlWrapper {
|
|
43
72
|
registeredElements: {
|
|
44
73
|
[key: string]: {
|
|
@@ -90,42 +119,21 @@ class MapLibreGlWrapper {
|
|
|
90
119
|
initRegisteredElements: (componentId: string, force?: boolean | undefined) => void;
|
|
91
120
|
addNativeMaplibreFunctionsAndProps: () => void;
|
|
92
121
|
map: MapType;
|
|
93
|
-
style:
|
|
122
|
+
style: Style;
|
|
94
123
|
|
|
95
124
|
styleJson: object;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
})
|
|
101
|
-
| (CustomLayerInterface & {
|
|
102
|
-
source?: string | SourceSpecification | undefined;
|
|
103
|
-
}),
|
|
104
|
-
beforeId?: string | undefined,
|
|
105
|
-
componentId?: string | undefined
|
|
106
|
-
) => Map | undefined;
|
|
107
|
-
addSource: (id: string, source: SourceSpecification,componentId?: string | undefined) => Map | undefined;
|
|
108
|
-
addControl: (control: IControl | unknown, position?: ControlPosition | undefined,componentId?: string | undefined) => Map | undefined;
|
|
109
|
-
addImage: (
|
|
110
|
-
id: string,
|
|
111
|
-
image:
|
|
112
|
-
| HTMLImageElement
|
|
113
|
-
| ImageBitmap
|
|
114
|
-
| ImageData
|
|
115
|
-
| {
|
|
116
|
-
width: number;
|
|
117
|
-
height: number;
|
|
118
|
-
data: Uint8Array | Uint8ClampedArray;
|
|
119
|
-
}
|
|
120
|
-
| StyleImageInterface,
|
|
125
|
+
addSource: (id: string, source: SourceSpecification, componentId?: string | undefined) => this;
|
|
126
|
+
addControl: (
|
|
127
|
+
control: IControl | unknown,
|
|
128
|
+
position?: ControlPosition | undefined,
|
|
121
129
|
componentId?: string | undefined
|
|
122
|
-
) =>
|
|
130
|
+
) => this;
|
|
123
131
|
on: (
|
|
124
132
|
type: keyof MapLayerEventType | keyof MapEventType | string,
|
|
125
133
|
layerId: string | ((ev: unknown) => void),
|
|
126
134
|
handler?: ((ev: MapEventType & unknown) => Map | void) | string,
|
|
127
135
|
componentId?: string | undefined
|
|
128
|
-
) =>
|
|
136
|
+
) => this;
|
|
129
137
|
cleanup: (componentId: string) => void;
|
|
130
138
|
|
|
131
139
|
constructor(props: {
|
|
@@ -367,7 +375,7 @@ class MapLibreGlWrapper {
|
|
|
367
375
|
*/
|
|
368
376
|
this.addLayer = (layer, beforeId, componentId) => {
|
|
369
377
|
if (!self.map.style) {
|
|
370
|
-
return;
|
|
378
|
+
return this;
|
|
371
379
|
}
|
|
372
380
|
if (componentId && typeof componentId === 'string' && typeof layer.id !== 'undefined') {
|
|
373
381
|
self.initRegisteredElements(componentId);
|
|
@@ -379,7 +387,7 @@ class MapLibreGlWrapper {
|
|
|
379
387
|
}
|
|
380
388
|
|
|
381
389
|
self.map.addLayer(layer, beforeId);
|
|
382
|
-
return
|
|
390
|
+
return this;
|
|
383
391
|
};
|
|
384
392
|
|
|
385
393
|
/**
|
|
@@ -393,7 +401,7 @@ class MapLibreGlWrapper {
|
|
|
393
401
|
*/
|
|
394
402
|
this.addSource = (sourceId, source, componentId) => {
|
|
395
403
|
if (!self.map.style) {
|
|
396
|
-
return;
|
|
404
|
+
return this;
|
|
397
405
|
}
|
|
398
406
|
if (componentId && typeof componentId === 'string' && typeof sourceId !== 'undefined') {
|
|
399
407
|
self.initRegisteredElements(componentId);
|
|
@@ -401,7 +409,7 @@ class MapLibreGlWrapper {
|
|
|
401
409
|
}
|
|
402
410
|
|
|
403
411
|
self.map.addSource(sourceId, source);
|
|
404
|
-
return
|
|
412
|
+
return this;
|
|
405
413
|
};
|
|
406
414
|
|
|
407
415
|
/**
|
|
@@ -411,18 +419,21 @@ class MapLibreGlWrapper {
|
|
|
411
419
|
* @param {*} image
|
|
412
420
|
* @param {*} ref
|
|
413
421
|
* @param {string} componentId
|
|
414
|
-
* @returns {undefined}
|
|
415
422
|
*/
|
|
416
|
-
this.addImage = (id, image, componentId) => {
|
|
423
|
+
this.addImage = (id, image, meta, componentId) => {
|
|
417
424
|
if (!self.map.style) {
|
|
418
|
-
return;
|
|
425
|
+
return this;
|
|
426
|
+
}
|
|
427
|
+
if (typeof meta === 'string' && typeof componentId === 'undefined') {
|
|
428
|
+
return self.addImage(id, image, undefined, meta);
|
|
419
429
|
}
|
|
420
430
|
if (componentId && typeof componentId === 'string' && typeof id !== 'undefined') {
|
|
421
431
|
self.initRegisteredElements(componentId);
|
|
422
432
|
self.registeredElements[componentId].images.push(id);
|
|
423
433
|
}
|
|
424
434
|
|
|
425
|
-
self.map.addImage(id, image);
|
|
435
|
+
self.map.addImage(id, image, meta as Partial<StyleImageMetadata> | undefined);
|
|
436
|
+
return this;
|
|
426
437
|
};
|
|
427
438
|
|
|
428
439
|
/**
|
|
@@ -456,7 +467,7 @@ class MapLibreGlWrapper {
|
|
|
456
467
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
457
468
|
// @ts-ignore
|
|
458
469
|
self.map.on(..._arguments);
|
|
459
|
-
return
|
|
470
|
+
return this;
|
|
460
471
|
};
|
|
461
472
|
|
|
462
473
|
/**
|
|
@@ -473,7 +484,7 @@ class MapLibreGlWrapper {
|
|
|
473
484
|
}
|
|
474
485
|
|
|
475
486
|
self.map.addControl(control as IControl, position);
|
|
476
|
-
return
|
|
487
|
+
return this;
|
|
477
488
|
};
|
|
478
489
|
|
|
479
490
|
/**
|
|
@@ -675,7 +686,6 @@ class MapLibreGlWrapper {
|
|
|
675
686
|
initializeMapLibre();
|
|
676
687
|
}
|
|
677
688
|
}
|
|
678
|
-
|
|
679
689
|
export default MapLibreGlWrapper;
|
|
680
690
|
|
|
681
691
|
export type { LayerState, ViewportState };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useCallback } from "react";
|
|
2
2
|
import useMap from "../../hooks/useMap";
|
|
3
|
-
import { Button, SxProps, Theme } from
|
|
4
|
-
import
|
|
3
|
+
import { Button, SxProps, Theme } from '@mui/material';
|
|
4
|
+
import GpsFixedIcon from '@mui/icons-material/GpsFixed';
|
|
5
5
|
|
|
6
6
|
export interface MlCenterPositionProps {
|
|
7
7
|
/**
|
|
@@ -36,51 +36,44 @@ const MlCenterPosition = (props: MlCenterPositionProps) => {
|
|
|
36
36
|
mapId: props.mapId,
|
|
37
37
|
waitForLayer: props.insertBeforeLayer,
|
|
38
38
|
});
|
|
39
|
+
|
|
39
40
|
const [locationAccessDenied, setLocationAccessDenied] = useState(false);
|
|
40
41
|
|
|
41
42
|
const centerCurrentLocation = () => {
|
|
42
43
|
navigator.geolocation.getCurrentPosition(getLocationSuccess, getLocationError);
|
|
43
44
|
};
|
|
44
45
|
|
|
45
|
-
const getLocationSuccess = useCallback(
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
const getLocationSuccess = useCallback(
|
|
47
|
+
(location: GeolocationPosition) => {
|
|
48
|
+
mapHook.map?.map.setCenter?.([location.coords.longitude, location.coords.latitude]);
|
|
49
|
+
},
|
|
50
|
+
[mapHook.map]
|
|
51
|
+
);
|
|
48
52
|
|
|
49
53
|
const getLocationError = () => {
|
|
50
|
-
console.log(
|
|
54
|
+
console.log('Access of user location denied');
|
|
51
55
|
setLocationAccessDenied(true);
|
|
52
56
|
};
|
|
53
|
-
return
|
|
54
|
-
|
|
57
|
+
return (
|
|
58
|
+
<>
|
|
59
|
+
<Button
|
|
60
|
+
variant="navtools"
|
|
55
61
|
sx={{
|
|
56
62
|
zIndex: 1002,
|
|
57
63
|
color: !locationAccessDenied ? props.onColor : props.offColor,
|
|
58
|
-
...props.style,
|
|
59
64
|
}}
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
onClick={centerCurrentLocation}
|
|
66
|
+
disabled={locationAccessDenied}
|
|
67
|
+
>
|
|
68
|
+
<GpsFixedIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />
|
|
62
69
|
</Button>
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
</>
|
|
71
|
+
);
|
|
65
72
|
};
|
|
66
73
|
|
|
67
74
|
MlCenterPosition.defaultProps = {
|
|
68
75
|
mapId: undefined,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
minHeight: "30px",
|
|
72
|
-
width: "30px",
|
|
73
|
-
height: "30px",
|
|
74
|
-
backgroundColor: "#414141",
|
|
75
|
-
borderRadius: "23%",
|
|
76
|
-
margin: 0.15,
|
|
77
|
-
fontSize: "1.3em",
|
|
78
|
-
":hover": {
|
|
79
|
-
backgroundColor: "#515151",
|
|
80
|
-
color: "#ececec",
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
onColor: "#ececec",
|
|
84
|
-
offColor: "#666",
|
|
76
|
+
onColor: '#ececec',
|
|
77
|
+
offColor: '#666',
|
|
85
78
|
};
|
|
86
79
|
export default MlCenterPosition;
|
|
@@ -188,7 +188,7 @@ export default function PdfForm(props: PdfFormProps) {
|
|
|
188
188
|
<Select
|
|
189
189
|
labelId="quality-select-label"
|
|
190
190
|
id="quality-select"
|
|
191
|
-
label="
|
|
191
|
+
label="Quality"
|
|
192
192
|
value={pdfContext.quality}
|
|
193
193
|
onChange={(event) => {
|
|
194
194
|
pdfContext.setQuality?.(event.target.value);
|
|
@@ -202,11 +202,11 @@ export default function PdfForm(props: PdfFormProps) {
|
|
|
202
202
|
</Select>
|
|
203
203
|
</FormControl>
|
|
204
204
|
<FormControl fullWidth sx={formControlStyles}>
|
|
205
|
-
<InputLabel id="
|
|
205
|
+
<InputLabel id="scale-select-label">Scale</InputLabel>
|
|
206
206
|
<Select
|
|
207
|
-
labelId="
|
|
208
|
-
id="
|
|
209
|
-
label="
|
|
207
|
+
labelId="scale-select-label"
|
|
208
|
+
id="scale-select"
|
|
209
|
+
label="Scale"
|
|
210
210
|
value={pdfContext?.options?.fixedScale}
|
|
211
211
|
onChange={(event) => {
|
|
212
212
|
pdfContext.setOptions?.((val) => ({
|
|
@@ -229,7 +229,7 @@ export default function PdfForm(props: PdfFormProps) {
|
|
|
229
229
|
onClick={createPdfHandler}
|
|
230
230
|
disabled={loading}
|
|
231
231
|
>
|
|
232
|
-
PDF
|
|
232
|
+
create PDF
|
|
233
233
|
</Button>
|
|
234
234
|
{loading && (
|
|
235
235
|
<CircularProgress
|
|
@@ -1,22 +1,40 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import MlFollowGps from
|
|
3
|
+
import MlFollowGps from './MlFollowGps';
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import noNavToolsDecorator from '../../decorators/NoNavToolsDecorator';
|
|
6
|
+
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
6
7
|
|
|
7
8
|
const storyoptions = {
|
|
8
|
-
title:
|
|
9
|
+
title: 'MapComponents/MlFollowGps',
|
|
9
10
|
component: MlFollowGps,
|
|
10
|
-
argTypes: {
|
|
11
|
-
|
|
12
|
-
decorators: mapContextDecorator,
|
|
11
|
+
argTypes: {},
|
|
12
|
+
decorators: noNavToolsDecorator,
|
|
13
13
|
};
|
|
14
14
|
export default storyoptions;
|
|
15
15
|
|
|
16
|
-
const Template = (props) =>
|
|
17
|
-
|
|
16
|
+
const Template = (props) => {
|
|
17
|
+
const mediaIsMobile = useMediaQuery('(max-width:900px)');
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
<div
|
|
21
|
+
style={{
|
|
22
|
+
position: 'fixed',
|
|
23
|
+
right: '11px',
|
|
24
|
+
bottom: mediaIsMobile ? '130px' : '45px',
|
|
25
|
+
display: 'flex',
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
gap: '5px',
|
|
28
|
+
zIndex: 1000,
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
31
|
+
<MlFollowGps {...props} />
|
|
32
|
+
</div>
|
|
33
|
+
</>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
18
36
|
export const ExampleConfig = Template.bind({});
|
|
19
37
|
ExampleConfig.parameters = {};
|
|
20
38
|
ExampleConfig.args = {
|
|
21
|
-
followUserPosition: false
|
|
39
|
+
followUserPosition: false,
|
|
22
40
|
};
|