@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,11 +0,0 @@
|
|
|
1
|
-
import { createExportOptions } from './lib';
|
|
2
|
-
interface exportMapProps {
|
|
3
|
-
/**
|
|
4
|
-
* Id of the target MapLibre instance in mapContext
|
|
5
|
-
*/
|
|
6
|
-
mapId?: string;
|
|
7
|
-
}
|
|
8
|
-
export default function exportMap(props: exportMapProps): {
|
|
9
|
-
createExport: ((options: Omit<createExportOptions, 'map'> & Partial<Pick<createExportOptions, 'map'>>) => Promise<import("./lib").createExportResolverParams>) | undefined;
|
|
10
|
-
};
|
|
11
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Map } from 'maplibre-gl';
|
|
2
|
-
import jsPDF from 'jspdf';
|
|
3
|
-
import MapLibreGlWrapper from '../../components/MapLibreMap/lib/MapLibreGlWrapper';
|
|
4
|
-
import { BBox } from '@turf/turf';
|
|
5
|
-
interface createExportOptions {
|
|
6
|
-
map: MapLibreGlWrapper;
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
bbox: BBox;
|
|
10
|
-
bboxUnrotated: BBox;
|
|
11
|
-
bearing: number;
|
|
12
|
-
format: string;
|
|
13
|
-
orientation: string;
|
|
14
|
-
}
|
|
15
|
-
export type { createExportOptions };
|
|
16
|
-
declare const createExport: (options: createExportOptions) => Promise<createExportResolverParams>;
|
|
17
|
-
interface createExportResolverParams extends createExportOptions {
|
|
18
|
-
createPdf: (_options?: createJsPdfOptions) => Promise<createPdfResolverParams>;
|
|
19
|
-
renderMap: Map;
|
|
20
|
-
hiddenContainer: HTMLDivElement;
|
|
21
|
-
}
|
|
22
|
-
export type { createExportResolverParams };
|
|
23
|
-
interface createJsPdfOptions extends createExportOptions {
|
|
24
|
-
renderMap: Map;
|
|
25
|
-
hiddenContainer: HTMLDivElement;
|
|
26
|
-
}
|
|
27
|
-
export type { createJsPdfOptions };
|
|
28
|
-
interface createPdfResolverParams extends createJsPdfOptions {
|
|
29
|
-
pdf: jsPDF;
|
|
30
|
-
downloadPdf: (_options?: downloadPdfOptions) => Promise<downloadPdfOptions>;
|
|
31
|
-
}
|
|
32
|
-
export type { createPdfResolverParams };
|
|
33
|
-
interface downloadPdfOptions extends createJsPdfOptions {
|
|
34
|
-
pdf: jsPDF;
|
|
35
|
-
}
|
|
36
|
-
export { createExport };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function Legend(props: any): JSX.Element;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
|
|
3
|
-
import MlShareMapState from "./MlShareMapState";
|
|
4
|
-
import mapContextDecorator from "../../decorators/MapContextDecorator";
|
|
5
|
-
import useMapState from "../../hooks/useMapState";
|
|
6
|
-
import useMap from "../../hooks/useMap";
|
|
7
|
-
import Sidebar from "../../ui_components/Sidebar";
|
|
8
|
-
import ListItem from "@mui/material/ListItem";
|
|
9
|
-
import IconButton from "@mui/material/IconButton";
|
|
10
|
-
import VisibilityIcon from "@mui/icons-material/Visibility";
|
|
11
|
-
import VisibilityOffIcon from "@mui/icons-material/VisibilityOff";
|
|
12
|
-
import ListItemText from "@mui/material/ListItemText";
|
|
13
|
-
import sample_geojson_1 from "../MlGeoJsonLayer/assets/sample_1.json";
|
|
14
|
-
import sample_geojson_2 from "../MlGeoJsonLayer/assets/sample_2.json";
|
|
15
|
-
import List from "@mui/material/List";
|
|
16
|
-
import MlGeoJsonLayer from "../MlGeoJsonLayer/MlGeoJsonLayer";
|
|
17
|
-
import { ToggleButton } from "@mui/material";
|
|
18
|
-
import CheckCircleOutlineIcon from "@mui/icons-material/CheckCircleOutline";
|
|
19
|
-
import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline";
|
|
20
|
-
|
|
21
|
-
const storyoptions = {
|
|
22
|
-
title: "MapComponents/MlShareMapState",
|
|
23
|
-
component: MlShareMapState,
|
|
24
|
-
argTypes: {},
|
|
25
|
-
decorators: mapContextDecorator,
|
|
26
|
-
};
|
|
27
|
-
export default storyoptions;
|
|
28
|
-
|
|
29
|
-
const Template = () => {
|
|
30
|
-
const geoJsonArray = [sample_geojson_1, sample_geojson_2];
|
|
31
|
-
const [watchState, setWatchState] = useState(true);
|
|
32
|
-
const mapHook = useMap({ mapId: "map_1" });
|
|
33
|
-
const mapState = useMapState({
|
|
34
|
-
mapId: "map_1",
|
|
35
|
-
watch: {
|
|
36
|
-
viewport: false,
|
|
37
|
-
layers: true,
|
|
38
|
-
sources: false,
|
|
39
|
-
},
|
|
40
|
-
filter: {
|
|
41
|
-
includeBaseLayers: false,
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<>
|
|
47
|
-
<MlShareMapState active={watchState} />
|
|
48
|
-
{geoJsonArray.map((el, i) => (
|
|
49
|
-
<MlGeoJsonLayer layerId={"GeoJson_" + i} type="line" geojson={el} key={"GeoJson_" + i} />
|
|
50
|
-
))}
|
|
51
|
-
<Sidebar sx={{ wordBreak: "break-word" }}>
|
|
52
|
-
<ToggleButton
|
|
53
|
-
size="small"
|
|
54
|
-
selected={watchState}
|
|
55
|
-
value={watchState}
|
|
56
|
-
onChange={() => {
|
|
57
|
-
setWatchState(!watchState);
|
|
58
|
-
}}
|
|
59
|
-
>
|
|
60
|
-
{watchState ? <CheckCircleOutlineIcon /> : <ErrorOutlineIcon />}
|
|
61
|
-
|
|
62
|
-
{watchState ? "active" : "inactive"}
|
|
63
|
-
</ToggleButton>
|
|
64
|
-
<List dense key="layers">
|
|
65
|
-
{mapState.layers?.map((el) => (
|
|
66
|
-
<ListItem
|
|
67
|
-
key={el.id}
|
|
68
|
-
secondaryAction={
|
|
69
|
-
<IconButton
|
|
70
|
-
edge="end"
|
|
71
|
-
aria-label="toggle visibility"
|
|
72
|
-
onClick={() => {
|
|
73
|
-
let currentVisibility = mapHook.map
|
|
74
|
-
?.getLayer?.(el.id)
|
|
75
|
-
?.getLayoutProperty("visibility");
|
|
76
|
-
mapHook.map
|
|
77
|
-
?.getLayer?.(el.id)
|
|
78
|
-
?.setLayoutProperty(
|
|
79
|
-
"visibility",
|
|
80
|
-
currentVisibility === "none" ? "visible" : "none"
|
|
81
|
-
);
|
|
82
|
-
mapHook.map.map.fire("zoom");
|
|
83
|
-
}}
|
|
84
|
-
>
|
|
85
|
-
{el.visible ? <VisibilityIcon /> : <VisibilityOffIcon />}
|
|
86
|
-
</IconButton>
|
|
87
|
-
}
|
|
88
|
-
>
|
|
89
|
-
<ListItemText primary={el.id} secondary={""} />
|
|
90
|
-
</ListItem>
|
|
91
|
-
))}
|
|
92
|
-
</List>
|
|
93
|
-
</Sidebar>
|
|
94
|
-
</>
|
|
95
|
-
);
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
export const ExampleConfig = Template.bind({});
|
|
99
|
-
ExampleConfig.parameters = {};
|
|
100
|
-
ExampleConfig.args = {};
|
package/src/custom.d.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
declare module "*.svg" {
|
|
3
|
-
const content: any;
|
|
4
|
-
export default content;
|
|
5
|
-
export { content as ReactComponent };
|
|
6
|
-
}
|
|
7
|
-
declare module "*.js" {
|
|
8
|
-
const content: any;
|
|
9
|
-
export default content;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
//declare module '../index';
|
|
13
|
-
type MapContextType= {
|
|
14
|
-
mapIds: [string?];
|
|
15
|
-
mapExists: Function;
|
|
16
|
-
maps: [];
|
|
17
|
-
map: any,
|
|
18
|
-
getMap: Function;
|
|
19
|
-
setMap: Function;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
interface GeoJSON {
|
|
23
|
-
type: string,
|
|
24
|
-
features?: any
|
|
25
|
-
geometry?: any
|
|
26
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ThemeProvider as MUIThemeProvider, createTheme } from '@mui/material/styles';
|
|
3
|
-
|
|
4
|
-
const theme = createTheme({
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
export default function ThemeWrapper(props: { children: unknown }) {
|
|
8
|
-
return <MUIThemeProvider theme={theme}>{props?.children}</MUIThemeProvider>;
|
|
9
|
-
}
|