@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
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
<html lang="en">
|
|
4
4
|
|
|
5
5
|
<head>
|
|
6
|
-
<title>Code coverage report for src/
|
|
6
|
+
<title>Code coverage report for src/hooks/useLayer.ts</title>
|
|
7
7
|
<meta charset="utf-8" />
|
|
8
|
-
<link rel="stylesheet" href="
|
|
9
|
-
<link rel="stylesheet" href="
|
|
10
|
-
<link rel="shortcut icon" type="image/x-icon" href="
|
|
8
|
+
<link rel="stylesheet" href="../../prettify.css" />
|
|
9
|
+
<link rel="stylesheet" href="../../base.css" />
|
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
|
|
11
11
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
12
|
<style type='text/css'>
|
|
13
13
|
.coverage-summary .sorter {
|
|
14
|
-
background-image: url(
|
|
14
|
+
background-image: url(../../sort-arrow-sprite.png);
|
|
15
15
|
}
|
|
16
16
|
</style>
|
|
17
17
|
</head>
|
|
@@ -19,34 +19,34 @@
|
|
|
19
19
|
<body>
|
|
20
20
|
<div class='wrapper'>
|
|
21
21
|
<div class='pad1'>
|
|
22
|
-
<h1><a href="
|
|
22
|
+
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/hooks</a> useLayer.ts</h1>
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">74.57% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>44/59</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">70.17% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>40/57</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
40
|
<span class="strong">100% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>8/8</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">75.43% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>43/57</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -236,7 +236,55 @@
|
|
|
236
236
|
<a name='L171'></a><a href='#L171'>171</a>
|
|
237
237
|
<a name='L172'></a><a href='#L172'>172</a>
|
|
238
238
|
<a name='L173'></a><a href='#L173'>173</a>
|
|
239
|
-
<a name='L174'></a><a href='#L174'>174</a
|
|
239
|
+
<a name='L174'></a><a href='#L174'>174</a>
|
|
240
|
+
<a name='L175'></a><a href='#L175'>175</a>
|
|
241
|
+
<a name='L176'></a><a href='#L176'>176</a>
|
|
242
|
+
<a name='L177'></a><a href='#L177'>177</a>
|
|
243
|
+
<a name='L178'></a><a href='#L178'>178</a>
|
|
244
|
+
<a name='L179'></a><a href='#L179'>179</a>
|
|
245
|
+
<a name='L180'></a><a href='#L180'>180</a>
|
|
246
|
+
<a name='L181'></a><a href='#L181'>181</a>
|
|
247
|
+
<a name='L182'></a><a href='#L182'>182</a>
|
|
248
|
+
<a name='L183'></a><a href='#L183'>183</a>
|
|
249
|
+
<a name='L184'></a><a href='#L184'>184</a>
|
|
250
|
+
<a name='L185'></a><a href='#L185'>185</a>
|
|
251
|
+
<a name='L186'></a><a href='#L186'>186</a>
|
|
252
|
+
<a name='L187'></a><a href='#L187'>187</a>
|
|
253
|
+
<a name='L188'></a><a href='#L188'>188</a>
|
|
254
|
+
<a name='L189'></a><a href='#L189'>189</a>
|
|
255
|
+
<a name='L190'></a><a href='#L190'>190</a>
|
|
256
|
+
<a name='L191'></a><a href='#L191'>191</a>
|
|
257
|
+
<a name='L192'></a><a href='#L192'>192</a>
|
|
258
|
+
<a name='L193'></a><a href='#L193'>193</a>
|
|
259
|
+
<a name='L194'></a><a href='#L194'>194</a>
|
|
260
|
+
<a name='L195'></a><a href='#L195'>195</a>
|
|
261
|
+
<a name='L196'></a><a href='#L196'>196</a>
|
|
262
|
+
<a name='L197'></a><a href='#L197'>197</a>
|
|
263
|
+
<a name='L198'></a><a href='#L198'>198</a>
|
|
264
|
+
<a name='L199'></a><a href='#L199'>199</a>
|
|
265
|
+
<a name='L200'></a><a href='#L200'>200</a>
|
|
266
|
+
<a name='L201'></a><a href='#L201'>201</a>
|
|
267
|
+
<a name='L202'></a><a href='#L202'>202</a>
|
|
268
|
+
<a name='L203'></a><a href='#L203'>203</a>
|
|
269
|
+
<a name='L204'></a><a href='#L204'>204</a>
|
|
270
|
+
<a name='L205'></a><a href='#L205'>205</a>
|
|
271
|
+
<a name='L206'></a><a href='#L206'>206</a>
|
|
272
|
+
<a name='L207'></a><a href='#L207'>207</a>
|
|
273
|
+
<a name='L208'></a><a href='#L208'>208</a>
|
|
274
|
+
<a name='L209'></a><a href='#L209'>209</a>
|
|
275
|
+
<a name='L210'></a><a href='#L210'>210</a>
|
|
276
|
+
<a name='L211'></a><a href='#L211'>211</a>
|
|
277
|
+
<a name='L212'></a><a href='#L212'>212</a>
|
|
278
|
+
<a name='L213'></a><a href='#L213'>213</a>
|
|
279
|
+
<a name='L214'></a><a href='#L214'>214</a>
|
|
280
|
+
<a name='L215'></a><a href='#L215'>215</a>
|
|
281
|
+
<a name='L216'></a><a href='#L216'>216</a>
|
|
282
|
+
<a name='L217'></a><a href='#L217'>217</a>
|
|
283
|
+
<a name='L218'></a><a href='#L218'>218</a>
|
|
284
|
+
<a name='L219'></a><a href='#L219'>219</a>
|
|
285
|
+
<a name='L220'></a><a href='#L220'>220</a>
|
|
286
|
+
<a name='L221'></a><a href='#L221'>221</a>
|
|
287
|
+
<a name='L222'></a><a href='#L222'>222</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
240
288
|
<span class="cline-any cline-neutral"> </span>
|
|
241
289
|
<span class="cline-any cline-neutral"> </span>
|
|
242
290
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -244,51 +292,30 @@
|
|
|
244
292
|
<span class="cline-any cline-neutral"> </span>
|
|
245
293
|
<span class="cline-any cline-neutral"> </span>
|
|
246
294
|
<span class="cline-any cline-neutral"> </span>
|
|
247
|
-
<span class="cline-any cline-yes">3x</span>
|
|
248
295
|
<span class="cline-any cline-neutral"> </span>
|
|
249
296
|
<span class="cline-any cline-neutral"> </span>
|
|
250
297
|
<span class="cline-any cline-neutral"> </span>
|
|
251
298
|
<span class="cline-any cline-neutral"> </span>
|
|
252
299
|
<span class="cline-any cline-neutral"> </span>
|
|
253
300
|
<span class="cline-any cline-neutral"> </span>
|
|
254
|
-
<span class="cline-any cline-yes">3x</span>
|
|
255
301
|
<span class="cline-any cline-neutral"> </span>
|
|
256
|
-
<span class="cline-any cline-yes">24x</span>
|
|
257
|
-
<span class="cline-any cline-yes">24x</span>
|
|
258
|
-
<span class="cline-any cline-yes">24x</span>
|
|
259
|
-
<span class="cline-any cline-yes">24x</span>
|
|
260
302
|
<span class="cline-any cline-neutral"> </span>
|
|
261
|
-
<span class="cline-any cline-yes">24x</span>
|
|
262
|
-
<span class="cline-any cline-yes">16x</span>
|
|
263
303
|
<span class="cline-any cline-neutral"> </span>
|
|
264
|
-
<span class="cline-any cline-no"> </span>
|
|
265
|
-
<span class="cline-any cline-no"> </span>
|
|
266
304
|
<span class="cline-any cline-neutral"> </span>
|
|
267
305
|
<span class="cline-any cline-neutral"> </span>
|
|
268
306
|
<span class="cline-any cline-neutral"> </span>
|
|
269
|
-
<span class="cline-any cline-yes">24x</span>
|
|
270
|
-
<span class="cline-any cline-yes">16x</span>
|
|
271
307
|
<span class="cline-any cline-neutral"> </span>
|
|
272
308
|
<span class="cline-any cline-neutral"> </span>
|
|
273
|
-
<span class="cline-any cline-no"> </span>
|
|
274
309
|
<span class="cline-any cline-neutral"> </span>
|
|
275
|
-
<span class="cline-any cline-no"> </span>
|
|
276
|
-
<span class="cline-any cline-no"> </span>
|
|
277
310
|
<span class="cline-any cline-neutral"> </span>
|
|
278
311
|
<span class="cline-any cline-neutral"> </span>
|
|
279
312
|
<span class="cline-any cline-neutral"> </span>
|
|
280
|
-
<span class="cline-any cline-yes">24x</span>
|
|
281
|
-
<span class="cline-any cline-yes">16x</span>
|
|
282
313
|
<span class="cline-any cline-neutral"> </span>
|
|
283
|
-
<span class="cline-any cline-no"> </span>
|
|
284
314
|
<span class="cline-any cline-neutral"> </span>
|
|
285
315
|
<span class="cline-any cline-neutral"> </span>
|
|
286
|
-
<span class="cline-any cline-yes">
|
|
287
|
-
<span class="cline-any cline-yes">8x</span>
|
|
316
|
+
<span class="cline-any cline-yes">5x</span>
|
|
288
317
|
<span class="cline-any cline-neutral"> </span>
|
|
289
|
-
<span class="cline-any cline-yes">8x</span>
|
|
290
318
|
<span class="cline-any cline-neutral"> </span>
|
|
291
|
-
<span class="cline-any cline-yes">8x</span>
|
|
292
319
|
<span class="cline-any cline-neutral"> </span>
|
|
293
320
|
<span class="cline-any cline-neutral"> </span>
|
|
294
321
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -299,54 +326,70 @@
|
|
|
299
326
|
<span class="cline-any cline-neutral"> </span>
|
|
300
327
|
<span class="cline-any cline-neutral"> </span>
|
|
301
328
|
<span class="cline-any cline-neutral"> </span>
|
|
329
|
+
<span class="cline-any cline-yes">60x</span>
|
|
302
330
|
<span class="cline-any cline-neutral"> </span>
|
|
303
331
|
<span class="cline-any cline-neutral"> </span>
|
|
304
332
|
<span class="cline-any cline-neutral"> </span>
|
|
305
333
|
<span class="cline-any cline-neutral"> </span>
|
|
334
|
+
<span class="cline-any cline-yes">60x</span>
|
|
335
|
+
<span class="cline-any cline-yes">60x</span>
|
|
336
|
+
<span class="cline-any cline-yes">60x</span>
|
|
337
|
+
<span class="cline-any cline-neutral"> </span>
|
|
338
|
+
<span class="cline-any cline-yes">60x</span>
|
|
339
|
+
<span class="cline-any cline-neutral"> </span>
|
|
340
|
+
<span class="cline-any cline-yes">60x</span>
|
|
341
|
+
<span class="cline-any cline-yes">60x</span>
|
|
342
|
+
<span class="cline-any cline-neutral"> </span>
|
|
343
|
+
<span class="cline-any cline-neutral"> </span>
|
|
344
|
+
<span class="cline-any cline-neutral"> </span>
|
|
345
|
+
<span class="cline-any cline-neutral"> </span>
|
|
346
|
+
<span class="cline-any cline-yes">60x</span>
|
|
347
|
+
<span class="cline-any cline-yes">14x</span>
|
|
348
|
+
<span class="cline-any cline-yes">14x</span>
|
|
349
|
+
<span class="cline-any cline-neutral"> </span>
|
|
350
|
+
<span class="cline-any cline-yes">14x</span>
|
|
351
|
+
<span class="cline-any cline-neutral"> </span>
|
|
352
|
+
<span class="cline-any cline-neutral"> </span>
|
|
353
|
+
<span class="cline-any cline-neutral"> </span>
|
|
306
354
|
<span class="cline-any cline-neutral"> </span>
|
|
307
355
|
<span class="cline-any cline-neutral"> </span>
|
|
308
356
|
<span class="cline-any cline-neutral"> </span>
|
|
309
|
-
<span class="cline-any cline-yes">8x</span>
|
|
310
|
-
<span class="cline-any cline-no"> </span>
|
|
311
357
|
<span class="cline-any cline-neutral"> </span>
|
|
312
358
|
<span class="cline-any cline-neutral"> </span>
|
|
313
|
-
<span class="cline-any cline-yes">8x</span>
|
|
314
|
-
<span class="cline-any cline-no"> </span>
|
|
315
359
|
<span class="cline-any cline-neutral"> </span>
|
|
316
360
|
<span class="cline-any cline-neutral"> </span>
|
|
317
|
-
<span class="cline-any cline-yes">8x</span>
|
|
318
|
-
<span class="cline-any cline-no"> </span>
|
|
319
361
|
<span class="cline-any cline-neutral"> </span>
|
|
320
362
|
<span class="cline-any cline-neutral"> </span>
|
|
321
363
|
<span class="cline-any cline-neutral"> </span>
|
|
322
|
-
<span class="cline-any cline-yes">24x</span>
|
|
323
|
-
<span class="cline-any cline-yes">24x</span>
|
|
324
364
|
<span class="cline-any cline-neutral"> </span>
|
|
325
|
-
<span class="cline-any cline-yes">8x</span>
|
|
326
365
|
<span class="cline-any cline-neutral"> </span>
|
|
327
366
|
<span class="cline-any cline-neutral"> </span>
|
|
328
367
|
<span class="cline-any cline-neutral"> </span>
|
|
329
368
|
<span class="cline-any cline-neutral"> </span>
|
|
330
369
|
<span class="cline-any cline-neutral"> </span>
|
|
331
370
|
<span class="cline-any cline-neutral"> </span>
|
|
371
|
+
<span class="cline-any cline-yes">14x</span>
|
|
372
|
+
<span class="cline-any cline-neutral"> </span>
|
|
373
|
+
<span class="cline-any cline-yes">14x</span>
|
|
332
374
|
<span class="cline-any cline-no"> </span>
|
|
333
|
-
<span class="cline-any cline-yes">8x</span>
|
|
334
375
|
<span class="cline-any cline-neutral"> </span>
|
|
335
376
|
<span class="cline-any cline-neutral"> </span>
|
|
336
377
|
<span class="cline-any cline-neutral"> </span>
|
|
337
378
|
<span class="cline-any cline-neutral"> </span>
|
|
379
|
+
<span class="cline-any cline-neutral"> </span>
|
|
380
|
+
<span class="cline-any cline-neutral"> </span>
|
|
381
|
+
<span class="cline-any cline-neutral"> </span>
|
|
382
|
+
<span class="cline-any cline-yes">14x</span>
|
|
338
383
|
<span class="cline-any cline-no"> </span>
|
|
339
384
|
<span class="cline-any cline-neutral"> </span>
|
|
340
385
|
<span class="cline-any cline-neutral"> </span>
|
|
341
|
-
<span class="cline-any cline-yes">8x</span>
|
|
342
386
|
<span class="cline-any cline-neutral"> </span>
|
|
343
|
-
<span class="cline-any cline-yes">8x</span>
|
|
344
387
|
<span class="cline-any cline-neutral"> </span>
|
|
345
388
|
<span class="cline-any cline-neutral"> </span>
|
|
346
|
-
<span class="cline-any cline-yes">24x</span>
|
|
347
389
|
<span class="cline-any cline-neutral"> </span>
|
|
348
390
|
<span class="cline-any cline-neutral"> </span>
|
|
349
|
-
<span class="cline-any cline-yes">
|
|
391
|
+
<span class="cline-any cline-yes">14x</span>
|
|
392
|
+
<span class="cline-any cline-no"> </span>
|
|
350
393
|
<span class="cline-any cline-neutral"> </span>
|
|
351
394
|
<span class="cline-any cline-neutral"> </span>
|
|
352
395
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -354,234 +397,335 @@
|
|
|
354
397
|
<span class="cline-any cline-neutral"> </span>
|
|
355
398
|
<span class="cline-any cline-neutral"> </span>
|
|
356
399
|
<span class="cline-any cline-neutral"> </span>
|
|
400
|
+
<span class="cline-any cline-yes">14x</span>
|
|
401
|
+
<span class="cline-any cline-yes">14x</span>
|
|
402
|
+
<span class="cline-any cline-yes">14x</span>
|
|
357
403
|
<span class="cline-any cline-neutral"> </span>
|
|
358
404
|
<span class="cline-any cline-neutral"> </span>
|
|
405
|
+
<span class="cline-any cline-yes">60x</span>
|
|
406
|
+
<span class="cline-any cline-yes">60x</span>
|
|
359
407
|
<span class="cline-any cline-neutral"> </span>
|
|
408
|
+
<span class="cline-any cline-yes">32x</span>
|
|
360
409
|
<span class="cline-any cline-neutral"> </span>
|
|
361
410
|
<span class="cline-any cline-neutral"> </span>
|
|
362
411
|
<span class="cline-any cline-neutral"> </span>
|
|
363
412
|
<span class="cline-any cline-neutral"> </span>
|
|
364
413
|
<span class="cline-any cline-neutral"> </span>
|
|
365
414
|
<span class="cline-any cline-neutral"> </span>
|
|
415
|
+
<span class="cline-any cline-no"> </span>
|
|
416
|
+
<span class="cline-any cline-yes">32x</span>
|
|
366
417
|
<span class="cline-any cline-neutral"> </span>
|
|
367
418
|
<span class="cline-any cline-neutral"> </span>
|
|
368
419
|
<span class="cline-any cline-neutral"> </span>
|
|
369
420
|
<span class="cline-any cline-neutral"> </span>
|
|
370
421
|
<span class="cline-any cline-neutral"> </span>
|
|
422
|
+
<span class="cline-any cline-yes">18x</span>
|
|
371
423
|
<span class="cline-any cline-neutral"> </span>
|
|
372
424
|
<span class="cline-any cline-neutral"> </span>
|
|
425
|
+
<span class="cline-any cline-yes">14x</span>
|
|
373
426
|
<span class="cline-any cline-neutral"> </span>
|
|
374
427
|
<span class="cline-any cline-neutral"> </span>
|
|
428
|
+
<span class="cline-any cline-yes">60x</span>
|
|
429
|
+
<span class="cline-any cline-yes">28x</span>
|
|
375
430
|
<span class="cline-any cline-neutral"> </span>
|
|
376
431
|
<span class="cline-any cline-neutral"> </span>
|
|
377
432
|
<span class="cline-any cline-neutral"> </span>
|
|
433
|
+
<span class="cline-any cline-yes">16x</span>
|
|
378
434
|
<span class="cline-any cline-neutral"> </span>
|
|
379
435
|
<span class="cline-any cline-neutral"> </span>
|
|
436
|
+
<span class="cline-any cline-yes">12x</span>
|
|
380
437
|
<span class="cline-any cline-neutral"> </span>
|
|
381
438
|
<span class="cline-any cline-neutral"> </span>
|
|
439
|
+
<span class="cline-any cline-yes">60x</span>
|
|
440
|
+
<span class="cline-any cline-yes">60x</span>
|
|
382
441
|
<span class="cline-any cline-neutral"> </span>
|
|
383
442
|
<span class="cline-any cline-neutral"> </span>
|
|
384
443
|
<span class="cline-any cline-neutral"> </span>
|
|
385
444
|
<span class="cline-any cline-neutral"> </span>
|
|
445
|
+
<span class="cline-any cline-yes">28x</span>
|
|
386
446
|
<span class="cline-any cline-neutral"> </span>
|
|
387
447
|
<span class="cline-any cline-neutral"> </span>
|
|
388
448
|
<span class="cline-any cline-neutral"> </span>
|
|
449
|
+
<span class="cline-any cline-yes">32x</span>
|
|
450
|
+
<span class="cline-any cline-yes">32x</span>
|
|
451
|
+
<span class="cline-any cline-no"> </span>
|
|
389
452
|
<span class="cline-any cline-neutral"> </span>
|
|
453
|
+
<span class="cline-any cline-no"> </span>
|
|
454
|
+
<span class="cline-any cline-no"> </span>
|
|
390
455
|
<span class="cline-any cline-neutral"> </span>
|
|
391
456
|
<span class="cline-any cline-neutral"> </span>
|
|
392
457
|
<span class="cline-any cline-neutral"> </span>
|
|
458
|
+
<span class="cline-any cline-no"> </span>
|
|
393
459
|
<span class="cline-any cline-neutral"> </span>
|
|
394
460
|
<span class="cline-any cline-neutral"> </span>
|
|
395
461
|
<span class="cline-any cline-neutral"> </span>
|
|
396
462
|
<span class="cline-any cline-neutral"> </span>
|
|
397
463
|
<span class="cline-any cline-neutral"> </span>
|
|
398
464
|
<span class="cline-any cline-neutral"> </span>
|
|
465
|
+
<span class="cline-any cline-no"> </span>
|
|
466
|
+
<span class="cline-any cline-neutral"> </span>
|
|
467
|
+
<span class="cline-any cline-neutral"> </span>
|
|
468
|
+
<span class="cline-any cline-yes">32x</span>
|
|
469
|
+
<span class="cline-any cline-yes">32x</span>
|
|
470
|
+
<span class="cline-any cline-no"> </span>
|
|
471
|
+
<span class="cline-any cline-no"> </span>
|
|
472
|
+
<span class="cline-any cline-no"> </span>
|
|
399
473
|
<span class="cline-any cline-neutral"> </span>
|
|
400
474
|
<span class="cline-any cline-neutral"> </span>
|
|
401
475
|
<span class="cline-any cline-neutral"> </span>
|
|
476
|
+
<span class="cline-any cline-no"> </span>
|
|
402
477
|
<span class="cline-any cline-neutral"> </span>
|
|
403
478
|
<span class="cline-any cline-neutral"> </span>
|
|
404
479
|
<span class="cline-any cline-neutral"> </span>
|
|
405
480
|
<span class="cline-any cline-neutral"> </span>
|
|
406
481
|
<span class="cline-any cline-neutral"> </span>
|
|
407
482
|
<span class="cline-any cline-neutral"> </span>
|
|
483
|
+
<span class="cline-any cline-no"> </span>
|
|
408
484
|
<span class="cline-any cline-neutral"> </span>
|
|
409
485
|
<span class="cline-any cline-neutral"> </span>
|
|
410
486
|
<span class="cline-any cline-neutral"> </span>
|
|
487
|
+
<span class="cline-any cline-yes">60x</span>
|
|
488
|
+
<span class="cline-any cline-yes">7x</span>
|
|
489
|
+
<span class="cline-any cline-yes">7x</span>
|
|
411
490
|
<span class="cline-any cline-neutral"> </span>
|
|
412
|
-
<span class="cline-any cline-neutral"> </span
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
491
|
+
<span class="cline-any cline-neutral"> </span>
|
|
492
|
+
<span class="cline-any cline-yes">60x</span>
|
|
493
|
+
<span class="cline-any cline-yes">14x</span>
|
|
494
|
+
<span class="cline-any cline-yes">7x</span>
|
|
495
|
+
<span class="cline-any cline-neutral"> </span>
|
|
496
|
+
<span class="cline-any cline-neutral"> </span>
|
|
497
|
+
<span class="cline-any cline-neutral"> </span>
|
|
498
|
+
<span class="cline-any cline-yes">60x</span>
|
|
499
|
+
<span class="cline-any cline-neutral"> </span>
|
|
500
|
+
<span class="cline-any cline-neutral"> </span>
|
|
501
|
+
<span class="cline-any cline-neutral"> </span>
|
|
502
|
+
<span class="cline-any cline-neutral"> </span>
|
|
503
|
+
<span class="cline-any cline-neutral"> </span>
|
|
504
|
+
<span class="cline-any cline-neutral"> </span>
|
|
505
|
+
<span class="cline-any cline-neutral"> </span>
|
|
506
|
+
<span class="cline-any cline-neutral"> </span>
|
|
507
|
+
<span class="cline-any cline-neutral"> </span>
|
|
508
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { useState, useEffect, useCallback, useRef } from "react";
|
|
416
509
|
|
|
417
|
-
import
|
|
418
|
-
import getDefaulLayerTypeByGeometry from "./util/getDefaultLayerTypeByGeometry";
|
|
510
|
+
import useMap, { useMapType } from "./useMap";
|
|
419
511
|
|
|
420
|
-
|
|
512
|
+
import { LayerSpecification } from "maplibre-gl";
|
|
421
513
|
|
|
422
|
-
|
|
423
|
-
* Adds source and layer of types "line", "fill" or "circle" to display GeoJSON data on the map.
|
|
424
|
-
*
|
|
425
|
-
* @component
|
|
426
|
-
*/
|
|
427
|
-
const MlGeoJsonLayer = (props) => {
|
|
428
|
-
// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks
|
|
429
|
-
const mapHook = useMap({ mapId: props.mapId, waitForLayer: props.insertBeforeLayer });
|
|
430
|
-
const initializedRef = useRef(false);
|
|
431
|
-
const layerId = useRef(props.layerId || "MlGeoJsonLayer-" + mapHook.componentId);
|
|
432
|
-
const layerTypeRef = useRef(undefined);
|
|
514
|
+
import MapLibreGlWrapper from "../components/MapLibreMap/lib/MapLibreGlWrapper";
|
|
433
515
|
|
|
434
|
-
|
|
435
|
-
|
|
516
|
+
type useLayerType = {
|
|
517
|
+
map: MapLibreGlWrapper | undefined;
|
|
518
|
+
layer: LayerSpecification;
|
|
519
|
+
layerId: string;
|
|
520
|
+
componentId: string;
|
|
521
|
+
mapHook: useMapType;
|
|
522
|
+
};
|
|
436
523
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
524
|
+
interface useLayerProps {
|
|
525
|
+
mapId?: string;
|
|
526
|
+
layerId?: string;
|
|
527
|
+
idPrefix?: string;
|
|
528
|
+
insertBeforeLayer?: string;
|
|
529
|
+
insertBeforeFirstSymbolLayer?: boolean;
|
|
530
|
+
geojson?: object;
|
|
531
|
+
options: LayerSpecification;
|
|
532
|
+
onHover?: Function;
|
|
533
|
+
onClick?: Function;
|
|
534
|
+
onLeave?: Function;
|
|
535
|
+
}
|
|
441
536
|
|
|
442
|
-
|
|
443
|
-
|
|
537
|
+
const legalLayerTypes = [
|
|
538
|
+
"fill",
|
|
539
|
+
"line",
|
|
540
|
+
"symbol",
|
|
541
|
+
"circle",
|
|
542
|
+
"heatmap",
|
|
543
|
+
"fill-extrusion",
|
|
544
|
+
"raster",
|
|
545
|
+
"hillshade",
|
|
546
|
+
"background",
|
|
547
|
+
];
|
|
444
548
|
|
|
445
|
-
|
|
446
|
-
|
|
549
|
+
function useLayer(props: useLayerProps): useLayerType {
|
|
550
|
+
const mapHook = useMap({
|
|
551
|
+
mapId: props.mapId,
|
|
552
|
+
waitForLayer: props.insertBeforeLayer,
|
|
553
|
+
});
|
|
447
554
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
}, [props.paint, mapHook.map, props.mapId, props.defaultPaintOverrides]);
|
|
555
|
+
const layerTypeRef = useRef<string>("");
|
|
556
|
+
const layerPaintConfRef = useRef<string>("");
|
|
557
|
+
const layerLayoutConfRef = useRef<string>("");
|
|
452
558
|
|
|
453
|
-
|
|
454
|
-
if (!mapHook?.map?.getSource(layerId.current) || <span class="branch-1 cbranch-no" title="branch not covered" >!initializedRef.current)</span> return;
|
|
559
|
+
const [layer, setLayer] = useState<any>();
|
|
455
560
|
|
|
456
|
-
|
|
457
|
-
|
|
561
|
+
const initializedRef = useRef<boolean>(false);
|
|
562
|
+
const layerId = useRef(
|
|
563
|
+
props.layerId ||
|
|
564
|
+
(props.idPrefix ? props.idPrefix : <span class="branch-1 cbranch-no" title="branch not covered" >"Layer-")</span> + mapHook.componentId
|
|
565
|
+
);
|
|
458
566
|
|
|
459
567
|
const createLayer = useCallback(() => {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
layerTypeRef.current = props.type || <span class="branch-1 cbranch-no" title="branch not covered" >getDefaulLayerTypeByGeometry(props.geojson);</span>
|
|
568
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (initializedRef.current || !mapHook.map) <span class="cstat-no" title="statement not covered" >return;</span>
|
|
569
|
+
initializedRef.current = true;
|
|
463
570
|
|
|
464
571
|
mapHook.map.addLayer(
|
|
465
572
|
{
|
|
466
|
-
id: layerId.current,
|
|
467
|
-
source: {
|
|
468
|
-
type: "geojson",
|
|
469
|
-
data: geojson,
|
|
470
|
-
},
|
|
471
|
-
type: layerTypeRef.current,
|
|
472
|
-
paint:
|
|
473
|
-
props.paint ||
|
|
474
|
-
getDefaultPaintPropsByType(layerTypeRef.current, props.defaultPaintOverrides),
|
|
475
|
-
layout: props.layout || {},
|
|
476
573
|
...props.options,
|
|
574
|
+
...(props.geojson
|
|
575
|
+
? {
|
|
576
|
+
source: {
|
|
577
|
+
type: "geojson",
|
|
578
|
+
data: props.geojson,
|
|
579
|
+
},
|
|
580
|
+
}
|
|
581
|
+
: {}),
|
|
582
|
+
id: layerId.current,
|
|
477
583
|
},
|
|
478
|
-
props.insertBeforeLayer
|
|
584
|
+
props.insertBeforeLayer
|
|
585
|
+
? <span class="branch-0 cbranch-no" title="branch not covered" >props.insertBeforeLayer</span>
|
|
586
|
+
: props.insertBeforeFirstSymbolLayer
|
|
587
|
+
? mapHook.map.firstSymbolLayer
|
|
588
|
+
: undefined,
|
|
479
589
|
mapHook.componentId
|
|
480
590
|
);
|
|
591
|
+
|
|
592
|
+
setLayer(mapHook.map.map.getLayer(layerId.current));
|
|
481
593
|
|
|
482
594
|
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof props.onHover !== "undefined") {
|
|
483
|
-
<span class="cstat-no" title="statement not covered" > mapHook.map.on(
|
|
595
|
+
<span class="cstat-no" title="statement not covered" > mapHook.map.on(</span>
|
|
596
|
+
"mousemove",
|
|
597
|
+
layerId.current,
|
|
598
|
+
props.onHover,
|
|
599
|
+
mapHook.componentId
|
|
600
|
+
);
|
|
484
601
|
}
|
|
485
602
|
|
|
486
603
|
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof props.onClick !== "undefined") {
|
|
487
|
-
<span class="cstat-no" title="statement not covered" > mapHook.map.on(
|
|
604
|
+
<span class="cstat-no" title="statement not covered" > mapHook.map.on(</span>
|
|
605
|
+
"click",
|
|
606
|
+
layerId.current,
|
|
607
|
+
props.onClick,
|
|
608
|
+
mapHook.componentId
|
|
609
|
+
);
|
|
488
610
|
}
|
|
489
611
|
|
|
490
612
|
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof props.onLeave !== "undefined") {
|
|
491
|
-
<span class="cstat-no" title="statement not covered" > mapHook.map.on(
|
|
613
|
+
<span class="cstat-no" title="statement not covered" > mapHook.map.on(</span>
|
|
614
|
+
"mouseleave",
|
|
615
|
+
layerId.current,
|
|
616
|
+
props.onLeave,
|
|
617
|
+
mapHook.componentId
|
|
618
|
+
);
|
|
492
619
|
}
|
|
493
|
-
|
|
620
|
+
|
|
621
|
+
layerPaintConfRef.current = JSON.stringify(props.options?.paint);
|
|
622
|
+
layerLayoutConfRef.current = JSON.stringify(props.options?.layout);
|
|
623
|
+
layerTypeRef.current = props.options.type;
|
|
624
|
+
}, [props, mapHook.map]);
|
|
494
625
|
|
|
495
626
|
useEffect(() => {
|
|
496
|
-
if (!mapHook.map
|
|
627
|
+
if (!mapHook.map) return;
|
|
497
628
|
|
|
498
629
|
<span class="missing-if-branch" title="if path not taken" >I</span>if (
|
|
499
630
|
initializedRef.current &&
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
631
|
+
legalLayerTypes.indexOf(props.options.type) !== -1 &&
|
|
632
|
+
layerTypeRef.current &&
|
|
633
|
+
props.options.type !== layerTypeRef.current
|
|
503
634
|
) {
|
|
504
635
|
// remove (cleanup) & reinitialize the layer if type has changed
|
|
505
|
-
<span class="cstat-no" title="statement not covered" >
|
|
506
|
-
} else
|
|
636
|
+
<span class="cstat-no" title="statement not covered" > cleanup();</span>
|
|
637
|
+
} else if (
|
|
507
638
|
initializedRef.current &&
|
|
508
|
-
(
|
|
509
|
-
(
|
|
639
|
+
(legalLayerTypes.indexOf(props.options.type) === -1 ||
|
|
640
|
+
(legalLayerTypes.indexOf(props.options.type) !== -1 &&
|
|
641
|
+
props.options.type === layerTypeRef.current))
|
|
510
642
|
) {
|
|
511
|
-
|
|
643
|
+
return;
|
|
512
644
|
}
|
|
513
|
-
|
|
514
|
-
initializedRef.current = true;
|
|
515
645
|
|
|
516
646
|
createLayer();
|
|
517
|
-
}, [mapHook,
|
|
647
|
+
}, [mapHook.map, props.options, createLayer]);
|
|
518
648
|
|
|
519
|
-
|
|
520
|
-
|
|
649
|
+
useEffect(() => {
|
|
650
|
+
if (
|
|
651
|
+
!initializedRef.current ||
|
|
652
|
+
!mapHook?.map?.map.getSource(layerId.current)
|
|
653
|
+
)
|
|
654
|
+
return;
|
|
521
655
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
};
|
|
656
|
+
// @ts-ignore
|
|
657
|
+
mapHook.map.map.getSource(layerId.current).setData(props.geojson);
|
|
658
|
+
}, [props.geojson, mapHook.map, props.options.type]);
|
|
659
|
+
|
|
660
|
+
useEffect(() => {
|
|
661
|
+
if (
|
|
662
|
+
!mapHook.map ||
|
|
663
|
+
!mapHook.map?.map?.getLayer?.(layerId.current) ||
|
|
664
|
+
!initializedRef.current
|
|
665
|
+
)
|
|
666
|
+
return;
|
|
667
|
+
|
|
668
|
+
var key;
|
|
669
|
+
|
|
670
|
+
let layoutString = JSON.stringify(props.options.layout);
|
|
671
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (props.options.layout && layoutString !== layerLayoutConfRef.current) {
|
|
672
|
+
let oldLayout = <span class="cstat-no" title="statement not covered" >JSON.parse(layerLayoutConfRef.current);</span>
|
|
673
|
+
|
|
674
|
+
<span class="cstat-no" title="statement not covered" > for (key in props.options.layout) {</span>
|
|
675
|
+
<span class="cstat-no" title="statement not covered" > if (</span>
|
|
676
|
+
props.options.layout?.[key] &&
|
|
677
|
+
props.options.layout[key] !== oldLayout[key]
|
|
678
|
+
) {
|
|
679
|
+
<span class="cstat-no" title="statement not covered" > mapHook.map.map.setLayoutProperty(</span>
|
|
680
|
+
layerId.current,
|
|
681
|
+
key,
|
|
682
|
+
props.options.layout[key]
|
|
683
|
+
);
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
<span class="cstat-no" title="statement not covered" > layerLayoutConfRef.current = layoutString;</span>
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
let paintString = JSON.stringify(props.options.paint);
|
|
690
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (paintString !== layerPaintConfRef.current) {
|
|
691
|
+
let oldPaint = <span class="cstat-no" title="statement not covered" >JSON.parse(layerPaintConfRef.current);</span>
|
|
692
|
+
<span class="cstat-no" title="statement not covered" > for (key in props.options.paint) {</span>
|
|
693
|
+
<span class="cstat-no" title="statement not covered" > if (</span>
|
|
694
|
+
props.options.paint?.[key] &&
|
|
695
|
+
props.options.paint[key] !== oldPaint[key]
|
|
696
|
+
) {
|
|
697
|
+
<span class="cstat-no" title="statement not covered" > mapHook.map.map.setPaintProperty(</span>
|
|
698
|
+
layerId.current,
|
|
699
|
+
key,
|
|
700
|
+
props.options.paint[key]
|
|
701
|
+
);
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
<span class="cstat-no" title="statement not covered" > layerPaintConfRef.current = paintString;</span>
|
|
705
|
+
}
|
|
706
|
+
}, [props.options, mapHook.map]);
|
|
707
|
+
|
|
708
|
+
const cleanup = () => {
|
|
709
|
+
initializedRef.current = false;
|
|
710
|
+
mapHook.cleanup();
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
useEffect(() => {
|
|
714
|
+
return () => {
|
|
715
|
+
cleanup();
|
|
716
|
+
};
|
|
717
|
+
}, []);
|
|
718
|
+
|
|
719
|
+
return {
|
|
720
|
+
map: mapHook.map,
|
|
721
|
+
layer: layer,
|
|
722
|
+
layerId: layerId.current,
|
|
723
|
+
componentId: mapHook.componentId,
|
|
724
|
+
mapHook: mapHook,
|
|
725
|
+
};
|
|
726
|
+
}
|
|
583
727
|
|
|
584
|
-
export default
|
|
728
|
+
export default useLayer;
|
|
585
729
|
</pre></td></tr></table></pre>
|
|
586
730
|
|
|
587
731
|
<div class='push'></div><!-- for sticky footer -->
|
|
@@ -589,16 +733,16 @@ export default MlGeoJsonLayer;
|
|
|
589
733
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
590
734
|
Code coverage generated by
|
|
591
735
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
592
|
-
at
|
|
736
|
+
at Wed Apr 20 2022 07:57:24 GMT+0000 (Coordinated Universal Time)
|
|
593
737
|
</div>
|
|
594
|
-
<script src="
|
|
738
|
+
<script src="../../prettify.js"></script>
|
|
595
739
|
<script>
|
|
596
740
|
window.onload = function () {
|
|
597
741
|
prettyPrint();
|
|
598
742
|
};
|
|
599
743
|
</script>
|
|
600
|
-
<script src="
|
|
601
|
-
<script src="
|
|
744
|
+
<script src="../../sorter.js"></script>
|
|
745
|
+
<script src="../../block-navigation.js"></script>
|
|
602
746
|
</body>
|
|
603
747
|
</html>
|
|
604
748
|
|