@mapcomponents/react-maplibre 0.1.34 → 0.1.37
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 +16 -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 +42894 -4862
- 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 +131 -113
- 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
package/coverage/lcov-report/src/components/MapLibreMap/{MapLibreMap.js.html → MapLibreMap.tsx.html}
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<html lang="en">
|
|
4
4
|
|
|
5
5
|
<head>
|
|
6
|
-
<title>Code coverage report for src/components/MapLibreMap/MapLibreMap.
|
|
6
|
+
<title>Code coverage report for src/components/MapLibreMap/MapLibreMap.tsx</title>
|
|
7
7
|
<meta charset="utf-8" />
|
|
8
8
|
<link rel="stylesheet" href="../../../prettify.css" />
|
|
9
9
|
<link rel="stylesheet" href="../../../base.css" />
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
<body>
|
|
20
20
|
<div class='wrapper'>
|
|
21
21
|
<div class='pad1'>
|
|
22
|
-
<h1><a href="../../../index.html">All files</a> / <a href="index.html">src/components/MapLibreMap</a> MapLibreMap.
|
|
22
|
+
<h1><a href="../../../index.html">All files</a> / <a href="index.html">src/components/MapLibreMap</a> MapLibreMap.tsx</h1>
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">100% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>22/22</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">100% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>22/22</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -153,7 +153,10 @@
|
|
|
153
153
|
<a name='L88'></a><a href='#L88'>88</a>
|
|
154
154
|
<a name='L89'></a><a href='#L89'>89</a>
|
|
155
155
|
<a name='L90'></a><a href='#L90'>90</a>
|
|
156
|
-
<a name='L91'></a><a href='#L91'>91</a
|
|
156
|
+
<a name='L91'></a><a href='#L91'>91</a>
|
|
157
|
+
<a name='L92'></a><a href='#L92'>92</a>
|
|
158
|
+
<a name='L93'></a><a href='#L93'>93</a>
|
|
159
|
+
<a name='L94'></a><a href='#L94'>94</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
157
160
|
<span class="cline-any cline-neutral"> </span>
|
|
158
161
|
<span class="cline-any cline-neutral"> </span>
|
|
159
162
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -170,67 +173,66 @@
|
|
|
170
173
|
<span class="cline-any cline-neutral"> </span>
|
|
171
174
|
<span class="cline-any cline-neutral"> </span>
|
|
172
175
|
<span class="cline-any cline-neutral"> </span>
|
|
173
|
-
<span class="cline-any cline-yes">18x</span>
|
|
174
|
-
<span class="cline-any cline-yes">247x</span>
|
|
175
|
-
<span class="cline-any cline-yes">247x</span>
|
|
176
176
|
<span class="cline-any cline-neutral"> </span>
|
|
177
|
-
<span class="cline-any cline-yes">247x</span>
|
|
178
|
-
<span class="cline-any cline-yes">247x</span>
|
|
179
177
|
<span class="cline-any cline-neutral"> </span>
|
|
180
|
-
<span class="cline-any cline-yes">247x</span>
|
|
181
|
-
<span class="cline-any cline-yes">247x</span>
|
|
182
178
|
<span class="cline-any cline-neutral"> </span>
|
|
183
|
-
<span class="cline-any cline-yes">247x</span>
|
|
184
|
-
<span class="cline-any cline-yes">73x</span>
|
|
185
|
-
<span class="cline-any cline-yes">73x</span>
|
|
186
179
|
<span class="cline-any cline-neutral"> </span>
|
|
187
|
-
<span class="cline-any cline-yes">73x</span>
|
|
188
|
-
<span class="cline-any cline-yes">2x</span>
|
|
189
|
-
<span class="cline-any cline-yes">2x</span>
|
|
190
|
-
<span class="cline-any cline-yes">2x</span>
|
|
191
180
|
<span class="cline-any cline-neutral"> </span>
|
|
192
181
|
<span class="cline-any cline-neutral"> </span>
|
|
193
182
|
<span class="cline-any cline-neutral"> </span>
|
|
194
|
-
<span class="cline-any cline-yes">247x</span>
|
|
195
|
-
<span class="cline-any cline-yes">73x</span>
|
|
196
|
-
<span class="cline-any cline-yes">73x</span>
|
|
197
183
|
<span class="cline-any cline-neutral"> </span>
|
|
198
184
|
<span class="cline-any cline-neutral"> </span>
|
|
185
|
+
<span class="cline-any cline-yes">18x</span>
|
|
186
|
+
<span class="cline-any cline-neutral"> </span>
|
|
199
187
|
<span class="cline-any cline-neutral"> </span>
|
|
200
188
|
<span class="cline-any cline-neutral"> </span>
|
|
201
189
|
<span class="cline-any cline-neutral"> </span>
|
|
202
|
-
<span class="cline-any cline-yes">73x</span>
|
|
203
|
-
<span class="cline-any cline-yes">73x</span>
|
|
204
|
-
<span class="cline-any cline-yes">6x</span>
|
|
205
190
|
<span class="cline-any cline-neutral"> </span>
|
|
206
|
-
<span class="cline-any cline-yes">67x</span>
|
|
207
191
|
<span class="cline-any cline-neutral"> </span>
|
|
208
192
|
<span class="cline-any cline-neutral"> </span>
|
|
209
193
|
<span class="cline-any cline-neutral"> </span>
|
|
210
194
|
<span class="cline-any cline-neutral"> </span>
|
|
211
|
-
<span class="cline-any cline-yes">73x</span>
|
|
212
195
|
<span class="cline-any cline-neutral"> </span>
|
|
213
196
|
<span class="cline-any cline-neutral"> </span>
|
|
214
197
|
<span class="cline-any cline-neutral"> </span>
|
|
215
198
|
<span class="cline-any cline-neutral"> </span>
|
|
216
199
|
<span class="cline-any cline-neutral"> </span>
|
|
217
200
|
<span class="cline-any cline-neutral"> </span>
|
|
218
|
-
<span class="cline-any cline-yes">247x</span>
|
|
219
201
|
<span class="cline-any cline-neutral"> </span>
|
|
220
202
|
<span class="cline-any cline-neutral"> </span>
|
|
221
203
|
<span class="cline-any cline-yes">18x</span>
|
|
204
|
+
<span class="cline-any cline-yes">247x</span>
|
|
205
|
+
<span class="cline-any cline-yes">247x</span>
|
|
222
206
|
<span class="cline-any cline-neutral"> </span>
|
|
207
|
+
<span class="cline-any cline-yes">247x</span>
|
|
223
208
|
<span class="cline-any cline-neutral"> </span>
|
|
209
|
+
<span class="cline-any cline-yes">247x</span>
|
|
210
|
+
<span class="cline-any cline-yes">247x</span>
|
|
224
211
|
<span class="cline-any cline-neutral"> </span>
|
|
212
|
+
<span class="cline-any cline-yes">247x</span>
|
|
213
|
+
<span class="cline-any cline-yes">73x</span>
|
|
214
|
+
<span class="cline-any cline-neutral"> </span>
|
|
215
|
+
<span class="cline-any cline-yes">73x</span>
|
|
216
|
+
<span class="cline-any cline-yes">2x</span>
|
|
217
|
+
<span class="cline-any cline-yes">2x</span>
|
|
218
|
+
<span class="cline-any cline-yes">2x</span>
|
|
225
219
|
<span class="cline-any cline-neutral"> </span>
|
|
226
220
|
<span class="cline-any cline-neutral"> </span>
|
|
227
221
|
<span class="cline-any cline-neutral"> </span>
|
|
222
|
+
<span class="cline-any cline-yes">247x</span>
|
|
223
|
+
<span class="cline-any cline-yes">73x</span>
|
|
224
|
+
<span class="cline-any cline-yes">73x</span>
|
|
225
|
+
<span class="cline-any cline-neutral"> </span>
|
|
228
226
|
<span class="cline-any cline-neutral"> </span>
|
|
229
227
|
<span class="cline-any cline-neutral"> </span>
|
|
230
228
|
<span class="cline-any cline-neutral"> </span>
|
|
231
229
|
<span class="cline-any cline-neutral"> </span>
|
|
232
|
-
<span class="cline-any cline-yes">18x</span>
|
|
233
230
|
<span class="cline-any cline-neutral"> </span>
|
|
231
|
+
<span class="cline-any cline-yes">73x</span>
|
|
232
|
+
<span class="cline-any cline-yes">73x</span>
|
|
233
|
+
<span class="cline-any cline-yes">6x</span>
|
|
234
|
+
<span class="cline-any cline-neutral"> </span>
|
|
235
|
+
<span class="cline-any cline-yes">67x</span>
|
|
234
236
|
<span class="cline-any cline-neutral"> </span>
|
|
235
237
|
<span class="cline-any cline-neutral"> </span>
|
|
236
238
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -239,17 +241,48 @@
|
|
|
239
241
|
<span class="cline-any cline-neutral"> </span>
|
|
240
242
|
<span class="cline-any cline-neutral"> </span>
|
|
241
243
|
<span class="cline-any cline-neutral"> </span>
|
|
244
|
+
<span class="cline-any cline-yes">247x</span>
|
|
242
245
|
<span class="cline-any cline-neutral"> </span>
|
|
243
246
|
<span class="cline-any cline-neutral"> </span>
|
|
244
247
|
<span class="cline-any cline-neutral"> </span>
|
|
245
248
|
<span class="cline-any cline-neutral"> </span>
|
|
246
|
-
<span class="cline-any cline-
|
|
247
|
-
|
|
249
|
+
<span class="cline-any cline-yes">18x</span>
|
|
250
|
+
<span class="cline-any cline-neutral"> </span>
|
|
251
|
+
<span class="cline-any cline-neutral"> </span>
|
|
252
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, { useRef, useEffect, useContext, FC } from "react";
|
|
253
|
+
|
|
254
|
+
// @ts-ignore
|
|
248
255
|
import { MapContext } from "@mapcomponents/react-core";
|
|
256
|
+
// @ts-ignore
|
|
249
257
|
import MapLibreGlWrapper from "./lib/MapLibreGlWrapper";
|
|
250
258
|
|
|
251
259
|
import "maplibre-gl/dist/maplibre-gl.css";
|
|
252
260
|
|
|
261
|
+
type MapLibreMapProps = {
|
|
262
|
+
/**
|
|
263
|
+
* Id of the MapLibreGl(Wrapper) instance in mapContext
|
|
264
|
+
*/
|
|
265
|
+
mapId?: string;
|
|
266
|
+
/**
|
|
267
|
+
* Config object that is passed to the MapLibreGl constructor as first parameter.
|
|
268
|
+
* See https://maplibre.org/maplibre-gl-js-docs/api/map/ for a formal documentation of al
|
|
269
|
+
* available properties.
|
|
270
|
+
*/
|
|
271
|
+
options?: object;
|
|
272
|
+
/**
|
|
273
|
+
* css style definition passed to the map container DOM element
|
|
274
|
+
*/
|
|
275
|
+
style?: object;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
const defaultProps: MapLibreMapProps = {
|
|
279
|
+
mapId: undefined,
|
|
280
|
+
options: {
|
|
281
|
+
center: { lng: 8.607, lat: 53.1409349 },
|
|
282
|
+
zoom: 11,
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
|
|
253
286
|
/**
|
|
254
287
|
* Creates a MapLibreGlWrapper instance and registers it in MapContext
|
|
255
288
|
* after the MapLibre-gl load event has fired.
|
|
@@ -258,37 +291,36 @@ import "maplibre-gl/dist/maplibre-gl.css";
|
|
|
258
291
|
* This Component must be kept unaware of any related components that interact with the MapLibre-gl
|
|
259
292
|
* instance.
|
|
260
293
|
*
|
|
261
|
-
* @
|
|
294
|
+
* @category Map components
|
|
262
295
|
*/
|
|
263
|
-
const MapLibreMap = (props) => {
|
|
264
|
-
const map = useRef(null);
|
|
296
|
+
const MapLibreMap: FC<MapLibreMapProps> = (props: MapLibreMapProps) => {
|
|
297
|
+
const map: any = useRef(null);
|
|
265
298
|
const mapContainer = useRef(null);
|
|
266
299
|
|
|
267
|
-
const mapContext = useContext(MapContext);
|
|
268
|
-
const mapContextRef = useRef(mapContext);
|
|
300
|
+
const mapContext: any = useContext(MapContext);
|
|
269
301
|
|
|
270
302
|
const mapIdRef = useRef(props.mapId);
|
|
271
303
|
const mapOptions = props.options;
|
|
272
304
|
|
|
273
305
|
useEffect(() => {
|
|
274
306
|
let mapId = mapIdRef.current;
|
|
275
|
-
let _mapContext = mapContextRef.current;
|
|
276
307
|
|
|
277
308
|
return () => {
|
|
278
|
-
|
|
309
|
+
mapContext.removeMap(mapId);
|
|
279
310
|
map.current?.remove?.();
|
|
280
311
|
map.current = null;
|
|
281
312
|
};
|
|
282
313
|
}, []);
|
|
283
314
|
|
|
284
315
|
useEffect(() => {
|
|
285
|
-
if (mapContainer.current) {
|
|
316
|
+
<span class="missing-if-branch" title="else path not taken" >E</span>if (mapContainer.current) {
|
|
286
317
|
map.current = new MapLibreGlWrapper({
|
|
318
|
+
// @ts-ignore
|
|
287
319
|
mapOptions: {
|
|
288
320
|
container: mapContainer.current,
|
|
289
321
|
...mapOptions,
|
|
290
322
|
},
|
|
291
|
-
onReady: (map, wrapper) => {
|
|
323
|
+
onReady: (map: any, wrapper: any) => {
|
|
292
324
|
map.once("load", () => {
|
|
293
325
|
if (props.mapId) {
|
|
294
326
|
mapContext.registerMap(props.mapId, wrapper);
|
|
@@ -296,41 +328,18 @@ const MapLibreMap = (props) => {
|
|
|
296
328
|
mapContext.setMap(wrapper);
|
|
297
329
|
}
|
|
298
330
|
});
|
|
299
|
-
|
|
300
|
-
// TODO: remove this line
|
|
301
|
-
window.map = wrapper;
|
|
302
331
|
},
|
|
303
332
|
});
|
|
304
333
|
}
|
|
305
334
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
306
335
|
}, [mapContainer]);
|
|
307
336
|
|
|
308
|
-
return
|
|
337
|
+
return (
|
|
338
|
+
<div ref={mapContainer} className="mapContainer" style={props.style} />
|
|
339
|
+
);
|
|
309
340
|
};
|
|
310
341
|
|
|
311
|
-
MapLibreMap.defaultProps =
|
|
312
|
-
mapId: undefined,
|
|
313
|
-
options: {
|
|
314
|
-
lng: 8.607,
|
|
315
|
-
lat: 53.1409349,
|
|
316
|
-
zoom: 10,
|
|
317
|
-
accessToken:
|
|
318
|
-
"pk.eyJ1IjoibWF4dG9iaSIsImEiOiJjaW1rcWQ5bWMwMDJvd2hrbWZ2ZTBhcnM5In0.NcGt5NmLP5Q1WC7P5u6qUA",
|
|
319
|
-
},
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
MapLibreMap.propTypes = {
|
|
323
|
-
/**
|
|
324
|
-
* Id of the MapLibreGl(Wrapper) instance in mapContext
|
|
325
|
-
*/
|
|
326
|
-
mapId: PropTypes.string,
|
|
327
|
-
/**
|
|
328
|
-
* Config object that is passed to the MapLibreGl constructor as first parameter.
|
|
329
|
-
* See https://maplibre.org/maplibre-gl-js-docs/api/map/ for a formal documentation of al
|
|
330
|
-
* available properties.
|
|
331
|
-
*/
|
|
332
|
-
options: PropTypes.object,
|
|
333
|
-
};
|
|
342
|
+
MapLibreMap.defaultProps = defaultProps;
|
|
334
343
|
|
|
335
344
|
export default MapLibreMap;
|
|
336
345
|
</pre></td></tr></table></pre>
|
|
@@ -340,7 +349,7 @@ export default MapLibreMap;
|
|
|
340
349
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
341
350
|
Code coverage generated by
|
|
342
351
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
343
|
-
at
|
|
352
|
+
at Wed Apr 20 2022 08:49:29 GMT+0000 (Coordinated Universal Time)
|
|
344
353
|
</div>
|
|
345
354
|
<script src="../../../prettify.js"></script>
|
|
346
355
|
<script>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">100% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>22/22</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">100% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>22/22</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -79,18 +79,18 @@
|
|
|
79
79
|
</tr>
|
|
80
80
|
</thead>
|
|
81
81
|
<tbody><tr>
|
|
82
|
-
<td class="file high" data-value="MapLibreMap.
|
|
82
|
+
<td class="file high" data-value="MapLibreMap.tsx"><a href="MapLibreMap.tsx.html">MapLibreMap.tsx</a></td>
|
|
83
83
|
<td data-value="100" class="pic high">
|
|
84
84
|
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
85
85
|
</td>
|
|
86
86
|
<td data-value="100" class="pct high">100%</td>
|
|
87
|
-
<td data-value="
|
|
87
|
+
<td data-value="22" class="abs high">22/22</td>
|
|
88
88
|
<td data-value="75" class="pct medium">75%</td>
|
|
89
89
|
<td data-value="4" class="abs medium">3/4</td>
|
|
90
90
|
<td data-value="100" class="pct high">100%</td>
|
|
91
91
|
<td data-value="6" class="abs high">6/6</td>
|
|
92
92
|
<td data-value="100" class="pct high">100%</td>
|
|
93
|
-
<td data-value="
|
|
93
|
+
<td data-value="22" class="abs high">22/22</td>
|
|
94
94
|
</tr>
|
|
95
95
|
|
|
96
96
|
</tbody>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at
|
|
104
|
+
at Wed Apr 20 2022 08:49:29 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<html lang="en">
|
|
4
4
|
|
|
5
5
|
<head>
|
|
6
|
-
<title>Code coverage report for src/components/MlCreatePdfButton/MlCreatePdfButton.
|
|
6
|
+
<title>Code coverage report for src/components/MlCreatePdfButton/MlCreatePdfButton.tsx</title>
|
|
7
7
|
<meta charset="utf-8" />
|
|
8
8
|
<link rel="stylesheet" href="../../../prettify.css" />
|
|
9
9
|
<link rel="stylesheet" href="../../../base.css" />
|
|
@@ -19,34 +19,34 @@
|
|
|
19
19
|
<body>
|
|
20
20
|
<div class='wrapper'>
|
|
21
21
|
<div class='pad1'>
|
|
22
|
-
<h1><a href="../../../index.html">All files</a> / <a href="index.html">src/components/MlCreatePdfButton</a> MlCreatePdfButton.
|
|
22
|
+
<h1><a href="../../../index.html">All files</a> / <a href="index.html">src/components/MlCreatePdfButton</a> MlCreatePdfButton.tsx</h1>
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>0/
|
|
28
|
+
<span class='fraction'>0/6</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>0/
|
|
35
|
+
<span class='fraction'>0/2</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
40
|
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>0/
|
|
42
|
+
<span class='fraction'>0/3</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>0/
|
|
49
|
+
<span class='fraction'>0/6</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -114,8 +114,8 @@
|
|
|
114
114
|
<a name='L49'></a><a href='#L49'>49</a>
|
|
115
115
|
<a name='L50'></a><a href='#L50'>50</a>
|
|
116
116
|
<a name='L51'></a><a href='#L51'>51</a>
|
|
117
|
-
<a name='L52'></a><a href='#L52'>52</a>
|
|
118
|
-
<
|
|
117
|
+
<a name='L52'></a><a href='#L52'>52</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
118
|
+
<span class="cline-any cline-neutral"> </span>
|
|
119
119
|
<span class="cline-any cline-neutral"> </span>
|
|
120
120
|
<span class="cline-any cline-neutral"> </span>
|
|
121
121
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -129,68 +129,70 @@
|
|
|
129
129
|
<span class="cline-any cline-neutral"> </span>
|
|
130
130
|
<span class="cline-any cline-neutral"> </span>
|
|
131
131
|
<span class="cline-any cline-neutral"> </span>
|
|
132
|
-
<span class="cline-any cline-no"> </span>
|
|
133
|
-
<span class="cline-any cline-no"> </span>
|
|
134
|
-
<span class="cline-any cline-no"> </span>
|
|
135
|
-
<span class="cline-any cline-no"> </span>
|
|
136
132
|
<span class="cline-any cline-neutral"> </span>
|
|
137
|
-
<span class="cline-any cline-no"> </span>
|
|
138
|
-
<span class="cline-any cline-no"> </span>
|
|
139
|
-
<span class="cline-any cline-no"> </span>
|
|
140
|
-
<span class="cline-any cline-no"> </span>
|
|
141
133
|
<span class="cline-any cline-neutral"> </span>
|
|
142
134
|
<span class="cline-any cline-neutral"> </span>
|
|
143
|
-
<span class="cline-any cline-no"> </span>
|
|
144
135
|
<span class="cline-any cline-neutral"> </span>
|
|
145
136
|
<span class="cline-any cline-neutral"> </span>
|
|
146
137
|
<span class="cline-any cline-neutral"> </span>
|
|
147
138
|
<span class="cline-any cline-neutral"> </span>
|
|
148
139
|
<span class="cline-any cline-neutral"> </span>
|
|
149
140
|
<span class="cline-any cline-no"> </span>
|
|
141
|
+
<span class="cline-any cline-no"> </span>
|
|
142
|
+
<span class="cline-any cline-neutral"> </span>
|
|
150
143
|
<span class="cline-any cline-neutral"> </span>
|
|
151
144
|
<span class="cline-any cline-neutral"> </span>
|
|
152
145
|
<span class="cline-any cline-neutral"> </span>
|
|
146
|
+
<span class="cline-any cline-no"> </span>
|
|
153
147
|
<span class="cline-any cline-neutral"> </span>
|
|
154
148
|
<span class="cline-any cline-neutral"> </span>
|
|
155
149
|
<span class="cline-any cline-neutral"> </span>
|
|
156
150
|
<span class="cline-any cline-neutral"> </span>
|
|
157
151
|
<span class="cline-any cline-neutral"> </span>
|
|
158
152
|
<span class="cline-any cline-no"> </span>
|
|
153
|
+
<span class="cline-any cline-no"> </span>
|
|
159
154
|
<span class="cline-any cline-neutral"> </span>
|
|
160
155
|
<span class="cline-any cline-neutral"> </span>
|
|
161
156
|
<span class="cline-any cline-neutral"> </span>
|
|
162
|
-
<span class="cline-any cline-no"> </span>
|
|
163
157
|
<span class="cline-any cline-neutral"> </span>
|
|
164
158
|
<span class="cline-any cline-neutral"> </span>
|
|
165
159
|
<span class="cline-any cline-neutral"> </span>
|
|
166
160
|
<span class="cline-any cline-neutral"> </span>
|
|
167
161
|
<span class="cline-any cline-neutral"> </span>
|
|
168
162
|
<span class="cline-any cline-neutral"> </span>
|
|
163
|
+
<span class="cline-any cline-no"> </span>
|
|
169
164
|
<span class="cline-any cline-neutral"> </span>
|
|
170
|
-
<span class="cline-any cline-neutral"> </span
|
|
171
|
-
|
|
172
|
-
|
|
165
|
+
<span class="cline-any cline-neutral"> </span>
|
|
166
|
+
<span class="cline-any cline-neutral"> </span>
|
|
167
|
+
<span class="cline-any cline-neutral"> </span>
|
|
168
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React from "react";
|
|
169
|
+
import useMap from "../../hooks/useMap";
|
|
173
170
|
|
|
174
|
-
import createPdf from "./lib/createPdf
|
|
171
|
+
import createPdf from "./lib/createPdf";
|
|
175
172
|
|
|
176
173
|
import PrinterIcon from "@mui/icons-material/Print";
|
|
177
174
|
import Button from "@mui/material/Button";
|
|
178
175
|
|
|
176
|
+
interface MlCreatePdfButtonProps {
|
|
177
|
+
/**
|
|
178
|
+
* Id of the target MapLibre instance in mapContext
|
|
179
|
+
*/
|
|
180
|
+
mapId?: string;
|
|
181
|
+
/**
|
|
182
|
+
* Id of an existing layer in the mapLibre instance to help specify the layer order
|
|
183
|
+
* This layer will be visually beneath the layer with the "insertBeforeLayer" id.
|
|
184
|
+
*/
|
|
185
|
+
insertBeforeLayer?: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
179
188
|
/**
|
|
180
189
|
* Renders a button that will create a PDF version of the current map view (dimensions adjusted to fit Din A4 Paper).
|
|
181
|
-
*
|
|
182
|
-
* @component
|
|
183
190
|
*/
|
|
184
|
-
const MlCreatePdfButton = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(p</span>rops) => {</span>
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
<span class="cstat-no" title="statement not covered" > useEffect(<span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
190
|
-
<span class="cstat-no" title="statement not covered" > if (!mapContext.mapExists(props.mapId) || initializedRef.current) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
191
|
-
<span class="cstat-no" title="statement not covered" > initializedRef.current = true;</span>
|
|
192
|
-
<span class="cstat-no" title="statement not covered" > mapRef.current = mapContext.getMap(props.mapId);</span>
|
|
193
|
-
}, [mapContext.mapIds, mapContext, props.mapId]);
|
|
191
|
+
const MlCreatePdfButton = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(p</span>rops: MlCreatePdfButtonProps) => {</span>
|
|
192
|
+
const mapHook = <span class="cstat-no" title="statement not covered" >useMap({</span>
|
|
193
|
+
mapId: props.mapId,
|
|
194
|
+
waitForLayer: props.insertBeforeLayer,
|
|
195
|
+
});
|
|
194
196
|
|
|
195
197
|
<span class="cstat-no" title="statement not covered" > return (</span>
|
|
196
198
|
<>
|
|
@@ -198,7 +200,9 @@ const MlCreatePdfButton = <span class="cstat-no" title="statement not covered" >
|
|
|
198
200
|
color="primary"
|
|
199
201
|
variant="contained"
|
|
200
202
|
onClick={<span class="fstat-no" title="function not covered" >()</span> => {
|
|
201
|
-
<span class="cstat-no" title="statement not covered" >
|
|
203
|
+
<span class="cstat-no" title="statement not covered" > if (mapHook.map) {</span>
|
|
204
|
+
<span class="cstat-no" title="statement not covered" > createPdf(mapHook.map, null, <span class="fstat-no" title="function not covered" >()</span> => {});</span>
|
|
205
|
+
}
|
|
202
206
|
}}
|
|
203
207
|
>
|
|
204
208
|
<PrinterIcon />
|
|
@@ -211,13 +215,6 @@ const MlCreatePdfButton = <span class="cstat-no" title="statement not covered" >
|
|
|
211
215
|
mapId: undefined,
|
|
212
216
|
};
|
|
213
217
|
|
|
214
|
-
<span class="cstat-no" title="statement not covered" >MlCreatePdfButton.propTypes = {</span>
|
|
215
|
-
/**
|
|
216
|
-
* Id of the target MapLibre instance in mapContext
|
|
217
|
-
*/
|
|
218
|
-
mapId: PropTypes.string,
|
|
219
|
-
};
|
|
220
|
-
|
|
221
218
|
export default MlCreatePdfButton;
|
|
222
219
|
</pre></td></tr></table></pre>
|
|
223
220
|
|
|
@@ -226,7 +223,7 @@ export default MlCreatePdfButton;
|
|
|
226
223
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
227
224
|
Code coverage generated by
|
|
228
225
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
229
|
-
at
|
|
226
|
+
at Wed Apr 20 2022 08:49:29 GMT+0000 (Coordinated Universal Time)
|
|
230
227
|
</div>
|
|
231
228
|
<script src="../../../prettify.js"></script>
|
|
232
229
|
<script>
|
|
@@ -25,28 +25,28 @@
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>0/
|
|
28
|
+
<span class='fraction'>0/6</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>0/
|
|
35
|
+
<span class='fraction'>0/2</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
40
|
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>0/
|
|
42
|
+
<span class='fraction'>0/3</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>0/
|
|
49
|
+
<span class='fraction'>0/6</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -79,18 +79,18 @@
|
|
|
79
79
|
</tr>
|
|
80
80
|
</thead>
|
|
81
81
|
<tbody><tr>
|
|
82
|
-
<td class="file low" data-value="MlCreatePdfButton.
|
|
82
|
+
<td class="file low" data-value="MlCreatePdfButton.tsx"><a href="MlCreatePdfButton.tsx.html">MlCreatePdfButton.tsx</a></td>
|
|
83
83
|
<td data-value="0" class="pic low">
|
|
84
84
|
<div class="chart"><div class="cover-fill" style="width: 0%"></div><div class="cover-empty" style="width: 100%"></div></div>
|
|
85
85
|
</td>
|
|
86
86
|
<td data-value="0" class="pct low">0%</td>
|
|
87
|
-
<td data-value="
|
|
87
|
+
<td data-value="6" class="abs low">0/6</td>
|
|
88
88
|
<td data-value="0" class="pct low">0%</td>
|
|
89
|
-
<td data-value="
|
|
89
|
+
<td data-value="2" class="abs low">0/2</td>
|
|
90
90
|
<td data-value="0" class="pct low">0%</td>
|
|
91
|
-
<td data-value="
|
|
91
|
+
<td data-value="3" class="abs low">0/3</td>
|
|
92
92
|
<td data-value="0" class="pct low">0%</td>
|
|
93
|
-
<td data-value="
|
|
93
|
+
<td data-value="6" class="abs low">0/6</td>
|
|
94
94
|
</tr>
|
|
95
95
|
|
|
96
96
|
</tbody>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at
|
|
104
|
+
at Wed Apr 20 2022 08:49:29 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../../prettify.js"></script>
|
|
107
107
|
<script>
|