@mapcomponents/react-maplibre 0.1.34 → 0.1.35
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 +3 -0
- package/.github/workflows/storybook.yml +1 -1
- package/.storybook/.babelrc +26 -0
- package/.storybook/main.js +15 -1
- package/.storybook/mapcomponents_logo.png +0 -0
- package/CHANGELOG.md +6 -1
- package/config/env.js +106 -0
- package/config/getHttpsConfig.js +66 -0
- package/config/jest/babelTransform.js +29 -0
- package/config/jest/cssTransform.js +14 -0
- package/config/jest/fileTransform.js +40 -0
- package/config/modules.js +134 -0
- package/config/paths.js +75 -0
- package/config/pnpTs.js +35 -0
- package/config/webpack.config.js +757 -0
- package/config/webpackDevServer.config.js +130 -0
- package/coverage/clover.xml +822 -900
- package/coverage/coverage-final.json +23 -24
- package/coverage/lcov-report/index.html +135 -150
- package/coverage/lcov-report/src/components/MapLibreMap/{MapLibreMap.js.html → MapLibreMap.tsx.html} +77 -68
- package/coverage/lcov-report/src/components/MapLibreMap/index.html +6 -6
- package/coverage/lcov-report/src/components/MlCreatePdfButton/{MlCreatePdfButton.js.html → MlCreatePdfButton.tsx.html} +40 -43
- package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +10 -10
- package/coverage/lcov-report/src/components/MlFeatureEditor/{MlFeatureEditor.js.html → MlFeatureEditor.tsx.html} +145 -85
- package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +21 -21
- package/coverage/lcov-report/src/components/{MlImageMarkerLayer/MlImageMarkerLayer.js.html → MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html} +141 -111
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +20 -20
- package/coverage/lcov-report/src/components/MlFollowGps/{MlFollowGps.js.html → MlFollowGps.tsx.html} +177 -138
- package/coverage/lcov-report/src/components/MlFollowGps/index.html +15 -15
- package/coverage/lcov-report/src/components/MlGPXViewer/{MlGPXViewer.js.html → MlGPXViewer.tsx.html} +134 -80
- package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +1 -1
- package/coverage/lcov-report/src/components/MlGPXViewer/index.html +16 -16
- package/coverage/lcov-report/src/components/{MlLayer/MlLayer.js.html → MlGeoJsonLayer/MlGeoJsonLayer.tsx.html} +151 -154
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +19 -19
- package/coverage/lcov-report/src/components/{MlFillExtrusionLayer/MlFillExtrusionLayer.js.html → MlImageMarkerLayer/MlImageMarkerLayer.tsx.html} +151 -223
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +16 -16
- package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +229 -0
- package/coverage/lcov-report/src/components/MlLayer/index.html +21 -21
- package/coverage/lcov-report/src/components/MlLayerMagnify/{MlLayerMagnify.js.html → MlLayerMagnify.tsx.html} +134 -77
- package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +20 -20
- package/coverage/lcov-report/src/components/MlLayerSwipe/{MlLayerSwipe.js.html → MlLayerSwipe.tsx.html} +83 -41
- package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +2 -2
- package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +3 -15
- 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.js.html → MlMarker.tsx.html} +89 -137
- package/coverage/lcov-report/src/components/MlMarker/index.html +10 -10
- package/coverage/lcov-report/src/components/MlNavigationCompass/{MlNavigationCompass.js.html → MlNavigationCompass.tsx.html} +76 -25
- package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +17 -17
- package/coverage/lcov-report/src/components/MlNavigationTools/{MlNavigationTools.js.html → MlNavigationTools.tsx.html} +67 -52
- package/coverage/lcov-report/src/components/MlNavigationTools/index.html +10 -10
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.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/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +3 -3
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +5 -5
- package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/{MlTransitionGeoJsonLayer.js.html → MlTransitionGeoJsonLayer.tsx.html} +127 -118
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +11 -11
- 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.js.html → MlVectorTileLayer.tsx.html} +59 -11
- package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +2 -2
- 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.js.html → MlWmsLayer.tsx.html} +56 -11
- package/coverage/lcov-report/src/components/MlWmsLayer/index.html +2 -2
- package/coverage/lcov-report/src/components/MlWmsLoader/{MlWmsLoader.js.html → MlWmsLoader.tsx.html} +102 -78
- package/coverage/lcov-report/src/components/MlWmsLoader/index.html +8 -8
- package/coverage/lcov-report/src/hooks/index.html +44 -29
- package/coverage/lcov-report/src/{components/MlGeoJsonLayer/MlGeoJsonLayer.js.html → hooks/useLayer.ts.html} +328 -184
- package/coverage/lcov-report/src/hooks/{useMap.js.html → useMap.ts.html} +140 -50
- package/coverage/lcov-report/src/hooks/{useMapState.js.html → useMapState.ts.html} +166 -61
- package/coverage/lcov-report/src/hooks/useWms.js.html +1 -1
- package/coverage/lcov-report/src/index.html +15 -15
- package/coverage/lcov-report/src/{i18n.js.html → index.ts.html} +50 -32
- package/coverage/lcov.info +1540 -1669
- package/dist/index.esm.css +195 -0
- package/dist/index.esm.js +17049 -4280
- package/dist/index.esm.js.map +1 -1
- package/docs-build/0.d0c23b79.iframe.bundle.js +2 -0
- package/docs-build/0.d0c23b79.iframe.bundle.js.map +1 -0
- package/docs-build/0.fd1aa3ea21956d993519.manager.bundle.js +1 -0
- package/docs-build/1.34075652.iframe.bundle.js +10 -0
- package/docs-build/1.34075652.iframe.bundle.js.map +1 -0
- package/docs-build/16.ca488dae.iframe.bundle.js +2 -0
- package/docs-build/16.ca488dae.iframe.bundle.js.map +1 -0
- package/docs-build/17.e40eac7f.iframe.bundle.js +17 -0
- package/docs-build/17.e40eac7f.iframe.bundle.js.map +1 -0
- package/docs-build/18.62af0912.iframe.bundle.js +14 -0
- package/docs-build/18.62af0912.iframe.bundle.js.map +1 -0
- package/docs-build/19.0a217189.iframe.bundle.js +2 -0
- package/docs-build/19.0a217189.iframe.bundle.js.map +1 -0
- package/docs-build/2.f15ae19a.iframe.bundle.js +2 -0
- package/docs-build/2.f15ae19a.iframe.bundle.js.map +1 -0
- package/docs-build/20.4c43e27c.iframe.bundle.js +4 -0
- package/docs-build/20.4c43e27c.iframe.bundle.js.map +1 -0
- package/docs-build/21.19c21085.iframe.bundle.js +22 -0
- package/docs-build/21.19c21085.iframe.bundle.js.map +1 -0
- package/docs-build/3.5dd9e88b.iframe.bundle.js +2 -0
- package/docs-build/3.5dd9e88b.iframe.bundle.js.map +1 -0
- package/docs-build/4.f741dafe1833630ec8bf.manager.bundle.js +2 -0
- package/docs-build/4.f741dafe1833630ec8bf.manager.bundle.js.LICENSE.txt +8 -0
- package/docs-build/5.d4de191e7daeefb036ca.manager.bundle.js +1 -0
- package/docs-build/6.2b178c5444648ee5c0fa.manager.bundle.js +2 -0
- package/docs-build/6.2b178c5444648ee5c0fa.manager.bundle.js.LICENSE.txt +12 -0
- package/docs-build/7.7c16aea8ec7ea6e91994.manager.bundle.js +1 -0
- package/docs-build/8.52fa838fdf937b29676a.manager.bundle.js +1 -0
- package/docs-build/assets/dop.png +0 -0
- package/docs-build/assets/historic.png +0 -0
- package/docs-build/assets/marker.png +0 -0
- package/docs-build/assets/osm.png +0 -0
- package/docs-build/assets/sample.gpx +716 -0
- package/docs-build/{.gitkeep → catalogue/.gitkeep} +0 -0
- package/docs-build/catalogue/mc_meta.json +1 -0
- package/docs-build/favicon.ico +0 -0
- package/docs-build/iframe.html +348 -0
- package/docs-build/index.html +59 -0
- package/docs-build/logo.png +0 -0
- package/docs-build/main.8a7ec710ea1c16b5e13f.manager.bundle.js +1 -0
- package/docs-build/main~24120820.ba6665a8.iframe.bundle.js +2 -0
- package/docs-build/main~24120820.ba6665a8.iframe.bundle.js.map +1 -0
- package/docs-build/manifest.json +25 -0
- package/docs-build/robots.txt +3 -0
- package/docs-build/runtime~main.67aa1de2d72f40a81164.manager.bundle.js +1 -0
- package/docs-build/static/media/mapcomponents_logo.98b01a05.png +0 -0
- package/docs-build/static/media/wg-marker.bf3eeb2d.png +0 -0
- package/docs-build/stories.json +331 -0
- package/docs-build/thumbnails/MapLibreMap.png +0 -0
- package/docs-build/thumbnails/MlCameraFollowPath.png +0 -0
- package/docs-build/thumbnails/MlCreatePdfButton.png +0 -0
- package/docs-build/thumbnails/MlDeckGlLayer.png +0 -0
- package/docs-build/thumbnails/MlDeckGlTerrainLayer.png +0 -0
- package/docs-build/thumbnails/MlDemoDashboard.png +0 -0
- package/docs-build/thumbnails/MlFeatureEditor.png +0 -0
- package/docs-build/thumbnails/MlFillExtrusionLayer.png +0 -0
- package/docs-build/thumbnails/MlFollowGps.png +0 -0
- package/docs-build/thumbnails/MlGPXViewer.png +0 -0
- package/docs-build/thumbnails/MlGeoJsonLayer.png +0 -0
- package/docs-build/thumbnails/MlHillshadeLayer.png +0 -0
- package/docs-build/thumbnails/MlIconLayer.png +0 -0
- package/docs-build/thumbnails/MlLaermkarte.png +0 -0
- package/docs-build/thumbnails/MlLayerMagnify.png +0 -0
- package/docs-build/thumbnails/MlLayerSwipe.png +0 -0
- package/docs-build/thumbnails/MlMapDrawTools.png +0 -0
- package/docs-build/thumbnails/MlMobilerImker.png +0 -0
- package/docs-build/thumbnails/MlNavigationCompass.png +0 -0
- package/docs-build/thumbnails/MlNavigationTools.png +0 -0
- package/docs-build/thumbnails/MlOsmLayer.png +0 -0
- package/docs-build/thumbnails/MlScaleReference.png +0 -0
- package/docs-build/thumbnails/MlSpatialElevationProfile.png +0 -0
- package/docs-build/thumbnails/MlThreeJsLayer.png +0 -0
- package/docs-build/thumbnails/MlTransitionGeoJsonLayer.png +0 -0
- package/docs-build/thumbnails/MlVectorTileLayer.png +0 -0
- package/docs-build/thumbnails/MlWanderApp.png +0 -0
- package/docs-build/thumbnails/MlWmsLayer.png +0 -0
- package/docs-build/thumbnails/MlWmsLoader.png +0 -0
- package/docs-build/vendors~main.351900838c49e9200954.manager.bundle.js +2 -0
- package/docs-build/vendors~main.351900838c49e9200954.manager.bundle.js.LICENSE.txt +101 -0
- package/docs-build/vendors~main~0ad7406a.a6abfed7.iframe.bundle.js +8 -0
- package/docs-build/vendors~main~0ad7406a.a6abfed7.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~0f485567.1d7a15b7.iframe.bundle.js +2 -0
- package/docs-build/vendors~main~0f485567.1d7a15b7.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~41a6ab2c.525ecc56.iframe.bundle.js +2 -0
- package/docs-build/vendors~main~41a6ab2c.525ecc56.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~52589227.1d1558cd.iframe.bundle.js +8 -0
- package/docs-build/vendors~main~52589227.1d1558cd.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~73914085.227c6747.iframe.bundle.js +293 -0
- package/docs-build/vendors~main~73914085.227c6747.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~9c5b28f6.f02cc741.iframe.bundle.js +7 -0
- package/docs-build/vendors~main~9c5b28f6.f02cc741.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~b5906859.4083ac60.iframe.bundle.js +21 -0
- package/docs-build/vendors~main~b5906859.4083ac60.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~b8f44717.7a612c34.iframe.bundle.js +89 -0
- package/docs-build/vendors~main~b8f44717.7a612c34.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~b9cf3951.45da142d.iframe.bundle.js +68 -0
- package/docs-build/vendors~main~b9cf3951.45da142d.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~d939e436.92c27fbf.iframe.bundle.js +2 -0
- package/docs-build/vendors~main~d939e436.92c27fbf.iframe.bundle.js.map +1 -0
- package/docs-build/vendors~main~dab50aa4.b0d58038.iframe.bundle.js +107 -0
- package/docs-build/vendors~main~dab50aa4.b0d58038.iframe.bundle.js.map +1 -0
- package/package.json +132 -115
- package/public/favicon.ico +0 -0
- package/public/logo.png +0 -0
- package/rollup.config.js +26 -3
- package/scripts/start.js +166 -0
- package/scripts/test.js +53 -0
- package/src/components/MapLibreMap/MapLibreMap.stories.js +14 -5
- package/src/components/MapLibreMap/MapLibreMap.test.js +1 -1
- package/src/components/MapLibreMap/{MapLibreMap.js → MapLibreMap.tsx} +40 -37
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.test.js +3 -3
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +636 -0
- package/src/components/MlComponentTemplate/MlComponentTemplate.stories.js +0 -2
- package/src/components/MlComponentTemplate/MlComponentTemplate.tsx +42 -0
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.stories.js +0 -5
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx +51 -0
- package/src/components/MlCreatePdfButton/lib/{createPdf.js → createPdf.ts} +26 -23
- package/src/components/MlCreatePdfButton/lib/{nominatimMap.js → nominatimMap.ts} +3 -3
- package/src/components/MlFeatureEditor/MlFeatureEditor.tsx +139 -0
- package/src/components/MlFeatureEditor/custom-direct-select-mode.js +12 -8
- package/src/components/MlFeatureEditor/custom-polygon-mode.js +9 -5
- package/src/components/MlFeatureEditor/custom-select-mode.js +11 -7
- package/src/components/MlFeatureEditor/lib/LICENSE.md +18 -0
- package/src/components/MlFeatureEditor/lib/common_selectors.js +4 -0
- package/src/components/MlFeatureEditor/lib/constants.js +4 -0
- package/src/components/MlFeatureEditor/lib/constrain_feature_movement.js +4 -0
- package/src/components/MlFeatureEditor/lib/create_midpoint.js +4 -0
- package/src/components/MlFeatureEditor/lib/create_supplementary_points.js +4 -0
- package/src/components/MlFeatureEditor/lib/create_vertex.js +4 -0
- package/src/components/MlFeatureEditor/lib/double_click_zoom.js +4 -0
- package/src/components/MlFeatureEditor/lib/euclidean_distance.js +4 -0
- package/src/components/MlFeatureEditor/lib/features_at.js +4 -0
- package/src/components/MlFeatureEditor/lib/get_features_and_set_cursor.js +4 -0
- package/src/components/MlFeatureEditor/lib/is_click.js +4 -0
- package/src/components/MlFeatureEditor/lib/is_event_at_coordinates.js +4 -0
- package/src/components/MlFeatureEditor/lib/is_tap.js +4 -0
- package/src/components/MlFeatureEditor/lib/map_event_to_bounding_box.js +4 -0
- package/src/components/MlFeatureEditor/lib/mode_handler.js +4 -0
- package/src/components/MlFeatureEditor/lib/mouse_event_point.js +4 -0
- package/src/components/MlFeatureEditor/lib/move_features.js +4 -0
- package/src/components/MlFeatureEditor/lib/sort_features.js +4 -0
- package/src/components/MlFeatureEditor/lib/string_set.js +4 -0
- package/src/components/MlFeatureEditor/lib/string_sets_are_equal.js +4 -0
- package/src/components/MlFeatureEditor/lib/theme.js +4 -0
- package/src/components/MlFeatureEditor/lib/to_dense_array.js +4 -0
- package/src/components/MlFeatureEditor/lib/utils.js +4 -0
- package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.stories.js +6 -11
- package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx +85 -0
- package/src/components/MlFollowGps/MlFollowGps.stories.js +0 -2
- package/src/components/MlFollowGps/{MlFollowGps.js → MlFollowGps.tsx} +99 -86
- package/src/components/MlGPXViewer/{MlGPXViewer.js → MlGPXViewer.tsx} +68 -50
- package/src/components/MlGPXViewer/util/GeoJsonContext.ts +13 -0
- package/src/components/MlGPXViewer/util/{GeoJsonProvider.js → GeoJsonProvider.tsx} +3 -7
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.js +8 -3
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +106 -0
- package/src/components/MlGeoJsonLayer/util/{getDefaultLayerTypeByGeometry.js → getDefaultLayerTypeByGeometry.ts} +6 -1
- package/src/components/MlGeoJsonLayer/util/{getDefaultPaintPropsByType.js → getDefaultPaintPropsByType.ts} +1 -1
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.js +1 -4
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx +129 -0
- package/src/components/MlLayer/MlLayer.stories.js +0 -2
- package/src/components/MlLayer/MlLayer.tsx +48 -0
- package/src/components/MlLayerMagnify/MlLayerMagnify.stories.js +3 -3
- package/src/components/MlLayerMagnify/{MlLayerMagnify.js → MlLayerMagnify.tsx} +62 -43
- package/src/components/MlLayerSwipe/MlLayerSwipe.stories.js +0 -2
- package/src/components/MlLayerSwipe/{MlLayerSwipe.js → MlLayerSwipe.tsx} +38 -24
- package/src/components/MlLayerSwitcher/MlLayerSwitcher.js +0 -4
- package/src/components/MlMarker/MlMarker.tsx +140 -0
- package/src/components/MlNavigationCompass/{MlNavigationCompass.js → MlNavigationCompass.tsx} +27 -10
- package/src/components/MlNavigationTools/{MlNavigationTools.js → MlNavigationTools.tsx} +37 -32
- package/src/components/MlTransitionGeoJsonLayer/{MlTransitionGeoJsonLayer.js → MlTransitionGeoJsonLayer.tsx} +76 -73
- package/src/components/MlVectorTileLayer/{MlVectorTileLayer.js → MlVectorTileLayer.tsx} +23 -7
- package/src/components/MlWmsLayer/{MlWmsLayer.js → MlWmsLayer.tsx} +22 -7
- package/src/components/MlWmsLoader/{MlWmsLoader.js → MlWmsLoader.tsx} +55 -47
- package/src/custom.d.tsx +26 -0
- package/src/hooks/useLayer.ts +221 -0
- package/src/hooks/{useMap.js → useMap.ts} +48 -17
- package/src/hooks/{useMapState.js → useMapState.ts} +42 -7
- package/src/{index.js → index.ts} +15 -8
- package/tsconfig.json +18 -24
- package/.env +0 -1
- package/.storybook/main.bck.js +0 -56
- package/babel.config.json +0 -4
- package/coverage/lcov-report/src/translations/english.js.html +0 -94
- package/coverage/lcov-report/src/translations/german.js.html +0 -94
- package/coverage/lcov-report/src/translations/index.html +0 -131
- package/jest.config.json +0 -16
- package/jsdoc.json +0 -21
- package/public/assets/3D/posttower.gltf +0 -103
- package/public/assets/3D/posttower_simple.gltf +0 -103
- package/public/assets/3D/posttower_wh.gltf.glb +0 -0
- package/public/bee.png +0 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.js +0 -528
- package/src/components/MlComponentTemplate/MlComponentTemplate.js +0 -39
- package/src/components/MlCreatePdfButton/MlCreatePdfButton.js +0 -52
- package/src/components/MlFeatureEditor/MlFeatureEditor.js +0 -119
- package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.js +0 -153
- package/src/components/MlGPXViewer/util/GeoJsonContext.js +0 -6
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.js +0 -173
- package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.js +0 -75
- package/src/components/MlLayer/MlLayer.js +0 -107
- package/src/components/MlLayerMagnify/utils/compareMagnify.js +0 -173
- package/src/components/MlLayerSwipe/utils/swipeCompare.js +0 -220
- package/src/components/MlMarker/MlMarker.js +0 -156
- package/src/components/index.js +0 -6
- package/src/i18n.js +0 -28
- package/src/react-app-env.d.ts +0 -1
- package/src/stories/IntroductionCore.stories.mdx +0 -3
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/src/stories/components/ComponentTeaser.js +0 -64
- package/src/translations/english.js +0 -4
- package/src/translations/german.js +0 -4
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import useMap from "../../hooks/useMap";
|
|
3
|
+
|
|
4
|
+
import createPdf from "./lib/createPdf";
|
|
5
|
+
|
|
6
|
+
import PrinterIcon from "@mui/icons-material/Print";
|
|
7
|
+
import Button from "@mui/material/Button";
|
|
8
|
+
|
|
9
|
+
interface MlCreatePdfButtonProps {
|
|
10
|
+
/**
|
|
11
|
+
* Id of the target MapLibre instance in mapContext
|
|
12
|
+
*/
|
|
13
|
+
mapId?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Id of an existing layer in the mapLibre instance to help specify the layer order
|
|
16
|
+
* This layer will be visually beneath the layer with the "insertBeforeLayer" id.
|
|
17
|
+
*/
|
|
18
|
+
insertBeforeLayer?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Renders a button that will create a PDF version of the current map view (dimensions adjusted to fit Din A4 Paper).
|
|
23
|
+
*/
|
|
24
|
+
const MlCreatePdfButton = (props: MlCreatePdfButtonProps) => {
|
|
25
|
+
const mapHook = useMap({
|
|
26
|
+
mapId: props.mapId,
|
|
27
|
+
waitForLayer: props.insertBeforeLayer,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<>
|
|
32
|
+
<Button
|
|
33
|
+
color="primary"
|
|
34
|
+
variant="contained"
|
|
35
|
+
onClick={() => {
|
|
36
|
+
if (mapHook.map) {
|
|
37
|
+
createPdf(mapHook.map, null, () => {});
|
|
38
|
+
}
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
<PrinterIcon />
|
|
42
|
+
</Button>
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
MlCreatePdfButton.defaultProps = {
|
|
48
|
+
mapId: undefined,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default MlCreatePdfButton;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {Map} from "maplibre-gl";
|
|
2
2
|
import jsPDF from "jspdf";
|
|
3
|
-
import nmConverter from "./nominatimMap
|
|
3
|
+
import nmConverter from "./nominatimMap";
|
|
4
|
+
import MapLibreGlWrapper from '../../MapLibreMap/lib/MapLibreGlWrapper'
|
|
4
5
|
|
|
5
|
-
const toPixels = (length) => {
|
|
6
|
+
const toPixels = (length:number):string => {
|
|
6
7
|
let conversionFactor = 96;
|
|
7
8
|
|
|
8
9
|
conversionFactor /= 25.4;
|
|
@@ -10,7 +11,7 @@ const toPixels = (length) => {
|
|
|
10
11
|
return conversionFactor * length + "px";
|
|
11
12
|
};
|
|
12
13
|
|
|
13
|
-
const createPdf = (map, locationValue, setLoading) => {
|
|
14
|
+
const createPdf:Function = (map:MapLibreGlWrapper, locationValue:any, setLoading:any) => {
|
|
14
15
|
setLoading(true);
|
|
15
16
|
|
|
16
17
|
const width = 210;
|
|
@@ -27,19 +28,7 @@ const createPdf = (map, locationValue, setLoading) => {
|
|
|
27
28
|
container.style.height = toPixels(height);
|
|
28
29
|
hidden.appendChild(container);
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
var renderMap = new maplibregl.Map({
|
|
32
|
-
container: container,
|
|
33
|
-
center: map.getCenter(),
|
|
34
|
-
zoom: map.getZoom(),
|
|
35
|
-
bearing: map.getBearing(),
|
|
36
|
-
pitch: map.getPitch(),
|
|
37
|
-
interactive: false,
|
|
38
|
-
preserveDrawingBuffer: true,
|
|
39
|
-
fadeDuration: 0,
|
|
40
|
-
attributionControl: false,
|
|
41
|
-
});
|
|
42
|
-
let style = map.getStyle();
|
|
31
|
+
let style = map.map.getStyle();
|
|
43
32
|
for (let name in style.sources) {
|
|
44
33
|
let src = style.sources[name];
|
|
45
34
|
|
|
@@ -51,7 +40,19 @@ const createPdf = (map, locationValue, setLoading) => {
|
|
|
51
40
|
}
|
|
52
41
|
});
|
|
53
42
|
}
|
|
54
|
-
|
|
43
|
+
//Render map
|
|
44
|
+
var renderMap = new Map({
|
|
45
|
+
container: container,
|
|
46
|
+
center: map.map.getCenter(),
|
|
47
|
+
zoom: map.map.getZoom(),
|
|
48
|
+
bearing: map.map.getBearing(),
|
|
49
|
+
pitch: map.map.getPitch(),
|
|
50
|
+
interactive: false,
|
|
51
|
+
preserveDrawingBuffer: true,
|
|
52
|
+
fadeDuration: 0,
|
|
53
|
+
attributionControl: false,
|
|
54
|
+
style: style
|
|
55
|
+
});
|
|
55
56
|
|
|
56
57
|
renderMap.once("idle", function () {
|
|
57
58
|
// TO DO: It is still under development
|
|
@@ -76,12 +77,14 @@ const createPdf = (map, locationValue, setLoading) => {
|
|
|
76
77
|
const lineHeight = 3.25;
|
|
77
78
|
const text = locationValue ? nmConverter(locationValue.address) : "";
|
|
78
79
|
const textChunksSeperator = text.split(",");
|
|
79
|
-
const textChunks = [];
|
|
80
|
+
const textChunks:string[] = [];
|
|
80
81
|
|
|
81
82
|
if (textChunks.length) {
|
|
82
|
-
textChunksSeperator.forEach((chunk) => {
|
|
83
|
-
const limitChunks = chunk.match(/.{1,34}/g);
|
|
83
|
+
textChunksSeperator.forEach((chunk:string) => {
|
|
84
|
+
const limitChunks:(RegExpMatchArray | null) = chunk.match(/.{1,34}/g);
|
|
85
|
+
if(limitChunks){
|
|
84
86
|
textChunks.push(...limitChunks);
|
|
87
|
+
}
|
|
85
88
|
});
|
|
86
89
|
}
|
|
87
90
|
|
|
@@ -93,7 +96,7 @@ const createPdf = (map, locationValue, setLoading) => {
|
|
|
93
96
|
0,
|
|
94
97
|
210,
|
|
95
98
|
297,
|
|
96
|
-
|
|
99
|
+
undefined,
|
|
97
100
|
"FAST"
|
|
98
101
|
);
|
|
99
102
|
|
|
@@ -144,7 +147,7 @@ const createPdf = (map, locationValue, setLoading) => {
|
|
|
144
147
|
offsetY + marginTop + lineHeight * 2 + textChunks.length * 3 + innerMargin * 2,
|
|
145
148
|
3,
|
|
146
149
|
3,
|
|
147
|
-
|
|
150
|
+
undefined,
|
|
148
151
|
"FAST"
|
|
149
152
|
);
|
|
150
153
|
|
|
@@ -41,10 +41,10 @@ const nmMap = {
|
|
|
41
41
|
state: ["state", "province", "state_code"],
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
const nmConverter = (nmAddress) => {
|
|
45
|
-
const addressArr = [];
|
|
44
|
+
const nmConverter:Function = (nmAddress:any):string => {
|
|
45
|
+
const addressArr:string[] = [];
|
|
46
46
|
for (let key in nmMap) {
|
|
47
|
-
nmMap[key].some((element) => {
|
|
47
|
+
nmMap[key].some((element:string) => {
|
|
48
48
|
if (nmAddress.hasOwnProperty(element)) {
|
|
49
49
|
addressArr.push(nmAddress[element]);
|
|
50
50
|
return true;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef } from "react";
|
|
2
|
+
import "./MlFeatureEditor.css";
|
|
3
|
+
|
|
4
|
+
import "@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css";
|
|
5
|
+
import MapboxDraw from "@mapbox/mapbox-gl-draw";
|
|
6
|
+
import CustomPolygonMode from "./custom-polygon-mode.js";
|
|
7
|
+
import CustomSelectMode from "./custom-select-mode.js";
|
|
8
|
+
import CustomDirectSelectMode from "./custom-direct-select-mode.js";
|
|
9
|
+
|
|
10
|
+
import useMap from "../../hooks/useMap";
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
interface MlFeatureEditorProps {
|
|
14
|
+
/**
|
|
15
|
+
* Id of the target MapLibre instance in mapContext
|
|
16
|
+
*/
|
|
17
|
+
mapId: string;
|
|
18
|
+
/**
|
|
19
|
+
* Id of an existing layer in the mapLibre instance to help specify the layer order
|
|
20
|
+
* This layer will be visually beneath the layer with the "insertBeforeLayer" id.
|
|
21
|
+
*/
|
|
22
|
+
insertBeforeLayer: string;
|
|
23
|
+
/**
|
|
24
|
+
* Input GeoJson data at initialization
|
|
25
|
+
*/
|
|
26
|
+
geojson: any;
|
|
27
|
+
/**
|
|
28
|
+
* Callback function that is called each time the GeoJson data within has changed within MlFeatureEditor.
|
|
29
|
+
* First parameter is the new GeoJson feature.
|
|
30
|
+
*/
|
|
31
|
+
onChange?: Function
|
|
32
|
+
/**
|
|
33
|
+
* Feature editor mode:
|
|
34
|
+
* - "custom_select" edit features
|
|
35
|
+
* - "custom_polygon" draw Polygon
|
|
36
|
+
* - "draw_point" draw Point
|
|
37
|
+
* - "draw_line_string" draw LineString
|
|
38
|
+
*/
|
|
39
|
+
mode?:string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* GeoJson Feature editor that allows to create or manipulate GeoJson data
|
|
44
|
+
*/
|
|
45
|
+
const MlFeatureEditor = (props:MlFeatureEditorProps) => {
|
|
46
|
+
const draw = useRef<MapboxDraw>();
|
|
47
|
+
const mapHook = useMap({
|
|
48
|
+
mapId: props.mapId,
|
|
49
|
+
waitForLayer: props.insertBeforeLayer,
|
|
50
|
+
});
|
|
51
|
+
const onChangeRef = useRef(props.onChange);
|
|
52
|
+
|
|
53
|
+
const drawToolsInitialized = useRef(false);
|
|
54
|
+
const [drawToolsReady, setDrawToolsReady] = useState(false);
|
|
55
|
+
|
|
56
|
+
const [mouseUpTrigger, setMouseUpTrigger] = useState(0);
|
|
57
|
+
|
|
58
|
+
const modeChangeHandler = (e:any) => {
|
|
59
|
+
console.log("MlFeatureEditor mode change to " + e.mode);
|
|
60
|
+
//setDrawMode(e.mode);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const mouseUpHandler = () => {
|
|
64
|
+
setMouseUpTrigger(Math.random());
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (
|
|
69
|
+
mapHook.map &&
|
|
70
|
+
!drawToolsInitialized.current
|
|
71
|
+
) {
|
|
72
|
+
|
|
73
|
+
drawToolsInitialized.current = true;
|
|
74
|
+
|
|
75
|
+
if (
|
|
76
|
+
mapHook.map.map.style &&
|
|
77
|
+
mapHook.map.map.getSource("mapbox-gl-draw-cold") &&
|
|
78
|
+
draw.current
|
|
79
|
+
) {
|
|
80
|
+
// remove old Mapbox-gl-Draw from Mapbox instance when hot-reloading this component during development
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
draw.current?.remove();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
draw.current = new MapboxDraw({
|
|
86
|
+
displayControlsDefault: false,
|
|
87
|
+
defaultMode: props.mode || "custom_select",
|
|
88
|
+
// @ts-ignore
|
|
89
|
+
modes: Object.assign(
|
|
90
|
+
{
|
|
91
|
+
custom_polygon: CustomPolygonMode,
|
|
92
|
+
custom_select: CustomSelectMode,
|
|
93
|
+
custom_direct_select: CustomDirectSelectMode,
|
|
94
|
+
},
|
|
95
|
+
MapboxDraw.modes
|
|
96
|
+
),
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
mapHook.map.on("draw.modechange", modeChangeHandler, mapHook.componentId);
|
|
100
|
+
|
|
101
|
+
mapHook.map.addControl(draw.current, "top-left", mapHook.componentId);
|
|
102
|
+
|
|
103
|
+
mapHook.map.on("mouseup", mouseUpHandler, mapHook.componentId);
|
|
104
|
+
|
|
105
|
+
setDrawToolsReady(true);
|
|
106
|
+
}
|
|
107
|
+
}, [mapHook.map, props, drawToolsInitialized]);
|
|
108
|
+
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (
|
|
111
|
+
draw.current &&
|
|
112
|
+
props.geojson?.geometry
|
|
113
|
+
) {
|
|
114
|
+
// @ts-ignore
|
|
115
|
+
draw.current.set({ type: "FeatureCollection", features: [props.geojson] });
|
|
116
|
+
}
|
|
117
|
+
}, [props.geojson, drawToolsReady]);
|
|
118
|
+
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
if (draw.current && mouseUpTrigger) {
|
|
121
|
+
// update drawnFeatures state object
|
|
122
|
+
let currentFeatureCollection = draw.current.getAll();
|
|
123
|
+
if (typeof onChangeRef.current === "function") {
|
|
124
|
+
onChangeRef.current(currentFeatureCollection.features);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}, [mouseUpTrigger]);
|
|
128
|
+
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
if (props.mode && draw.current) {
|
|
131
|
+
// @ts-ignore
|
|
132
|
+
draw.current.changeMode(props.mode);
|
|
133
|
+
}
|
|
134
|
+
}, [props.mode]);
|
|
135
|
+
|
|
136
|
+
return (<></>);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export default MlFeatureEditor;
|
|
@@ -1,23 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code from https://github.com/mapbox/mapbox-gl-draw
|
|
3
|
+
* and licensed under ISC
|
|
4
|
+
*/
|
|
1
5
|
import {
|
|
2
6
|
noTarget,
|
|
3
7
|
isOfMetaType,
|
|
4
8
|
isActiveFeature,
|
|
5
9
|
isInactiveFeature,
|
|
6
10
|
isShiftDown,
|
|
7
|
-
} from "./lib/common_selectors";
|
|
8
|
-
import createSupplementaryPoints from "./lib/create_supplementary_points";
|
|
9
|
-
import constrainFeatureMovement from "./lib/constrain_feature_movement";
|
|
10
|
-
import doubleClickZoom from "./lib/double_click_zoom";
|
|
11
|
-
import * as Constants from "./lib/constants";
|
|
12
|
-
import moveFeatures from "./lib/move_features";
|
|
13
|
-
import drawUtils from "./lib/utils";
|
|
11
|
+
} from "./lib/common_selectors.js";
|
|
12
|
+
import createSupplementaryPoints from "./lib/create_supplementary_points.js";
|
|
13
|
+
import constrainFeatureMovement from "./lib/constrain_feature_movement.js";
|
|
14
|
+
import doubleClickZoom from "./lib/double_click_zoom.js";
|
|
15
|
+
import * as Constants from "./lib/constants.js";
|
|
16
|
+
import moveFeatures from "./lib/move_features.js";
|
|
17
|
+
import drawUtils from "./lib/utils.js";
|
|
14
18
|
|
|
15
19
|
const isVertex = isOfMetaType(Constants.meta.VERTEX);
|
|
16
20
|
const isMidpoint = isOfMetaType(Constants.meta.MIDPOINT);
|
|
17
21
|
|
|
18
22
|
const DirectSelect = {};
|
|
19
23
|
|
|
20
|
-
// INTERNAL
|
|
24
|
+
// INTERNAL FUNCTIONS
|
|
21
25
|
|
|
22
26
|
DirectSelect.fireUpdate = function () {
|
|
23
27
|
this.map.fire(Constants.events.UPDATE, {
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
1
|
+
/**
|
|
2
|
+
* Code from https://github.com/mapbox/mapbox-gl-draw
|
|
3
|
+
* and licensed under ISC
|
|
4
|
+
*/
|
|
5
|
+
import * as CommonSelectors from "./lib/common_selectors.js";
|
|
6
|
+
import doubleClickZoom from "./lib/double_click_zoom.js";
|
|
7
|
+
import * as Constants from "./lib/constants.js";
|
|
8
|
+
import isEventAtCoordinates from "./lib/is_event_at_coordinates.js";
|
|
9
|
+
import createVertex from "./lib/create_vertex.js";
|
|
6
10
|
|
|
7
11
|
const CustomPolygonMode = {};
|
|
8
12
|
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
/**
|
|
2
|
+
* Code from https://github.com/mapbox/mapbox-gl-draw
|
|
3
|
+
* and licensed under ISC
|
|
4
|
+
*/
|
|
5
|
+
import * as CommonSelectors from "./lib/common_selectors.js";
|
|
6
|
+
import doubleClickZoom from "./lib/double_click_zoom.js";
|
|
7
|
+
import * as Constants from "./lib/constants.js";
|
|
8
|
+
import mouseEventPoint from "./lib/mouse_event_point.js";
|
|
9
|
+
import createSupplementaryPoints from "./lib/create_supplementary_points.js";
|
|
10
|
+
import StringSet from "./lib/string_set.js";
|
|
11
|
+
import moveFeatures from "./lib/move_features.js";
|
|
8
12
|
|
|
9
13
|
const CustomSelectMode = {};
|
|
10
14
|
CustomSelectMode.onSetup = function (opts) {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
All code inside of this folder is from https://github.com/mapbox/mapbox-gl-draw
|
|
2
|
+
and licensed under ISC
|
|
3
|
+
|
|
4
|
+
Copyright (c) Mapbox
|
|
5
|
+
|
|
6
|
+
All rights reserved.
|
|
7
|
+
|
|
8
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
9
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
10
|
+
copyright notice and this permission notice appear in all copies.
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
13
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
14
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
15
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
16
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
|
17
|
+
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
18
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, {useState} from "react";
|
|
2
2
|
|
|
3
|
-
import TopToolbar from "../../ui_components/TopToolbar";
|
|
4
3
|
import MlFillExtrusionLayer from "./MlFillExtrusionLayer";
|
|
5
4
|
|
|
6
5
|
import mapContextDecorator from "../../decorators/MapContextDecorator";
|
|
@@ -9,21 +8,17 @@ const storyoptions = {
|
|
|
9
8
|
title: "MapComponents/MlFillExtrusionLayer",
|
|
10
9
|
component: MlFillExtrusionLayer,
|
|
11
10
|
argTypes: {
|
|
12
|
-
options: {
|
|
13
|
-
control: {
|
|
14
|
-
type: "object",
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
11
|
},
|
|
18
12
|
decorators: mapContextDecorator,
|
|
19
13
|
};
|
|
20
14
|
export default storyoptions;
|
|
21
15
|
|
|
22
|
-
const Template = (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
const Template = (props) => {
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<MlFillExtrusionLayer {...props} />
|
|
26
20
|
);
|
|
21
|
+
}
|
|
27
22
|
|
|
28
23
|
export const ExampleConfig = Template.bind({});
|
|
29
24
|
ExampleConfig.parameters = {};
|