@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
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
3
|
-
useCallback,
|
|
4
|
-
useRef,
|
|
5
|
-
useEffect,
|
|
6
|
-
useState,
|
|
7
|
-
useMemo
|
|
8
|
-
} from "react";
|
|
1
|
+
import React, { useContext, useCallback, useRef, useEffect, useState, useMemo } from 'react';
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
9
3
|
// @ts-ignore
|
|
10
|
-
import syncMove from
|
|
11
|
-
import
|
|
12
|
-
import
|
|
4
|
+
import syncMove from '@mapbox/mapbox-gl-sync-move';
|
|
5
|
+
import './style.css';
|
|
6
|
+
import MapContext from '../../contexts/MapContext';
|
|
13
7
|
|
|
14
|
-
interface MlLayerMagnifyProps {
|
|
8
|
+
export interface MlLayerMagnifyProps {
|
|
15
9
|
/**
|
|
16
10
|
* Id of the first MapLibre instance
|
|
17
11
|
*/
|
|
@@ -24,6 +18,10 @@ interface MlLayerMagnifyProps {
|
|
|
24
18
|
* Size of the "magnifier"-circle
|
|
25
19
|
*/
|
|
26
20
|
magnifierRadius?: number;
|
|
21
|
+
/**
|
|
22
|
+
* object (React.CSSProperties) that is added to the magnifier default style
|
|
23
|
+
*/
|
|
24
|
+
magnifierStyle: React.CSSProperties | undefined;
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
/**
|
|
@@ -32,7 +30,7 @@ interface MlLayerMagnifyProps {
|
|
|
32
30
|
* the map and can be dragged around on top of the MapLibreMap referenced by props.map1Id
|
|
33
31
|
*/
|
|
34
32
|
const MlLayerMagnify = (props: MlLayerMagnifyProps) => {
|
|
35
|
-
const mapContext:MapContextType = useContext(MapContext);
|
|
33
|
+
const mapContext: MapContextType = useContext(MapContext);
|
|
36
34
|
const syncMoveInitializedRef = useRef(false);
|
|
37
35
|
const syncCleanupFunctionRef = useRef(() => {});
|
|
38
36
|
|
|
@@ -43,7 +41,7 @@ const MlLayerMagnify = (props: MlLayerMagnifyProps) => {
|
|
|
43
41
|
|
|
44
42
|
const magnifierRadius = useMemo(() => {
|
|
45
43
|
return props.magnifierRadius || 200;
|
|
46
|
-
},[props.magnifierRadius]);
|
|
44
|
+
}, [props.magnifierRadius]);
|
|
47
45
|
|
|
48
46
|
const mapExists = useCallback(() => {
|
|
49
47
|
if (!props.map1Id || !props.map2Id) {
|
|
@@ -66,11 +64,11 @@ const MlLayerMagnify = (props: MlLayerMagnifyProps) => {
|
|
|
66
64
|
});
|
|
67
65
|
|
|
68
66
|
useEffect(() => {
|
|
69
|
-
window.addEventListener(
|
|
70
|
-
|
|
67
|
+
window.addEventListener('resize', onResize.current);
|
|
68
|
+
const _onResize = onResize.current;
|
|
71
69
|
|
|
72
70
|
return () => {
|
|
73
|
-
window.removeEventListener(
|
|
71
|
+
window.removeEventListener('resize', _onResize);
|
|
74
72
|
syncCleanupFunctionRef.current();
|
|
75
73
|
};
|
|
76
74
|
}, []);
|
|
@@ -79,29 +77,24 @@ const MlLayerMagnify = (props: MlLayerMagnifyProps) => {
|
|
|
79
77
|
(e) => {
|
|
80
78
|
if (!mapExists()) return;
|
|
81
79
|
|
|
82
|
-
|
|
83
|
-
.getCanvas()
|
|
84
|
-
.getBoundingClientRect();
|
|
80
|
+
const bounds = mapContext.maps[props.map1Id].getCanvas().getBoundingClientRect();
|
|
85
81
|
let clientX =
|
|
86
82
|
e.clientX ||
|
|
87
|
-
(typeof e.touches !==
|
|
83
|
+
(typeof e.touches !== 'undefined' && typeof e.touches[0] !== 'undefined'
|
|
88
84
|
? e.touches[0].clientX
|
|
89
85
|
: 0);
|
|
90
86
|
let clientY =
|
|
91
87
|
e.clientY ||
|
|
92
|
-
(typeof e.touches !==
|
|
88
|
+
(typeof e.touches !== 'undefined' && typeof e.touches[0] !== 'undefined'
|
|
93
89
|
? e.touches[0].clientY
|
|
94
90
|
: 0);
|
|
95
91
|
|
|
96
92
|
clientX -= bounds.x;
|
|
97
93
|
clientY -= bounds.y;
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
const swipeX_tmp = ((clientX / bounds.width) * 100).toFixed(2);
|
|
95
|
+
const swipeY_tmp = ((clientY / bounds.height) * 100).toFixed(2);
|
|
100
96
|
|
|
101
|
-
if (
|
|
102
|
-
swipeXRef.current !== swipeX_tmp ||
|
|
103
|
-
swipeYRef.current !== swipeY_tmp
|
|
104
|
-
) {
|
|
97
|
+
if (swipeXRef.current !== swipeX_tmp || swipeYRef.current !== swipeY_tmp) {
|
|
105
98
|
setSwipeX(swipeX_tmp);
|
|
106
99
|
swipeXRef.current = swipeX_tmp;
|
|
107
100
|
setSwipeY(swipeY_tmp);
|
|
@@ -110,9 +103,9 @@ const MlLayerMagnify = (props: MlLayerMagnifyProps) => {
|
|
|
110
103
|
mapContext.maps[props.map2Id].getContainer().style.clipPath =
|
|
111
104
|
`circle(${magnifierRadius}px at ` +
|
|
112
105
|
(parseFloat(swipeXRef.current) * bounds.width) / 100 +
|
|
113
|
-
|
|
106
|
+
'px ' +
|
|
114
107
|
(parseFloat(swipeYRef.current) * bounds.height) / 100 +
|
|
115
|
-
|
|
108
|
+
'px)';
|
|
116
109
|
}
|
|
117
110
|
},
|
|
118
111
|
[mapContext, mapExists, props, magnifierRadius]
|
|
@@ -160,53 +153,53 @@ const MlLayerMagnify = (props: MlLayerMagnifyProps) => {
|
|
|
160
153
|
});
|
|
161
154
|
}, [mapContext.mapIds, mapContext, mapExists, props, onMove]);
|
|
162
155
|
|
|
163
|
-
const onDown = (e:
|
|
164
|
-
if (e.
|
|
165
|
-
document.addEventListener(
|
|
166
|
-
document.addEventListener(
|
|
156
|
+
const onDown = (e: React.MouseEvent | React.TouchEvent) => {
|
|
157
|
+
if (e.nativeEvent instanceof TouchEvent) {
|
|
158
|
+
document.addEventListener('touchmove', onMove);
|
|
159
|
+
document.addEventListener('touchend', onTouchEnd);
|
|
167
160
|
} else {
|
|
168
|
-
document.addEventListener(
|
|
169
|
-
document.addEventListener(
|
|
161
|
+
document.addEventListener('mousemove', onMove);
|
|
162
|
+
document.addEventListener('mouseup', onMouseUp);
|
|
170
163
|
}
|
|
171
164
|
};
|
|
172
165
|
|
|
173
166
|
const onTouchEnd = () => {
|
|
174
|
-
document.removeEventListener(
|
|
175
|
-
document.removeEventListener(
|
|
167
|
+
document.removeEventListener('touchmove', onMove);
|
|
168
|
+
document.removeEventListener('touchend', onTouchEnd);
|
|
176
169
|
};
|
|
177
170
|
|
|
178
171
|
const onMouseUp = () => {
|
|
179
|
-
document.removeEventListener(
|
|
180
|
-
document.removeEventListener(
|
|
172
|
+
document.removeEventListener('mousemove', onMove);
|
|
173
|
+
document.removeEventListener('mouseup', onMouseUp);
|
|
181
174
|
};
|
|
182
175
|
|
|
183
|
-
const onWheel = (e:
|
|
184
|
-
|
|
176
|
+
const onWheel = (e: React.WheelEvent) => {
|
|
177
|
+
const evCopy = new WheelEvent(e.type, e as unknown as WheelEventInit);
|
|
185
178
|
mapContext.map.getCanvas().dispatchEvent(evCopy);
|
|
186
179
|
};
|
|
187
180
|
|
|
188
181
|
return (
|
|
189
182
|
<div
|
|
190
183
|
style={{
|
|
191
|
-
position:
|
|
192
|
-
left: swipeX +
|
|
193
|
-
top: swipeY +
|
|
194
|
-
borderRadius:
|
|
195
|
-
width: magnifierRadius * 2
|
|
196
|
-
height: magnifierRadius * 2
|
|
197
|
-
background:
|
|
198
|
-
border:
|
|
199
|
-
boxShadow:
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
184
|
+
position: 'absolute',
|
|
185
|
+
left: swipeX + '%',
|
|
186
|
+
top: swipeY + '%',
|
|
187
|
+
borderRadius: '50%',
|
|
188
|
+
width: magnifierRadius * 2 - 2 + 'px',
|
|
189
|
+
height: magnifierRadius * 2 - 2 + 'px',
|
|
190
|
+
background: 'rgba(0,0,0,0)',
|
|
191
|
+
border: '2px solid #fafafa',
|
|
192
|
+
boxShadow: '1px 2px 2px rgba(19, 19, 19, .5), inset 1px 1px 1px rgba(19, 19, 19, .2)',
|
|
193
|
+
cursor: 'pointer',
|
|
194
|
+
zIndex: '110',
|
|
195
|
+
marginLeft: magnifierRadius * -1 - 1 + 'px',
|
|
196
|
+
marginTop: magnifierRadius * -1 - 1 + 'px',
|
|
197
|
+
textAlign: 'center',
|
|
198
|
+
lineHeight: '91px',
|
|
199
|
+
fontSize: '2em',
|
|
200
|
+
color: '#fafafa',
|
|
201
|
+
userSelect: 'none',
|
|
202
|
+
...props.magnifierStyle,
|
|
210
203
|
}}
|
|
211
204
|
onTouchStart={onDown}
|
|
212
205
|
onMouseDown={onDown}
|
|
@@ -217,6 +210,7 @@ const MlLayerMagnify = (props: MlLayerMagnifyProps) => {
|
|
|
217
210
|
|
|
218
211
|
MlLayerMagnify.defaultProps = {
|
|
219
212
|
magnifierRadius: 200,
|
|
213
|
+
magnifierStyle: {},
|
|
220
214
|
};
|
|
221
215
|
|
|
222
216
|
export default MlLayerMagnify;
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import MlLayerSwipe from
|
|
4
|
-
import MlWmsLayer from
|
|
3
|
+
import MlLayerSwipe from './MlLayerSwipe';
|
|
4
|
+
import MlWmsLayer from '../MlWmsLayer/MlWmsLayer';
|
|
5
5
|
|
|
6
|
-
import multiMapContextDecorator from
|
|
6
|
+
import multiMapContextDecorator from '../../decorators/MultiMapContextDecorator';
|
|
7
7
|
|
|
8
8
|
const storyoptions = {
|
|
9
|
-
title:
|
|
10
|
-
name: "MlLayerSwipe",
|
|
9
|
+
title: 'MapComponents/MlLayerSwipe',
|
|
11
10
|
component: MlLayerSwipe,
|
|
12
|
-
argTypes: {
|
|
13
|
-
},
|
|
11
|
+
argTypes: {},
|
|
14
12
|
decorators: multiMapContextDecorator,
|
|
15
13
|
};
|
|
16
|
-
export default storyoptions;
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
export default storyoptions;
|
|
16
|
+
const Template = () => (
|
|
19
17
|
<>
|
|
20
18
|
<MlWmsLayer
|
|
21
19
|
url="https://www.wms.nrw.de/geobasis/wms_nw_uraufnahme"
|
|
22
20
|
urlParameters={{
|
|
23
|
-
layers:
|
|
21
|
+
layers: 'nw_uraufnahme_rw',
|
|
24
22
|
}}
|
|
25
23
|
sourceOptions={{
|
|
26
24
|
minzoom: 13,
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
3
|
-
useCallback,
|
|
4
|
-
useRef,
|
|
5
|
-
useEffect,
|
|
6
|
-
useState,
|
|
7
|
-
} from "react";
|
|
1
|
+
import React, { useContext, useCallback, useRef, useEffect, useState } from 'react';
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
8
3
|
// @ts-ignore
|
|
9
|
-
import syncMove from
|
|
10
|
-
import
|
|
11
|
-
import MapContext from
|
|
4
|
+
import syncMove from '@mapbox/mapbox-gl-sync-move';
|
|
5
|
+
import './style.css';
|
|
6
|
+
import MapContext from '../../contexts/MapContext';
|
|
12
7
|
|
|
13
|
-
interface MlLayerSwipeProps {
|
|
8
|
+
export interface MlLayerSwipeProps {
|
|
14
9
|
/**
|
|
15
10
|
* Id of the first MapLibre instance.
|
|
16
11
|
*/
|
|
@@ -19,6 +14,10 @@ interface MlLayerSwipeProps {
|
|
|
19
14
|
* Id of the second MapLibre instance.
|
|
20
15
|
*/
|
|
21
16
|
map2Id: string;
|
|
17
|
+
/**
|
|
18
|
+
* object (React.CSSProperties) that is added to the button default style
|
|
19
|
+
*/
|
|
20
|
+
buttonStyle: React.CSSProperties | undefined;
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
/**
|
|
@@ -45,33 +44,28 @@ const MlLayerSwipe = (props: MlLayerSwipeProps) => {
|
|
|
45
44
|
}, [mapContext, props.map1Id, props.map2Id]);
|
|
46
45
|
|
|
47
46
|
const cleanup = () => {
|
|
48
|
-
|
|
47
|
+
syncCleanupFunctionRef.current();
|
|
49
48
|
};
|
|
50
49
|
|
|
51
50
|
const onMove = useCallback(
|
|
52
51
|
(e) => {
|
|
53
52
|
if (!mapExists()) return;
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
.getCanvas()
|
|
57
|
-
.getBoundingClientRect();
|
|
54
|
+
const bounds = mapContext.maps[props.map1Id].getCanvas().getBoundingClientRect();
|
|
58
55
|
let clientX =
|
|
59
56
|
e.clientX ||
|
|
60
|
-
(typeof e.touches !==
|
|
57
|
+
(typeof e.touches !== 'undefined' && typeof e.touches[0] !== 'undefined'
|
|
61
58
|
? e.touches[0].clientX
|
|
62
59
|
: 0);
|
|
63
60
|
|
|
64
61
|
clientX -= bounds.x;
|
|
65
|
-
|
|
62
|
+
const swipeX_tmp = parseFloat(((clientX / bounds.width) * 100).toFixed(2));
|
|
66
63
|
|
|
67
64
|
if (swipeXRef.current !== swipeX_tmp) {
|
|
68
65
|
setSwipeX(swipeX_tmp);
|
|
69
66
|
swipeXRef.current = swipeX_tmp;
|
|
70
67
|
|
|
71
|
-
|
|
72
|
-
"rect(0, " +
|
|
73
|
-
(swipeXRef.current * bounds.width) / 100 +
|
|
74
|
-
"px, 999em, 0)";
|
|
68
|
+
const clipA = 'rect(0, ' + (swipeXRef.current * bounds.width) / 100 + 'px, 999em, 0)';
|
|
75
69
|
|
|
76
70
|
mapContext.maps[props.map2Id].getContainer().style.clip = clipA;
|
|
77
71
|
}
|
|
@@ -96,46 +90,47 @@ const MlLayerSwipe = (props: MlLayerSwipeProps) => {
|
|
|
96
90
|
});
|
|
97
91
|
}, [mapContext.mapIds, mapContext, props, onMove, mapExists]);
|
|
98
92
|
|
|
99
|
-
const onDown = (e:
|
|
100
|
-
if (e.
|
|
101
|
-
document.addEventListener(
|
|
102
|
-
document.addEventListener(
|
|
93
|
+
const onDown = (e: React.MouseEvent | React.TouchEvent) => {
|
|
94
|
+
if (e.nativeEvent instanceof TouchEvent) {
|
|
95
|
+
document.addEventListener('touchmove', onMove);
|
|
96
|
+
document.addEventListener('touchend', onTouchEnd);
|
|
103
97
|
} else {
|
|
104
|
-
document.addEventListener(
|
|
105
|
-
document.addEventListener(
|
|
98
|
+
document.addEventListener('mousemove', onMove);
|
|
99
|
+
document.addEventListener('mouseup', onMouseUp);
|
|
106
100
|
}
|
|
107
101
|
};
|
|
108
102
|
|
|
109
103
|
const onTouchEnd = () => {
|
|
110
|
-
document.removeEventListener(
|
|
111
|
-
document.removeEventListener(
|
|
104
|
+
document.removeEventListener('touchmove', onMove);
|
|
105
|
+
document.removeEventListener('touchend', onTouchEnd);
|
|
112
106
|
};
|
|
113
107
|
|
|
114
108
|
const onMouseUp = () => {
|
|
115
|
-
document.removeEventListener(
|
|
116
|
-
document.removeEventListener(
|
|
109
|
+
document.removeEventListener('mousemove', onMove);
|
|
110
|
+
document.removeEventListener('mouseup', onMouseUp);
|
|
117
111
|
};
|
|
118
112
|
|
|
119
113
|
return (
|
|
120
114
|
<div
|
|
121
115
|
style={{
|
|
122
|
-
position:
|
|
123
|
-
left: swipeX +
|
|
124
|
-
top:
|
|
125
|
-
borderRadius:
|
|
126
|
-
width:
|
|
127
|
-
height:
|
|
128
|
-
background:
|
|
129
|
-
border:
|
|
130
|
-
cursor:
|
|
131
|
-
zIndex:
|
|
132
|
-
marginLeft:
|
|
133
|
-
marginTop:
|
|
134
|
-
textAlign:
|
|
135
|
-
lineHeight:
|
|
136
|
-
fontSize:
|
|
137
|
-
color:
|
|
138
|
-
userSelect:
|
|
116
|
+
position: 'absolute',
|
|
117
|
+
left: swipeX + '%',
|
|
118
|
+
top: '50%',
|
|
119
|
+
borderRadius: '50%',
|
|
120
|
+
width: '100px',
|
|
121
|
+
height: '100px',
|
|
122
|
+
background: '#0066ff',
|
|
123
|
+
border: '3px solid #eaebf1',
|
|
124
|
+
cursor: 'pointer',
|
|
125
|
+
zIndex: '110',
|
|
126
|
+
marginLeft: '-50px',
|
|
127
|
+
marginTop: '-50px',
|
|
128
|
+
textAlign: 'center',
|
|
129
|
+
lineHeight: '91px',
|
|
130
|
+
fontSize: '2em',
|
|
131
|
+
color: '#fafafa',
|
|
132
|
+
userSelect: 'none',
|
|
133
|
+
...props.buttonStyle,
|
|
139
134
|
}}
|
|
140
135
|
onTouchStart={onDown}
|
|
141
136
|
onMouseDown={onDown}
|
|
@@ -143,4 +138,8 @@ const MlLayerSwipe = (props: MlLayerSwipeProps) => {
|
|
|
143
138
|
);
|
|
144
139
|
};
|
|
145
140
|
|
|
141
|
+
MlLayerSwipe.defaultProps = {
|
|
142
|
+
buttonStyle: {},
|
|
143
|
+
};
|
|
144
|
+
|
|
146
145
|
export default MlLayerSwipe;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { css } from
|
|
3
|
-
import { Box } from
|
|
4
|
-
import ImageLoader from
|
|
5
|
-
import useMapState from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { css } from '@emotion/css';
|
|
3
|
+
import { Box } from '@mui/system';
|
|
4
|
+
import ImageLoader from '../../../ui_components/ImageLoader';
|
|
5
|
+
import useMapState from '../../../hooks/useMapState';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @component
|
|
@@ -20,7 +20,7 @@ const LayerBox = (props) => {
|
|
|
20
20
|
matchLayerIds: props.layerId,
|
|
21
21
|
},
|
|
22
22
|
});
|
|
23
|
-
const width =
|
|
23
|
+
const width = '40px';
|
|
24
24
|
|
|
25
25
|
const defaultClass = css`
|
|
26
26
|
& img:hover {
|
|
@@ -34,22 +34,25 @@ const LayerBox = (props) => {
|
|
|
34
34
|
className={defaultClass}
|
|
35
35
|
sx={{
|
|
36
36
|
width,
|
|
37
|
-
height:
|
|
38
|
-
justifyContent:
|
|
37
|
+
height: '53px',
|
|
38
|
+
justifyContent: 'center',
|
|
39
39
|
py: 0.25,
|
|
40
|
-
px:
|
|
41
|
-
cursor:
|
|
40
|
+
px: '1rem',
|
|
41
|
+
cursor: 'pointer',
|
|
42
|
+
display: 'flex',
|
|
43
|
+
flexDirection: 'column',
|
|
44
|
+
alignItems: 'stretch',
|
|
42
45
|
}}
|
|
43
46
|
onClick={() => {
|
|
44
47
|
props?.handleLayerBoxClick?.(props.layerId);
|
|
45
48
|
}}
|
|
46
49
|
>
|
|
47
50
|
<ImageLoader
|
|
48
|
-
|
|
49
|
-
border:
|
|
50
|
-
borderRadius:
|
|
51
|
-
height:
|
|
52
|
-
width:
|
|
51
|
+
sx={{
|
|
52
|
+
border: '2px solid ' + (layers?.[0]?.visible ? '#64c864' : '#fd720f'),
|
|
53
|
+
borderRadius: '8px',
|
|
54
|
+
height: '40px',
|
|
55
|
+
width: '40px',
|
|
53
56
|
}}
|
|
54
57
|
src={props.thumbnail}
|
|
55
58
|
/>
|
|
@@ -57,11 +60,11 @@ const LayerBox = (props) => {
|
|
|
57
60
|
<div
|
|
58
61
|
className="mllayerswitcher-layer-text"
|
|
59
62
|
style={{
|
|
60
|
-
textAlign:
|
|
61
|
-
color:
|
|
62
|
-
fontFamily:
|
|
63
|
+
textAlign: 'center',
|
|
64
|
+
color: 'rgb(112, 117, 122)',
|
|
65
|
+
fontFamily: 'Roboto, Arial',
|
|
63
66
|
width,
|
|
64
|
-
fontSize:
|
|
67
|
+
fontSize: '0.60rem',
|
|
65
68
|
}}
|
|
66
69
|
>
|
|
67
70
|
{props.label}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ColorPicker } from 'mui-color';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { paintPropsType } from './LayerPropertyForm';
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
key: string;
|
|
7
|
+
value: string;
|
|
8
|
+
propKey: string;
|
|
9
|
+
setPaintProps: (
|
|
10
|
+
paintProps: paintPropsType | ((current: paintPropsType) => paintPropsType)
|
|
11
|
+
) => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default function PaintPropsColorPicker({ propKey, value, setPaintProps }: Props) {
|
|
15
|
+
return (
|
|
16
|
+
<ColorPicker
|
|
17
|
+
value={value}
|
|
18
|
+
onChange={(value: any) => {
|
|
19
|
+
setPaintProps((current: paintPropsType): paintPropsType => {
|
|
20
|
+
if (!value?.rgb?.[0]) {
|
|
21
|
+
return current;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const newProps = {
|
|
25
|
+
...current,
|
|
26
|
+
[propKey]:
|
|
27
|
+
'rgba(' +
|
|
28
|
+
value.rgb[0] +
|
|
29
|
+
',' +
|
|
30
|
+
value.rgb[1] +
|
|
31
|
+
',' +
|
|
32
|
+
value.rgb[2] +
|
|
33
|
+
',' +
|
|
34
|
+
value.alpha +
|
|
35
|
+
')',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return newProps;
|
|
39
|
+
});
|
|
40
|
+
}}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
}
|