@mapcomponents/react-maplibre 0.1.62 → 0.1.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +21 -2
- package/.editorconfig +1 -1
- package/.eslintrc.js +11 -1
- package/.github/workflows/check-catalogue-metadata-schema.yml +19 -0
- package/.storybook/main.js +0 -1
- package/.storybook/preview.js +0 -2
- package/CHANGELOG.md +43 -0
- package/coverage/clover.xml +864 -1037
- package/coverage/coverage-final.json +32 -21
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +170 -95
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +24 -24
- package/coverage/lcov-report/src/components/MapLibreMap/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCenterPosition/MlCenterPosition.tsx.html +5 -5
- package/coverage/lcov-report/src/components/MlCenterPosition/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +2 -2
- package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.cy.tsx.html +148 -0
- package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfForm/index.html +22 -7
- package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +72 -42
- package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +15 -15
- 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 +1 -1
- package/coverage/lcov-report/src/components/MlFollowGps/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +86 -35
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/{MlSpatialElevationProfile/MlSpatialElevationProfile.js.html → MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.js.html} +215 -320
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.js.html +649 -0
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.tsx.html +112 -0
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.tsx.html +115 -0
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/index.html +161 -0
- 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 +394 -0
- package/coverage/lcov-report/src/components/MlGpxViewer/index.html +116 -0
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +63 -285
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +21 -21
- 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 +58 -76
- package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +58 -61
- package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +11 -11
- package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +30 -21
- 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 +1 -1
- package/coverage/lcov-report/src/components/MlNavigationTools/index.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
- package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +1 -1
- package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/ColorPicker.tsx.html +214 -0
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerList.tsx.html +121 -0
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerListItem.tsx.html +412 -0
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx.html +463 -0
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/index.html +161 -0
- package/coverage/lcov-report/src/components/{MlGPXViewer/MlGPXViewer.tsx.html → MlSketchTool/MlSketchTool.tsx.html} +271 -589
- package/coverage/lcov-report/src/components/{MlGPXViewer → MlSketchTool}/index.html +22 -37
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.tsx.html +514 -0
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +21 -21
- package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +20 -206
- 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 +10 -7
- package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +5 -5
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.tsx.html +111 -57
- package/coverage/lcov-report/src/components/MlWmsLayer/index.html +19 -19
- package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +201 -144
- package/coverage/lcov-report/src/components/MlWmsLoader/index.html +9 -9
- package/coverage/lcov-report/src/contexts/MapContext.tsx.html +23 -23
- 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 +50 -50
- 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 +1 -1
- package/coverage/lcov-report/src/hooks/useGpx/index.html +116 -0
- package/coverage/lcov-report/src/hooks/useGpx/useGpx.tsx.html +295 -0
- package/coverage/lcov-report/src/hooks/useLayer.ts.html +132 -66
- package/coverage/lcov-report/src/hooks/useLayerEvent.js.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayerHoverPopup/index.html +116 -0
- package/coverage/lcov-report/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx.html +331 -0
- package/coverage/lcov-report/src/hooks/useMap.ts.html +47 -47
- package/coverage/lcov-report/src/hooks/useMapState.ts.html +54 -54
- package/coverage/lcov-report/src/hooks/useSource.ts.html +57 -57
- package/coverage/lcov-report/src/hooks/{useWms.js.html → useWms.ts.html} +54 -15
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.ts.html +6 -6
- package/coverage/lcov.info +1724 -1974
- package/cypress/support/commands.ts +37 -0
- package/cypress/support/component-index.html +12 -0
- package/cypress/support/component.ts +46 -0
- package/cypress.config.ts +101 -0
- package/dist/components/MapLibreMap/MapLibreMap.d.ts +1 -1
- package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +53 -27
- package/dist/components/MlCenterPosition/MlCenterPosition.d.ts +3 -2
- package/dist/components/MlCenterPosition/MlCenterPosition.stories.d.ts +35 -16
- package/dist/components/MlComponentTemplate/MlComponentTemplate.d.ts +1 -1
- package/dist/components/MlComponentTemplate/MlComponentTemplate.stories.d.ts +12 -9
- package/dist/components/MlCreatePdfButton/MlCreatePdfButton.d.ts +1 -1
- package/dist/components/MlCreatePdfButton/MlCreatePdfButton.stories.d.ts +12 -9
- package/dist/components/MlCreatePdfForm/MlCreatePdfForm.cy.d.ts +1 -0
- package/dist/components/MlCreatePdfForm/lib/PdfPreview.d.ts +1 -1
- package/dist/components/MlFeatureEditor/MlFeatureEditor.d.ts +10 -4
- package/dist/components/MlFeatureEditor/lib/double_click_zoom.d.ts +0 -2
- package/dist/components/MlFeatureEditor/lib/theme.d.ts +1 -1
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +23 -12
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +12 -11
- package/dist/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.d.ts +2 -0
- package/dist/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.d.ts +2 -0
- package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.d.ts +3 -0
- package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.d.ts +3 -0
- package/dist/components/MlGpxViewer/MlGpxViewer.d.ts +30 -0
- package/dist/components/MlGpxViewer/MlGpxViewer.stories.d.ts +17 -0
- package/dist/components/MlGpxViewer/MlGpxViewer.test.d.ts +1 -0
- package/dist/components/MlGpxViewer/util/GeoJsonContext.d.ts +10 -0
- package/dist/components/MlGpxViewer/util/GeoJsonProvider.d.ts +4 -0
- package/dist/components/MlGpxViewer/util/MetadataDrawer.d.ts +7 -0
- package/dist/components/MlGpxViewer/util/MlGpxDemoLoader.d.ts +10 -0
- package/dist/components/MlGpxViewer/util/MlGpxViewerInstructions.d.ts +3 -0
- package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.d.ts +11 -2
- package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.d.ts +7 -9
- package/dist/components/MlLayerMagnify/MlLayerMagnify.d.ts +8 -2
- package/dist/components/MlLayerMagnify/MlLayerMagnify.stories.d.ts +13 -9
- package/dist/components/MlLayerSwipe/MlLayerSwipe.d.ts +13 -3
- package/dist/components/MlLayerSwipe/MlLayerSwipe.stories.d.ts +12 -10
- package/dist/components/MlSketchTool/LayerList/ColorPicker.d.ts +9 -0
- package/dist/components/MlSketchTool/LayerList/LayerList.d.ts +5 -0
- package/dist/components/MlSketchTool/LayerList/LayerListItem.d.ts +11 -0
- package/dist/components/MlSketchTool/LayerList/LayerPropertyForm.d.ts +9 -0
- package/dist/components/MlSketchTool/MlSketchTool.d.ts +29 -0
- package/dist/components/MlSketchTool/MlSketchTool.stories.d.ts +10 -0
- package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.d.ts +33 -14
- package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.d.ts +18 -15
- package/dist/components/MlSpatialElevationProfile/util/getElevationData.d.ts +14 -0
- package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +3 -67
- package/dist/components/MlWmsLayer/MlWmsLayer.d.ts +7 -4
- package/dist/components/MlWmsLoader/MlWmsLoader.d.ts +17 -10
- package/dist/components/MlWmsLoader/MlWmsLoader.stories.d.ts +23 -12
- package/dist/components/MlWmsLoader/utils/MlWmsLoaderInstructions.d.ts +3 -0
- package/dist/components/MlWmsLoader/utils/WMSLinks.d.ts +6 -0
- package/dist/contexts/SimpleDataProvider.d.ts +1 -1
- package/dist/custom.d.d.ts +1 -1
- package/dist/decorators/ThemeWrapper.d.ts +3 -1
- package/dist/hooks/useGpx/lib/gpxConverter.d.ts +11 -0
- package/dist/hooks/useGpx/useGpx.d.ts +26 -0
- package/dist/hooks/useGpx/useGpx.stories.d.ts +10 -0
- package/dist/hooks/useLayer.d.ts +14 -8
- package/dist/hooks/useLayerHoverPopup/useLayerHoverPopup.d.ts +23 -0
- package/dist/hooks/useLayerHoverPopup/useLayerHoverPopup.stories.d.ts +10 -0
- package/dist/hooks/useMap.d.ts +2 -2
- package/dist/hooks/useMap.test.d.ts +1 -0
- package/dist/hooks/useMapState.d.ts +3 -3
- package/dist/hooks/useSource.d.ts +3 -3
- package/dist/hooks/useWms.d.ts +24 -16
- package/dist/index.d.ts +5 -5
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +9327 -14844
- package/dist/index.esm.js.map +1 -1
- package/dist/setupTests.d.ts +6 -5
- package/dist/ui_components/Dropzone.d.ts +5 -0
- package/dist/ui_components/ImageLoader.d.ts +8 -1
- package/dist/ui_components/LoadingOverlayContext.d.ts +11 -11
- package/dist/ui_components/Sidebar.d.ts +10 -1
- package/dist/ui_components/Tooltip.d.ts +1 -1
- package/dist/ui_components/TopToolbar.d.ts +7 -1
- package/dist/ui_components/UploadButton.d.ts +6 -0
- package/dist/util/BubbleForInstructions.d.ts +2 -0
- package/dist/util/Instructions.d.ts +13 -0
- package/package.json +195 -185
- package/public/assets/sample1.gpx +3003 -0
- package/public/assets/sample2.gpx +1264 -0
- package/public/assets/sample3.gpx +912 -0
- package/{src/components/MlImageMarkerLayer → public}/assets/wg-marker.png +0 -0
- package/public/index.html +0 -4
- package/public/thumbnails/MlSketchTool.png +0 -0
- package/public/thumbnails/useCameraFollowPath.png +0 -0
- package/scripts/build-catalogue-meta.js +35 -11
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +230 -188
- package/src/components/MlCenterPosition/MlCenterPosition.meta_.json +1 -2
- package/src/components/MlCenterPosition/MlCenterPosition.stories.tsx +20 -0
- package/src/components/MlCenterPosition/MlCenterPosition.tsx +4 -4
- package/src/components/MlComponentTemplate/MlComponentTemplate.meta_.json +1 -2
- package/src/components/MlComponentTemplate/{MlComponentTemplate.stories.js → MlComponentTemplate.stories.tsx} +2 -2
- package/src/components/MlComponentTemplate/MlComponentTemplate.tsx +1 -1
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.meta_.json +1 -2
- package/src/components/MlCreatePdfButton/{MlCreatePdfButton.stories.js → MlCreatePdfButton.stories.tsx} +1 -1
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx +1 -1
- package/src/components/MlCreatePdfForm/MlCreatePdfForm.cy.tsx +21 -0
- package/src/components/MlCreatePdfForm/MlCreatePdfForm.meta.json +1 -2
- package/src/components/MlCreatePdfForm/MlCreatePdfForm.stories.tsx +1 -3
- package/src/components/MlCreatePdfForm/lib/PdfForm.tsx +25 -2
- package/src/components/MlFeatureEditor/MlFeatureEditor.meta.json +2 -3
- package/src/components/MlFeatureEditor/MlFeatureEditor.tsx +39 -29
- package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.meta.json +1 -2
- package/src/components/MlFollowGps/MlFollowGps.meta.json +1 -2
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.meta.json +1 -2
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.tsx +191 -0
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +47 -30
- package/src/components/MlGeoJsonLayer/assets/earthquake.json +109937 -0
- package/src/components/MlGeoJsonLayer/assets/sample_1.json +138 -24
- package/src/components/MlGeoJsonLayer/assets/sample_2.json +140 -20
- package/src/components/MlGeoJsonLayer/assets/wg_locations.json +65 -0
- package/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.js +189 -0
- package/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.js +188 -0
- package/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.tsx +9 -0
- package/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.tsx +10 -0
- package/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.meta_.json +1 -2
- package/src/components/{MlGPXViewer/MlGPXViewer.doc.de.md → MlGpxViewer/MlGpxViewer.doc.de.md} +0 -0
- package/src/components/{MlGPXViewer/MlGPXViewer.doc.en.md → MlGpxViewer/MlGpxViewer.doc.en.md} +0 -0
- package/src/components/{MlGPXViewer/MlGPXViewer.meta.json → MlGpxViewer/MlGpxViewer.meta.json} +2 -3
- package/src/components/MlGpxViewer/MlGpxViewer.stories.tsx +109 -0
- package/src/components/MlGpxViewer/MlGpxViewer.test.js +53 -0
- package/src/components/MlGpxViewer/MlGpxViewer.tsx +103 -0
- package/src/components/{MlGPXViewer → MlGpxViewer}/util/GeoJsonContext.ts +0 -0
- package/src/components/{MlGPXViewer → MlGpxViewer}/util/GeoJsonProvider.tsx +0 -0
- package/src/components/MlGpxViewer/util/MetadataDrawer.tsx +38 -0
- package/src/components/MlGpxViewer/util/MlGpxDemoLoader.tsx +128 -0
- package/src/components/MlGpxViewer/util/MlGpxViewerInstructions.tsx +68 -0
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.meta_.json +1 -2
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.tsx +41 -0
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.test.js +27 -8
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx +41 -115
- package/src/components/MlLayer/MlLayer.meta_.json +1 -2
- package/src/components/MlLayerMagnify/MlLayerMagnify.meta.json +1 -2
- package/src/components/MlLayerMagnify/MlLayerMagnify.stories.tsx +44 -0
- package/src/components/MlLayerMagnify/{MlLayerMagnify.test.js → MlLayerMagnify.test.tsx} +15 -18
- package/src/components/MlLayerMagnify/MlLayerMagnify.tsx +55 -61
- package/src/components/MlLayerSwipe/MlLayerSwipe.meta.json +1 -2
- package/src/components/MlLayerSwipe/{MlLayerSwipe.stories.js → MlLayerSwipe.stories.tsx} +9 -11
- package/src/components/MlLayerSwipe/MlLayerSwipe.tsx +47 -48
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.meta_.json +1 -2
- package/src/components/MlLayerSwitcher/components/LayerBox.js +22 -19
- package/src/components/MlMarker/MlMarker.meta_.json +1 -2
- package/src/components/MlMeasureTool/MlMeasureTool.meta.json +1 -2
- package/src/components/MlNavigationCompass/MlNavigationCompass.meta.json +1 -2
- package/src/components/MlNavigationTools/MlNavigationTools.meta.json +1 -2
- package/src/components/MlScaleReference/MlScaleReference.meta.json +1 -2
- package/src/components/MlShareMapState/MlShareMapState.meta_.json +1 -2
- package/src/components/MlSketchTool/LayerList/ColorPicker.tsx +43 -0
- package/src/components/MlSketchTool/LayerList/LayerList.tsx +12 -0
- package/src/components/MlSketchTool/LayerList/LayerListItem.tsx +109 -0
- package/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx +126 -0
- package/src/components/MlSketchTool/MlSketchTool.doc.de.md +3 -0
- package/src/components/MlSketchTool/MlSketchTool.meta.json +14 -0
- package/src/components/MlSketchTool/MlSketchTool.stories.js +26 -0
- package/src/components/MlSketchTool/MlSketchTool.tsx +271 -0
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.meta.json +1 -2
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.tsx +121 -0
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.test.js +30 -1
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.tsx +143 -0
- package/src/components/MlSpatialElevationProfile/util/getElevationData.tsx +103 -0
- package/src/components/MlThreeJsLayer/MlThreeJsLayer.meta.json +1 -2
- package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.meta.json +3 -4
- package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.stories.js +2 -3
- package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx +17 -79
- package/src/components/MlUseMapDebugger/MlUseMapDebugger.meta_.json +1 -2
- package/src/components/MlVectorTileLayer/MlVectorTileLayer.meta.json +1 -2
- package/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx +3 -2
- package/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.meta_.json +1 -2
- package/src/components/MlWmsLayer/MlWmsLayer.tsx +59 -41
- package/src/components/MlWmsLoader/MlWmsLoader.meta.json +1 -2
- package/src/components/MlWmsLoader/MlWmsLoader.stories.tsx +89 -0
- package/src/components/MlWmsLoader/MlWmsLoader.tsx +141 -122
- package/src/components/MlWmsLoader/utils/MlWmsLoaderInstructions.tsx +50 -0
- package/src/components/MlWmsLoader/utils/WMSLinks.tsx +128 -0
- package/src/decorators/MapContextDecorator.js +1 -1
- package/src/decorators/MapContextDecoratorHooks.js +1 -1
- package/src/decorators/ThemeWrapper.tsx +9 -0
- package/src/hooks/useCameraFollowPath/useCameraFollowPath.meta.json +1 -2
- package/src/{components/MlGPXViewer → hooks/useGpx/lib}/gpxConverter.js +1 -0
- package/src/hooks/useGpx/useGpx.doc.de.md +3 -0
- package/src/hooks/useGpx/useGpx.meta_.json +15 -0
- package/src/{components/MlCenterPosition/MlCenterPosition.stories.js → hooks/useGpx/useGpx.stories.js} +4 -5
- package/src/hooks/useGpx/useGpx.tsx +70 -0
- package/src/hooks/useLayer.ts +32 -10
- package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.doc.de.md +3 -0
- package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.meta_.json +15 -0
- package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.stories.js +20 -0
- package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx +82 -0
- package/src/hooks/useMap.test.tsx +48 -0
- package/src/hooks/useMap.ts +8 -8
- package/src/hooks/useSource.ts +4 -4
- package/src/hooks/{useWms.js → useWms.ts} +24 -11
- package/src/index.ts +5 -5
- package/src/setupTests.js +18 -15
- package/src/ui_components/Dropzone.tsx +104 -0
- package/src/ui_components/{ImageLoader.js → ImageLoader.tsx} +30 -25
- package/src/ui_components/{LoadingOverlayContext.js → LoadingOverlayContext.tsx} +12 -15
- package/src/ui_components/Sidebar.tsx +82 -0
- package/src/ui_components/Tooltip.tsx +17 -0
- package/src/ui_components/TopToolbar.tsx +26 -0
- package/src/ui_components/UploadButton.tsx +57 -0
- package/src/util/BubbleForInstructions.js +46 -0
- package/src/util/Instructions.tsx +60 -0
- package/tsconfig.json +39 -58
- package/config/getHttpsConfig.js +0 -66
- package/config/modules.js +0 -134
- package/config/pnpTs.js +0 -35
- package/config/webpack.config.js +0 -757
- package/config/webpackDevServer.config.js +0 -130
- package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +0 -1645
- package/scripts/start.js +0 -166
- package/src/components/MlGPXViewer/MlGPXViewer.stories.js +0 -31
- package/src/components/MlGPXViewer/MlGPXViewer.test.js +0 -28
- package/src/components/MlGPXViewer/MlGPXViewer.tsx +0 -377
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.js +0 -66
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.js +0 -45
- package/src/components/MlLayerMagnify/MlLayerMagnify.stories.js +0 -41
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js +0 -224
- package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.js +0 -57
- package/src/components/MlWmsLoader/MlWmsLoader.stories.js +0 -47
- package/src/decorators/ThemeWrapper.jsx +0 -9
- package/src/ui_components/Legend.js +0 -44
- package/src/ui_components/LoadingOverlay.js +0 -41
- package/src/ui_components/Sidebar.js +0 -100
- package/src/ui_components/Tooltip.js +0 -21
- package/src/ui_components/TopToolbar.js +0 -29
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="cypress" />
|
|
2
|
+
// ***********************************************
|
|
3
|
+
// This example commands.ts shows you how to
|
|
4
|
+
// create various custom commands and overwrite
|
|
5
|
+
// existing commands.
|
|
6
|
+
//
|
|
7
|
+
// For more comprehensive examples of custom
|
|
8
|
+
// commands please read more here:
|
|
9
|
+
// https://on.cypress.io/custom-commands
|
|
10
|
+
// ***********************************************
|
|
11
|
+
//
|
|
12
|
+
//
|
|
13
|
+
// -- This is a parent command --
|
|
14
|
+
// Cypress.Commands.add('login', (email, password) => { ... })
|
|
15
|
+
//
|
|
16
|
+
//
|
|
17
|
+
// -- This is a child command --
|
|
18
|
+
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
|
|
19
|
+
//
|
|
20
|
+
//
|
|
21
|
+
// -- This is a dual command --
|
|
22
|
+
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
|
|
23
|
+
//
|
|
24
|
+
//
|
|
25
|
+
// -- This will overwrite an existing command --
|
|
26
|
+
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
|
27
|
+
//
|
|
28
|
+
// declare global {
|
|
29
|
+
// namespace Cypress {
|
|
30
|
+
// interface Chainable {
|
|
31
|
+
// login(email: string, password: string): Chainable<void>
|
|
32
|
+
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
|
|
33
|
+
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
|
|
34
|
+
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
|
|
35
|
+
// }
|
|
36
|
+
// }
|
|
37
|
+
// }
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
7
|
+
<title>Components App</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div data-cy-root></div>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// ***********************************************************
|
|
2
|
+
// This example support/component.ts is processed and
|
|
3
|
+
// loaded automatically before your test files.
|
|
4
|
+
//
|
|
5
|
+
// This is a great place to put global configuration and
|
|
6
|
+
// behavior that modifies Cypress.
|
|
7
|
+
//
|
|
8
|
+
// You can change the location of this file or turn off
|
|
9
|
+
// automatically serving support files with the
|
|
10
|
+
// 'supportFile' configuration option.
|
|
11
|
+
//
|
|
12
|
+
// You can read more here:
|
|
13
|
+
// https://on.cypress.io/configuration
|
|
14
|
+
// ***********************************************************
|
|
15
|
+
import { setGlobalConfig } from "@storybook/testing-react";
|
|
16
|
+
import * as sbPreview from "../../.storybook/preview";
|
|
17
|
+
|
|
18
|
+
setGlobalConfig(sbPreview);
|
|
19
|
+
|
|
20
|
+
// Import commands.js using ES2015 syntax:
|
|
21
|
+
import './commands'
|
|
22
|
+
|
|
23
|
+
// Alternatively you can use CommonJS syntax:
|
|
24
|
+
// require('./commands')
|
|
25
|
+
|
|
26
|
+
import { mount } from 'cypress/react'
|
|
27
|
+
|
|
28
|
+
//import MlCreatePdfForm from "../../src/components/MlCreatePdfForm/MlCreatePdfForm";
|
|
29
|
+
|
|
30
|
+
// Augment the Cypress namespace to include type definitions for
|
|
31
|
+
// your custom command.
|
|
32
|
+
// Alternatively, can be defined in cypress/support/component.d.ts
|
|
33
|
+
// with a <reference path="./component" /> at the top of your spec.
|
|
34
|
+
declare global {
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
36
|
+
namespace Cypress {
|
|
37
|
+
interface Chainable {
|
|
38
|
+
mount: typeof mount
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
Cypress.Commands.add('mount', mount)
|
|
44
|
+
|
|
45
|
+
// Example use:
|
|
46
|
+
// cy.mount(<MyComponent />)
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { defineConfig } from 'cypress';
|
|
2
|
+
|
|
3
|
+
//const isRunningInCI = process.env.CI === 'true';
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
component: {
|
|
7
|
+
//supportFile: './cypress/support/component.js',
|
|
8
|
+
devServer: {
|
|
9
|
+
framework: 'react',
|
|
10
|
+
bundler: 'webpack',
|
|
11
|
+
webpackConfig: {
|
|
12
|
+
mode: 'development',
|
|
13
|
+
resolve: {
|
|
14
|
+
extensions: ['.mjs', '.js', '.jsx', '.json', '.cjs', '.ts', '.tsx'],
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
module: {
|
|
18
|
+
rules: [
|
|
19
|
+
{
|
|
20
|
+
test: /\.(js|jsx|tsx|ts)$/, // USE THE babel-loader FOR THESE FILE EXTENSIONS
|
|
21
|
+
use: [
|
|
22
|
+
{
|
|
23
|
+
loader: 'babel-loader',
|
|
24
|
+
options: {
|
|
25
|
+
sourceType: 'unambiguous',
|
|
26
|
+
presets: [
|
|
27
|
+
['@babel/preset-env', { shippedProposals: true, loose: true }],
|
|
28
|
+
'@babel/preset-typescript',
|
|
29
|
+
'@babel/preset-react',
|
|
30
|
+
],
|
|
31
|
+
plugins: [
|
|
32
|
+
'@babel/plugin-transform-shorthand-properties',
|
|
33
|
+
'@babel/plugin-transform-block-scoping',
|
|
34
|
+
['@babel/plugin-proposal-decorators', { legacy: true }],
|
|
35
|
+
['@babel/plugin-proposal-class-properties', { loose: true }],
|
|
36
|
+
['@babel/plugin-proposal-private-methods', { loose: true }],
|
|
37
|
+
'@babel/plugin-proposal-export-default-from',
|
|
38
|
+
'@babel/plugin-syntax-dynamic-import',
|
|
39
|
+
[
|
|
40
|
+
'@babel/plugin-proposal-object-rest-spread',
|
|
41
|
+
{ loose: true, useBuiltIns: true },
|
|
42
|
+
],
|
|
43
|
+
'@babel/plugin-transform-classes',
|
|
44
|
+
'@babel/plugin-transform-arrow-functions',
|
|
45
|
+
'@babel/plugin-transform-parameters',
|
|
46
|
+
'@babel/plugin-transform-destructuring',
|
|
47
|
+
'@babel/plugin-transform-spread',
|
|
48
|
+
'@babel/plugin-transform-for-of',
|
|
49
|
+
'@storybook/core-common/node_modules/babel-plugin-macros',
|
|
50
|
+
'@babel/plugin-proposal-optional-chaining',
|
|
51
|
+
'@babel/plugin-proposal-nullish-coalescing-operator',
|
|
52
|
+
[
|
|
53
|
+
'babel-plugin-polyfill-corejs3',
|
|
54
|
+
{
|
|
55
|
+
method: 'usage-global',
|
|
56
|
+
absoluteImports: 'core-js',
|
|
57
|
+
version: '3.21.1',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
'@babel/plugin-transform-template-literals',
|
|
61
|
+
],
|
|
62
|
+
babelrc: true,
|
|
63
|
+
configFile: false,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
exclude: [ /node_modules/, /dist/ ]
|
|
68
|
+
},
|
|
69
|
+
/*{
|
|
70
|
+
test: /\.(ts|tsx)$/,
|
|
71
|
+
exclude: [/node_modules/],
|
|
72
|
+
use: {
|
|
73
|
+
loader: require.resolve('babel-loader'),
|
|
74
|
+
options: {
|
|
75
|
+
plugins: [],
|
|
76
|
+
presets: ['@babel/preset-typescript'],
|
|
77
|
+
babelrc: false,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},*/
|
|
81
|
+
{
|
|
82
|
+
test: /\.(svg|ico|jpg|jpeg|png|apng|gif|eot|otf|webp|ttf|woff|woff2|cur|ani|pdf)(\?.*)?$/,
|
|
83
|
+
loader: 'file-loader',
|
|
84
|
+
options: { name: 'static/media/[path][name].[ext]' },
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
test: /\.css$/,
|
|
88
|
+
use: [
|
|
89
|
+
'style-loader',
|
|
90
|
+
{
|
|
91
|
+
loader: 'css-loader',
|
|
92
|
+
options: { importLoaders: 1 },
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { MapOptions as MapOptionsType } from "maplibre-gl";
|
|
3
3
|
import "maplibre-gl/dist/maplibre-gl.css";
|
|
4
|
-
|
|
4
|
+
type MapLibreMapProps = {
|
|
5
5
|
/**
|
|
6
6
|
* Id of the MapLibreGl(Wrapper) instance in mapContext
|
|
7
7
|
*/
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import { IControl, MapOptions as MapOptionsType } from
|
|
2
|
-
import { Map as MapType } from
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Map, IControl, MapOptions as MapOptionsType, MapEventType, MapLayerEventType, StyleImageInterface, LayerSpecification, CustomLayerInterface, SourceSpecification, ControlPosition } from '!maplibre-gl';
|
|
2
|
+
import { Map as MapType, Style } from 'maplibre-gl';
|
|
3
|
+
type WrapperEventArgArray = [string, (arg0: unknown) => void];
|
|
4
|
+
type EventArgArray = [
|
|
5
|
+
keyof MapLayerEventType | keyof MapEventType,
|
|
6
|
+
string | ((arg0: unknown) => void),
|
|
7
|
+
((arg0: unknown) => void)?
|
|
8
|
+
];
|
|
9
|
+
type LayerState = {
|
|
5
10
|
id: string;
|
|
6
11
|
type: string;
|
|
7
12
|
visible: boolean;
|
|
8
13
|
baseLayer: boolean;
|
|
9
14
|
};
|
|
10
|
-
|
|
15
|
+
type ViewportState = {
|
|
11
16
|
center: {
|
|
12
17
|
lng: number;
|
|
13
18
|
lat: number;
|
|
@@ -29,47 +34,68 @@ declare class MapLibreGlWrapper {
|
|
|
29
34
|
layers: [string?];
|
|
30
35
|
sources: [string?];
|
|
31
36
|
images: [string?];
|
|
32
|
-
controls: [IControl?];
|
|
37
|
+
controls: [(IControl | unknown)?];
|
|
33
38
|
events: [EventArgArray?];
|
|
34
|
-
wrapperEvents: [
|
|
39
|
+
wrapperEvents: [WrapperEventArgArray?];
|
|
35
40
|
};
|
|
36
41
|
};
|
|
37
42
|
baseLayers: [string?];
|
|
38
43
|
firstSymbolLayer: string | undefined;
|
|
39
44
|
eventHandlers: {
|
|
40
|
-
layerchange:
|
|
41
|
-
|
|
45
|
+
layerchange: {
|
|
46
|
+
handler: (ev: unknown) => void;
|
|
47
|
+
options?: object | string;
|
|
48
|
+
}[];
|
|
49
|
+
viewportchange: {
|
|
50
|
+
handler: (ev: unknown) => void;
|
|
51
|
+
}[];
|
|
42
52
|
};
|
|
43
53
|
wrapper: {
|
|
44
|
-
on:
|
|
45
|
-
off:
|
|
46
|
-
fire:
|
|
47
|
-
layerState: [
|
|
54
|
+
on: (eventName: string, handler: (ev: unknown) => void, options?: object | string, componentId?: string) => void;
|
|
55
|
+
off: (type: string, listener: (ev: unknown) => void) => void;
|
|
56
|
+
fire: (eventName: string, context?: unknown) => void;
|
|
57
|
+
layerState: LayerState[];
|
|
48
58
|
layerStateString: string;
|
|
49
59
|
oldLayerStateStrings: object;
|
|
50
|
-
buildLayerObject:
|
|
51
|
-
buildLayerObjects:
|
|
52
|
-
refreshLayerState:
|
|
60
|
+
buildLayerObject: (layer: ReturnType<Style['getLayer']>) => LayerState;
|
|
61
|
+
buildLayerObjects: () => LayerState[];
|
|
62
|
+
refreshLayerState: () => void;
|
|
53
63
|
viewportState: ViewportState;
|
|
54
64
|
viewportStateString: string;
|
|
55
65
|
oldViewportStateString: string;
|
|
56
|
-
getViewport:
|
|
57
|
-
|
|
66
|
+
getViewport: () => {
|
|
67
|
+
center: {
|
|
68
|
+
lng: number;
|
|
69
|
+
lat: number;
|
|
70
|
+
};
|
|
71
|
+
zoom: number;
|
|
72
|
+
bearing: number;
|
|
73
|
+
pitch: number;
|
|
74
|
+
};
|
|
75
|
+
refreshViewport: () => void;
|
|
58
76
|
};
|
|
59
|
-
initRegisteredElements:
|
|
60
|
-
addNativeMaplibreFunctionsAndProps:
|
|
77
|
+
initRegisteredElements: (componentId: string, force?: boolean | undefined) => void;
|
|
78
|
+
addNativeMaplibreFunctionsAndProps: () => void;
|
|
61
79
|
map: MapType;
|
|
62
80
|
style: object;
|
|
63
81
|
styleJson: object;
|
|
64
|
-
addLayer:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
82
|
+
addLayer: (layer: (LayerSpecification & {
|
|
83
|
+
source?: string | SourceSpecification | undefined;
|
|
84
|
+
}) | (CustomLayerInterface & {
|
|
85
|
+
source?: string | SourceSpecification | undefined;
|
|
86
|
+
}), beforeId?: string | undefined, componentId?: string | undefined) => Map | undefined;
|
|
87
|
+
addSource: (id: string, source: SourceSpecification, componentId?: string | undefined) => Map | undefined;
|
|
88
|
+
addControl: (control: IControl | unknown, position?: ControlPosition | undefined, componentId?: string | undefined) => Map | undefined;
|
|
89
|
+
addImage: (id: string, image: HTMLImageElement | ImageBitmap | ImageData | {
|
|
90
|
+
width: number;
|
|
91
|
+
height: number;
|
|
92
|
+
data: Uint8Array | Uint8ClampedArray;
|
|
93
|
+
} | StyleImageInterface, componentId?: string | undefined) => void;
|
|
94
|
+
on: (type: keyof MapLayerEventType | keyof MapEventType | string, layerId: string | ((ev: unknown) => void), handler?: ((ev: MapEventType & unknown) => Map | void) | string, componentId?: string | undefined) => Map | undefined;
|
|
95
|
+
cleanup: (componentId: string) => void;
|
|
70
96
|
constructor(props: {
|
|
71
97
|
mapOptions: MapOptionsType;
|
|
72
|
-
onReady:
|
|
98
|
+
onReady: (map: MapType, context: unknown) => void;
|
|
73
99
|
});
|
|
74
100
|
}
|
|
75
101
|
export default MapLibreGlWrapper;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { SxProps, Theme } from "@mui/material";
|
|
2
|
+
export interface MlCenterPositionProps {
|
|
2
3
|
/**
|
|
3
4
|
* Id of the target MapLibre instance in mapContext
|
|
4
5
|
*/
|
|
@@ -19,7 +20,7 @@ interface MlCenterPositionProps {
|
|
|
19
20
|
/**
|
|
20
21
|
* CSS style object that is applied to the button component
|
|
21
22
|
*/
|
|
22
|
-
style?:
|
|
23
|
+
style?: SxProps<Theme> | undefined;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* Component template
|
|
@@ -1,17 +1,36 @@
|
|
|
1
|
+
declare const storyoptions: {
|
|
2
|
+
title: string;
|
|
3
|
+
component: {
|
|
4
|
+
(props: import("./MlCenterPosition").MlCenterPositionProps): JSX.Element;
|
|
5
|
+
defaultProps: {
|
|
6
|
+
mapId: undefined;
|
|
7
|
+
style: {
|
|
8
|
+
minWidth: string;
|
|
9
|
+
minHeight: string;
|
|
10
|
+
width: string;
|
|
11
|
+
height: string;
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
borderRadius: string;
|
|
14
|
+
margin: number;
|
|
15
|
+
fontSize: string;
|
|
16
|
+
":hover": {
|
|
17
|
+
backgroundColor: string;
|
|
18
|
+
color: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
onColor: string;
|
|
22
|
+
offColor: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
argTypes: {};
|
|
26
|
+
decorators: ((Story: any) => JSX.Element)[];
|
|
27
|
+
parameters: {
|
|
28
|
+
docs: {
|
|
29
|
+
source: {
|
|
30
|
+
type: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
1
35
|
export default storyoptions;
|
|
2
|
-
export const ExampleConfig: any;
|
|
3
|
-
declare namespace storyoptions {
|
|
4
|
-
export const title: string;
|
|
5
|
-
export { MlCenterPosition as component };
|
|
6
|
-
export const argTypes: {};
|
|
7
|
-
export { mapContextDecorator as decorators };
|
|
8
|
-
export namespace parameters {
|
|
9
|
-
namespace docs {
|
|
10
|
-
namespace source {
|
|
11
|
-
const type: string;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
import MlCenterPosition from "./MlCenterPosition";
|
|
17
|
-
import mapContextDecorator from "../../decorators/MapContextDecorator";
|
|
36
|
+
export declare const ExampleConfig: any;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
declare const storyoptions: {
|
|
2
|
+
title: string;
|
|
3
|
+
component: {
|
|
4
|
+
(props: import("./MlComponentTemplate").MlComponentTemplateProps): JSX.Element;
|
|
5
|
+
defaultProps: {
|
|
6
|
+
mapId: undefined;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
argTypes: {};
|
|
10
|
+
decorators: ((Story: any) => JSX.Element)[];
|
|
11
|
+
};
|
|
1
12
|
export default storyoptions;
|
|
2
|
-
export const ExampleConfig: any;
|
|
3
|
-
declare namespace storyoptions {
|
|
4
|
-
export const title: string;
|
|
5
|
-
export { MlComponentTemplate as component };
|
|
6
|
-
export const argTypes: {};
|
|
7
|
-
export { mapContextDecorator as decorators };
|
|
8
|
-
}
|
|
9
|
-
import MlComponentTemplate from "./MlComponentTemplate";
|
|
10
|
-
import mapContextDecorator from "../../decorators/MapContextDecorator";
|
|
13
|
+
export declare const ExampleConfig: any;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
declare const storyoptions: {
|
|
2
|
+
title: string;
|
|
3
|
+
component: {
|
|
4
|
+
(props: import("./MlCreatePdfButton").MlCreatePdfButtonProps): JSX.Element;
|
|
5
|
+
defaultProps: {
|
|
6
|
+
mapId: undefined;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
argTypes: {};
|
|
10
|
+
decorators: ((Story: any) => JSX.Element)[];
|
|
11
|
+
};
|
|
1
12
|
export default storyoptions;
|
|
2
|
-
export const ExampleConfig: any;
|
|
3
|
-
declare namespace storyoptions {
|
|
4
|
-
export const title: string;
|
|
5
|
-
export { MlCreatePdfButton as component };
|
|
6
|
-
export const argTypes: {};
|
|
7
|
-
export { mapContextDecorator as decorators };
|
|
8
|
-
}
|
|
9
|
-
import MlCreatePdfButton from "./MlCreatePdfButton";
|
|
10
|
-
import mapContextDecorator from "../../decorators/MapContextDecorator";
|
|
13
|
+
export declare const ExampleConfig: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import './MlFeatureEditor.css';
|
|
2
|
+
import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
|
|
3
|
+
import { GeoJSONObject, Feature } from '@turf/turf';
|
|
3
4
|
interface MlFeatureEditorProps {
|
|
4
5
|
/**
|
|
5
6
|
* Id of the target MapLibre instance in mapContext
|
|
@@ -13,12 +14,17 @@ interface MlFeatureEditorProps {
|
|
|
13
14
|
/**
|
|
14
15
|
* Input GeoJson data at initialization
|
|
15
16
|
*/
|
|
16
|
-
geojson?:
|
|
17
|
+
geojson?: Feature;
|
|
17
18
|
/**
|
|
18
19
|
* Callback function that is called each time the GeoJson data within has changed within MlFeatureEditor.
|
|
19
20
|
* First parameter is the new GeoJson feature.
|
|
20
21
|
*/
|
|
21
|
-
onChange?:
|
|
22
|
+
onChange?: (para: GeoJSONObject[]) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Callback function that is called each time the GeoJson data within has been finished within MlFeatureEditor.
|
|
25
|
+
* First parameter is the new GeoJson feature.
|
|
26
|
+
*/
|
|
27
|
+
onFinish?: () => void;
|
|
22
28
|
/**
|
|
23
29
|
* Feature editor mode:
|
|
24
30
|
* - "custom_select" edit features
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Feature, FeatureCollection } from
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { Feature, FeatureCollection } from '@turf/turf';
|
|
2
|
+
import { useLayerProps } from '../../hooks/useLayer';
|
|
3
|
+
import { LineLayerSpecification, CircleLayerSpecification, FillLayerSpecification, LayerSpecification, RasterLayerSpecification } from 'maplibre-gl';
|
|
4
|
+
export type MlGeoJsonLayerProps = {
|
|
4
5
|
/**
|
|
5
6
|
* Id of the target MapLibre instance in mapContext
|
|
6
7
|
*/
|
|
@@ -22,29 +23,39 @@ declare type MlGeoJsonLayerProps = {
|
|
|
22
23
|
geojson: Feature | FeatureCollection | undefined;
|
|
23
24
|
/**
|
|
24
25
|
* Type of the layer that will be added to the MapLibre instance.
|
|
25
|
-
*
|
|
26
|
+
* All types from LayerSpecification union type are supported except the type from
|
|
27
|
+
* RasterLayerSpecification
|
|
26
28
|
*/
|
|
27
|
-
type?:
|
|
29
|
+
type?: Exclude<LayerSpecification['type'], RasterLayerSpecification['type']>;
|
|
28
30
|
/**
|
|
29
31
|
* Paint property object, that is passed to the addLayer call.
|
|
30
32
|
* Possible props depend on the layer type.
|
|
33
|
+
* See https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/
|
|
34
|
+
* Some examples are:
|
|
31
35
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#line
|
|
32
36
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
|
|
33
37
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
|
|
38
|
+
* All paint types from LayerSpecification union type are supported except the paint type from
|
|
39
|
+
* RasterLayerSpecification
|
|
34
40
|
*/
|
|
35
|
-
paint?:
|
|
41
|
+
paint?: Exclude<LayerSpecification['paint'], RasterLayerSpecification['paint']>;
|
|
36
42
|
/**
|
|
37
43
|
* Layout property object, that is passed to the addLayer call.
|
|
38
44
|
* Possible props depend on the layer type.
|
|
45
|
+
* See https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/
|
|
46
|
+
* Some examples are:
|
|
39
47
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#line
|
|
40
48
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
|
|
41
49
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
|
|
50
|
+
* All layout types from LayerSpecification union type are supported except the layout type from
|
|
51
|
+
* RasterLayerSpecification
|
|
52
|
+
|
|
42
53
|
*/
|
|
43
|
-
layout?:
|
|
54
|
+
layout?: Exclude<LayerSpecification['layout'], RasterLayerSpecification['layout']>;
|
|
44
55
|
/**
|
|
45
56
|
* Javascript object that is spread into the addLayer commands first parameter.
|
|
46
57
|
*/
|
|
47
|
-
options?:
|
|
58
|
+
options?: Exclude<LayerSpecification, RasterLayerSpecification>;
|
|
48
59
|
/**
|
|
49
60
|
* Javascript object with optional properties "fill", "line", "circle" to override implicit layer type default paint properties.
|
|
50
61
|
*/
|
|
@@ -56,19 +67,19 @@ declare type MlGeoJsonLayerProps = {
|
|
|
56
67
|
/**
|
|
57
68
|
* Hover event handler that is executed whenever a geometry rendered by this component is hovered.
|
|
58
69
|
*/
|
|
59
|
-
onHover?:
|
|
70
|
+
onHover?: useLayerProps['onHover'];
|
|
60
71
|
/**
|
|
61
72
|
* Click event handler that is executed whenever a geometry rendered by this component is clicked.
|
|
62
73
|
*/
|
|
63
|
-
onClick?:
|
|
74
|
+
onClick?: useLayerProps['onClick'];
|
|
64
75
|
/**
|
|
65
76
|
* Leave event handler that is executed whenever a geometry rendered by this component is
|
|
66
77
|
* left/unhovered.
|
|
67
78
|
*/
|
|
68
|
-
onLeave?:
|
|
79
|
+
onLeave?: useLayerProps['onLeave'];
|
|
69
80
|
};
|
|
70
81
|
/**
|
|
71
|
-
* Adds source and layer
|
|
82
|
+
* Adds source and layer to display GeoJSON data on the map.
|
|
72
83
|
*
|
|
73
84
|
* @component
|
|
74
85
|
*/
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { MlGeoJsonLayerProps } from './MlGeoJsonLayer';
|
|
2
|
+
declare const storyoptions: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (props: MlGeoJsonLayerProps) => JSX.Element;
|
|
5
|
+
argTypes: {};
|
|
6
|
+
decorators: ((Story: any) => JSX.Element)[];
|
|
7
|
+
};
|
|
1
8
|
export default storyoptions;
|
|
2
|
-
export const Linestring: any;
|
|
3
|
-
export const Polygon: any;
|
|
4
|
-
export const DefaultPaintOverrides: any;
|
|
5
|
-
declare
|
|
6
|
-
|
|
7
|
-
export { MlGeoJsonLayer as component };
|
|
8
|
-
export const argTypes: {};
|
|
9
|
-
export { mapContextDecorator as decorators };
|
|
10
|
-
}
|
|
11
|
-
import MlGeoJsonLayer from "./MlGeoJsonLayer";
|
|
12
|
-
import mapContextDecorator from "../../decorators/MapContextDecorator";
|
|
9
|
+
export declare const Linestring: any;
|
|
10
|
+
export declare const Polygon: any;
|
|
11
|
+
export declare const DefaultPaintOverrides: any;
|
|
12
|
+
export declare const HeatMapEarthquakes: any;
|
|
13
|
+
export declare const CircleMapWheregroupLocations: any;
|