@mapcomponents/react-maplibre 0.1.33 → 0.1.36
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 +10 -0
- 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 +17059 -4275
- 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 +134 -116
- 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/MlWmsLoader/{MlWmsLoader.js.html → MlWmsLoader.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/MlWmsLoader/MlWmsLoader.
|
|
6
|
+
<title>Code coverage report for src/components/MlWmsLoader/MlWmsLoader.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,20 +19,20 @@
|
|
|
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/MlWmsLoader</a> MlWmsLoader.
|
|
22
|
+
<h1><a href="../../../index.html">All files</a> / <a href="index.html">src/components/MlWmsLoader</a> MlWmsLoader.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/96</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/57</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -46,7 +46,7 @@
|
|
|
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/91</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -361,7 +361,17 @@
|
|
|
361
361
|
<a name='L296'></a><a href='#L296'>296</a>
|
|
362
362
|
<a name='L297'></a><a href='#L297'>297</a>
|
|
363
363
|
<a name='L298'></a><a href='#L298'>298</a>
|
|
364
|
-
<a name='L299'></a><a href='#L299'>299</a
|
|
364
|
+
<a name='L299'></a><a href='#L299'>299</a>
|
|
365
|
+
<a name='L300'></a><a href='#L300'>300</a>
|
|
366
|
+
<a name='L301'></a><a href='#L301'>301</a>
|
|
367
|
+
<a name='L302'></a><a href='#L302'>302</a>
|
|
368
|
+
<a name='L303'></a><a href='#L303'>303</a>
|
|
369
|
+
<a name='L304'></a><a href='#L304'>304</a>
|
|
370
|
+
<a name='L305'></a><a href='#L305'>305</a>
|
|
371
|
+
<a name='L306'></a><a href='#L306'>306</a>
|
|
372
|
+
<a name='L307'></a><a href='#L307'>307</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
373
|
+
<span class="cline-any cline-neutral"> </span>
|
|
374
|
+
<span class="cline-any cline-neutral"> </span>
|
|
365
375
|
<span class="cline-any cline-neutral"> </span>
|
|
366
376
|
<span class="cline-any cline-neutral"> </span>
|
|
367
377
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -400,6 +410,32 @@
|
|
|
400
410
|
<span class="cline-any cline-neutral"> </span>
|
|
401
411
|
<span class="cline-any cline-neutral"> </span>
|
|
402
412
|
<span class="cline-any cline-neutral"> </span>
|
|
413
|
+
<span class="cline-any cline-neutral"> </span>
|
|
414
|
+
<span class="cline-any cline-neutral"> </span>
|
|
415
|
+
<span class="cline-any cline-neutral"> </span>
|
|
416
|
+
<span class="cline-any cline-neutral"> </span>
|
|
417
|
+
<span class="cline-any cline-neutral"> </span>
|
|
418
|
+
<span class="cline-any cline-neutral"> </span>
|
|
419
|
+
<span class="cline-any cline-neutral"> </span>
|
|
420
|
+
<span class="cline-any cline-neutral"> </span>
|
|
421
|
+
<span class="cline-any cline-neutral"> </span>
|
|
422
|
+
<span class="cline-any cline-neutral"> </span>
|
|
423
|
+
<span class="cline-any cline-neutral"> </span>
|
|
424
|
+
<span class="cline-any cline-neutral"> </span>
|
|
425
|
+
<span class="cline-any cline-neutral"> </span>
|
|
426
|
+
<span class="cline-any cline-neutral"> </span>
|
|
427
|
+
<span class="cline-any cline-neutral"> </span>
|
|
428
|
+
<span class="cline-any cline-neutral"> </span>
|
|
429
|
+
<span class="cline-any cline-neutral"> </span>
|
|
430
|
+
<span class="cline-any cline-neutral"> </span>
|
|
431
|
+
<span class="cline-any cline-neutral"> </span>
|
|
432
|
+
<span class="cline-any cline-neutral"> </span>
|
|
433
|
+
<span class="cline-any cline-neutral"> </span>
|
|
434
|
+
<span class="cline-any cline-neutral"> </span>
|
|
435
|
+
<span class="cline-any cline-neutral"> </span>
|
|
436
|
+
<span class="cline-any cline-neutral"> </span>
|
|
437
|
+
<span class="cline-any cline-neutral"> </span>
|
|
438
|
+
<span class="cline-any cline-neutral"> </span>
|
|
403
439
|
<span class="cline-any cline-no"> </span>
|
|
404
440
|
<span class="cline-any cline-neutral"> </span>
|
|
405
441
|
<span class="cline-any cline-no"> </span>
|
|
@@ -408,6 +444,8 @@
|
|
|
408
444
|
<span class="cline-any cline-neutral"> </span>
|
|
409
445
|
<span class="cline-any cline-neutral"> </span>
|
|
410
446
|
<span class="cline-any cline-neutral"> </span>
|
|
447
|
+
<span class="cline-any cline-neutral"> </span>
|
|
448
|
+
<span class="cline-any cline-neutral"> </span>
|
|
411
449
|
<span class="cline-any cline-no"> </span>
|
|
412
450
|
<span class="cline-any cline-no"> </span>
|
|
413
451
|
<span class="cline-any cline-no"> </span>
|
|
@@ -449,6 +487,7 @@
|
|
|
449
487
|
<span class="cline-any cline-no"> </span>
|
|
450
488
|
<span class="cline-any cline-no"> </span>
|
|
451
489
|
<span class="cline-any cline-no"> </span>
|
|
490
|
+
<span class="cline-any cline-no"> </span>
|
|
452
491
|
<span class="cline-any cline-neutral"> </span>
|
|
453
492
|
<span class="cline-any cline-neutral"> </span>
|
|
454
493
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -530,7 +569,7 @@
|
|
|
530
569
|
<span class="cline-any cline-neutral"> </span>
|
|
531
570
|
<span class="cline-any cline-neutral"> </span>
|
|
532
571
|
<span class="cline-any cline-neutral"> </span>
|
|
533
|
-
<span class="cline-any cline-
|
|
572
|
+
<span class="cline-any cline-no"> </span>
|
|
534
573
|
<span class="cline-any cline-no"> </span>
|
|
535
574
|
<span class="cline-any cline-neutral"> </span>
|
|
536
575
|
<span class="cline-any cline-no"> </span>
|
|
@@ -635,33 +674,10 @@
|
|
|
635
674
|
<span class="cline-any cline-neutral"> </span>
|
|
636
675
|
<span class="cline-any cline-neutral"> </span>
|
|
637
676
|
<span class="cline-any cline-neutral"> </span>
|
|
638
|
-
<span class="cline-any cline-no"> </span>
|
|
639
|
-
<span class="cline-any cline-neutral"> </span>
|
|
640
|
-
<span class="cline-any cline-neutral"> </span>
|
|
641
|
-
<span class="cline-any cline-neutral"> </span>
|
|
642
|
-
<span class="cline-any cline-neutral"> </span>
|
|
643
|
-
<span class="cline-any cline-neutral"> </span>
|
|
644
|
-
<span class="cline-any cline-neutral"> </span>
|
|
645
|
-
<span class="cline-any cline-neutral"> </span>
|
|
646
|
-
<span class="cline-any cline-neutral"> </span>
|
|
647
|
-
<span class="cline-any cline-neutral"> </span>
|
|
648
|
-
<span class="cline-any cline-neutral"> </span>
|
|
649
|
-
<span class="cline-any cline-neutral"> </span>
|
|
650
|
-
<span class="cline-any cline-neutral"> </span>
|
|
651
|
-
<span class="cline-any cline-neutral"> </span>
|
|
652
|
-
<span class="cline-any cline-neutral"> </span>
|
|
653
|
-
<span class="cline-any cline-neutral"> </span>
|
|
654
|
-
<span class="cline-any cline-neutral"> </span>
|
|
655
|
-
<span class="cline-any cline-neutral"> </span>
|
|
656
|
-
<span class="cline-any cline-neutral"> </span>
|
|
657
|
-
<span class="cline-any cline-neutral"> </span>
|
|
658
|
-
<span class="cline-any cline-neutral"> </span>
|
|
659
|
-
<span class="cline-any cline-neutral"> </span>
|
|
660
|
-
<span class="cline-any cline-neutral"> </span>
|
|
661
677
|
<span class="cline-any cline-neutral"> </span>
|
|
662
678
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, { useRef, useEffect, useContext, useCallback, useState } from "react";
|
|
663
|
-
import PropTypes from "prop-types";
|
|
664
679
|
|
|
680
|
+
// @ts-ignore
|
|
665
681
|
import { MapContext } from "@mapcomponents/react-core";
|
|
666
682
|
import { v4 as uuidv4 } from "uuid";
|
|
667
683
|
|
|
@@ -676,9 +692,11 @@ import List from "@mui/material/List";
|
|
|
676
692
|
import ListItem from "@mui/material/ListItem";
|
|
677
693
|
import ListItemText from "@mui/material/ListItemText";
|
|
678
694
|
import IconButton from "@mui/material/IconButton";
|
|
695
|
+
import {LngLat} from "maplibre-gl";
|
|
696
|
+
import MapLibreGlWrapper from "../MapLibreMap/lib/MapLibreGlWrapper";
|
|
679
697
|
|
|
680
698
|
var originShift = <span class="cstat-no" title="statement not covered" >(2 * Math.PI * 6378137) / 2.0;</span>
|
|
681
|
-
const lngLatToMeters = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >fu</span>nction (lnglat,
|
|
699
|
+
const lngLatToMeters = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >fu</span>nction (lnglat:LngLat, accuracy = <span class="branch-0 cbranch-no" title="branch not covered" >{ enable: true, decimal: 1 })</span> {</span>
|
|
682
700
|
var lng = <span class="cstat-no" title="statement not covered" >lnglat.lng;</span>
|
|
683
701
|
var lat = <span class="cstat-no" title="statement not covered" >lnglat.lat;</span>
|
|
684
702
|
var x = <span class="cstat-no" title="statement not covered" >(lng * originShift) / 180.0;</span>
|
|
@@ -690,6 +708,32 @@ const lngLatToMeters = <span class="cstat-no" title="statement not covered" ><sp
|
|
|
690
708
|
}
|
|
691
709
|
<span class="cstat-no" title="statement not covered" > return [x, y];</span>
|
|
692
710
|
};
|
|
711
|
+
|
|
712
|
+
interface MlWmsLoaderProps {
|
|
713
|
+
/**
|
|
714
|
+
* WMS URL
|
|
715
|
+
*/
|
|
716
|
+
url: string;
|
|
717
|
+
/**
|
|
718
|
+
* Id of the target MapLibre instance in mapContext
|
|
719
|
+
*/
|
|
720
|
+
mapId: string;
|
|
721
|
+
/**
|
|
722
|
+
* URL parameters that will be used in the getCapabilities request
|
|
723
|
+
*/
|
|
724
|
+
urlParameters: object;
|
|
725
|
+
/**
|
|
726
|
+
* URL parameters that will be added when requesting WMS capabilities
|
|
727
|
+
*/
|
|
728
|
+
wmsUrlParameters: object;
|
|
729
|
+
/**
|
|
730
|
+
* URL parameters that will be added when requesting tiles
|
|
731
|
+
*/
|
|
732
|
+
layerUrlParameters: object;
|
|
733
|
+
lngLat: LngLat;
|
|
734
|
+
idPrefix: string;
|
|
735
|
+
};
|
|
736
|
+
|
|
693
737
|
/**
|
|
694
738
|
* Loads a WMS getCapabilities xml document and adds a MlWmsLayer component for each layer that is
|
|
695
739
|
* offered by the WMS.
|
|
@@ -698,21 +742,23 @@ const lngLatToMeters = <span class="cstat-no" title="statement not covered" ><sp
|
|
|
698
742
|
*
|
|
699
743
|
* @component
|
|
700
744
|
*/
|
|
701
|
-
const MlWmsLoader = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(p</span>rops) => {</span>
|
|
745
|
+
const MlWmsLoader = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(p</span>rops: MlWmsLoaderProps) => {</span>
|
|
702
746
|
// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks
|
|
703
|
-
const mapContext = <span class="cstat-no" title="statement not covered" >useContext(MapContext);</span>
|
|
704
|
-
const { capabilities, error, setUrl, getFeatureInfoUrl, wmsUrl } = <span class="cstat-no" title="statement not covered" >useWms({</span>
|
|
747
|
+
const mapContext: MapContextType = <span class="cstat-no" title="statement not covered" >useContext(MapContext);</span>
|
|
748
|
+
const { capabilities, error, setUrl, getFeatureInfoUrl, wmsUrl }: any = <span class="cstat-no" title="statement not covered" >useWms({</span>
|
|
705
749
|
url: undefined,
|
|
706
750
|
urlParameters: props.urlParameters,
|
|
707
751
|
});
|
|
752
|
+
let layerType : { visible: boolean, queryable: boolean, Name: string, Title: string, LatLonBoundingBox: Array<number>,
|
|
753
|
+
EX_GeographicBoundingBox: Array<number>, Abstract: any}
|
|
708
754
|
|
|
709
755
|
const initializedRef = <span class="cstat-no" title="statement not covered" >useRef(false);</span>
|
|
710
|
-
const mapRef = <span class="cstat-no" title="statement not covered" >useRef(
|
|
756
|
+
const mapRef = <span class="cstat-no" title="statement not covered" >useRef<MapLibreGlWrapper>();</span>
|
|
711
757
|
const componentId = <span class="cstat-no" title="statement not covered" >useRef((props.idPrefix ? props.idPrefix : "MlWmsLoader-") + uuidv4());</span>
|
|
712
|
-
const [layers, setLayers] = <span class="cstat-no" title="statement not covered" >useState([]);</span>
|
|
758
|
+
const [layers, setLayers] = <span class="cstat-no" title="statement not covered" >useState<Array<typeof layerType>>([]);</span>
|
|
713
759
|
|
|
714
760
|
const [featureInfoLngLat, setFeatureInfoLngLat] = <span class="cstat-no" title="statement not covered" >useState(undefined);</span>
|
|
715
|
-
const [featureInfoContent, setFeatureInfoContent] = <span class="cstat-no" title="statement not covered" >useState(undefined);</span>
|
|
761
|
+
const [featureInfoContent, setFeatureInfoContent] = <span class="cstat-no" title="statement not covered" >useState<string|undefined>(undefined);</span>
|
|
716
762
|
|
|
717
763
|
<span class="cstat-no" title="statement not covered" > useEffect(<span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
718
764
|
let _componentId = <span class="cstat-no" title="statement not covered" >componentId.current;</span>
|
|
@@ -740,9 +786,10 @@ const MlWmsLoader = <span class="cstat-no" title="statement not covered" ><span
|
|
|
740
786
|
|
|
741
787
|
const getFeatureInfo = <span class="cstat-no" title="statement not covered" >useCallback(</span>
|
|
742
788
|
<span class="fstat-no" title="function not covered" > (e</span>v) => {
|
|
789
|
+
<span class="cstat-no" title="statement not covered" > if(!mapRef.current) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
743
790
|
<span class="cstat-no" title="statement not covered" > setFeatureInfoLngLat(undefined);</span>
|
|
744
791
|
<span class="cstat-no" title="statement not covered" > setFeatureInfoContent(undefined);</span>
|
|
745
|
-
let _bounds = <span class="cstat-no" title="statement not covered" >mapRef.current.getBounds();</span>
|
|
792
|
+
let _bounds = <span class="cstat-no" title="statement not covered" >mapRef.current.map.getBounds();</span>
|
|
746
793
|
let _sw = <span class="cstat-no" title="statement not covered" >lngLatToMeters(_bounds._sw);</span>
|
|
747
794
|
let _ne = <span class="cstat-no" title="statement not covered" >lngLatToMeters(_bounds._ne);</span>
|
|
748
795
|
let bbox = <span class="cstat-no" title="statement not covered" >[_sw[0], _sw[1], _ne[0], _ne[1]];</span>
|
|
@@ -757,13 +804,13 @@ const MlWmsLoader = <span class="cstat-no" title="statement not covered" ><span
|
|
|
757
804
|
: "text/plain",
|
|
758
805
|
FEATURE_COUNT: "10",
|
|
759
806
|
LAYERS: layers
|
|
760
|
-
.map(<span class="fstat-no" title="function not covered" >(l</span>ayer
|
|
807
|
+
.map(<span class="fstat-no" title="function not covered" >(l</span>ayer: typeof layerType) => (<span class="cstat-no" title="statement not covered" >layer.visible && layer.queryable ? layer.Name : undefined)</span>)
|
|
761
808
|
.filter(<span class="fstat-no" title="function not covered" >(n</span>) => <span class="cstat-no" title="statement not covered" >n)</span>,
|
|
762
809
|
QUERY_LAYERS: layers
|
|
763
|
-
.map(<span class="fstat-no" title="function not covered" >(l</span>ayer
|
|
810
|
+
.map(<span class="fstat-no" title="function not covered" >(l</span>ayer: typeof layerType) => (<span class="cstat-no" title="statement not covered" >layer.visible && layer.queryable ? layer.Name : undefined)</span>)
|
|
764
811
|
.filter(<span class="fstat-no" title="function not covered" >(n</span>) => <span class="cstat-no" title="statement not covered" >n)</span>,
|
|
765
|
-
WIDTH: mapRef.current._container.clientWidth,
|
|
766
|
-
HEIGHT: mapRef.current._container.clientHeight,
|
|
812
|
+
WIDTH: mapRef.current?.map._container.clientWidth,
|
|
813
|
+
HEIGHT: mapRef.current?.map._container.clientHeight,
|
|
767
814
|
srs: "EPSG:3857",
|
|
768
815
|
CRS: "EPSG:3857",
|
|
769
816
|
version: "1.3.0",
|
|
@@ -774,7 +821,7 @@ const MlWmsLoader = <span class="cstat-no" title="statement not covered" ><span
|
|
|
774
821
|
buffer: "50",
|
|
775
822
|
};
|
|
776
823
|
|
|
777
|
-
let _gfiUrl = <span class="cstat-no" title="statement not covered" >getFeatureInfoUrl;</span>
|
|
824
|
+
let _gfiUrl : string | undefined = <span class="cstat-no" title="statement not covered" >getFeatureInfoUrl;</span>
|
|
778
825
|
let _gfiUrlParts;
|
|
779
826
|
<span class="cstat-no" title="statement not covered" > if (_gfiUrl?.indexOf?.("?") !== -1) {</span>
|
|
780
827
|
<span class="cstat-no" title="statement not covered" > _gfiUrlParts = props.url.split("?");</span>
|
|
@@ -787,7 +834,7 @@ const MlWmsLoader = <span class="cstat-no" title="statement not covered" ><span
|
|
|
787
834
|
..._getFeatureInfoUrlParams,
|
|
788
835
|
};
|
|
789
836
|
// create URLSearchParams object to assemble the URL Parameters
|
|
790
|
-
let urlParams = <span class="cstat-no" title="statement not covered" >new URLSearchParams(urlParamsObj);</span>
|
|
837
|
+
let urlParams = <span class="cstat-no" title="statement not covered" >new URLSearchParams(urlParamsObj.toString());</span>
|
|
791
838
|
|
|
792
839
|
<span class="cstat-no" title="statement not covered" > fetch(props.url + "?" + urlParams.toString())</span>
|
|
793
840
|
.then(<span class="fstat-no" title="function not covered" >(r</span>es) => {
|
|
@@ -812,9 +859,9 @@ const MlWmsLoader = <span class="cstat-no" title="statement not covered" ><span
|
|
|
812
859
|
|
|
813
860
|
<span class="cstat-no" title="statement not covered" > mapRef.current.on("click", _getFeatureInfo, componentId.current);</span>
|
|
814
861
|
<span class="cstat-no" title="statement not covered" > return <span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
815
|
-
<span class="cstat-no" title="statement not covered" > mapRef.current?.off?.("click", _getFeatureInfo);</span>
|
|
862
|
+
<span class="cstat-no" title="statement not covered" > mapRef.current?.map.off?.("click", _getFeatureInfo);</span>
|
|
816
863
|
};
|
|
817
|
-
}, [
|
|
864
|
+
}, [getFeatureInfo]);
|
|
818
865
|
|
|
819
866
|
<span class="cstat-no" title="statement not covered" > useEffect(<span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
820
867
|
<span class="cstat-no" title="statement not covered" > if (!capabilities?.Service) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
@@ -828,9 +875,9 @@ const MlWmsLoader = <span class="cstat-no" title="statement not covered" ><span
|
|
|
828
875
|
"MlWmsLoader (" + capabilities.Service.Title + "): WGS 84/Pseudo-Mercator supported"
|
|
829
876
|
);
|
|
830
877
|
|
|
831
|
-
let _LatLonBoundingBox;
|
|
878
|
+
let _LatLonBoundingBox: Array<number> = <span class="cstat-no" title="statement not covered" >[];</span>
|
|
832
879
|
<span class="cstat-no" title="statement not covered" > setLayers(</span>
|
|
833
|
-
capabilities?.Capability?.Layer?.Layer.map(<span class="fstat-no" title="function not covered" >(l</span>ayer, idx) => {
|
|
880
|
+
capabilities?.Capability?.Layer?.Layer.map(<span class="fstat-no" title="function not covered" >(l</span>ayer: typeof layerType, idx: number) => {
|
|
834
881
|
<span class="cstat-no" title="statement not covered" > if (idx === 0) {</span>
|
|
835
882
|
<span class="cstat-no" title="statement not covered" > _LatLonBoundingBox = layer.LatLonBoundingBox;</span>
|
|
836
883
|
<span class="cstat-no" title="statement not covered" > if (!_LatLonBoundingBox) {</span>
|
|
@@ -843,8 +890,8 @@ const MlWmsLoader = <span class="cstat-no" title="statement not covered" ><span
|
|
|
843
890
|
);
|
|
844
891
|
|
|
845
892
|
// zoom to extent of first layer
|
|
846
|
-
<span class="cstat-no" title="statement not covered" > if (mapRef.current && _LatLonBoundingBox
|
|
847
|
-
<span class="cstat-no" title="statement not covered" > mapRef.current.fitBounds([</span>
|
|
893
|
+
<span class="cstat-no" title="statement not covered" > if (mapRef.current && _LatLonBoundingBox.length > 3) {</span>
|
|
894
|
+
<span class="cstat-no" title="statement not covered" > mapRef.current.map.fitBounds([</span>
|
|
848
895
|
[_LatLonBoundingBox[0], _LatLonBoundingBox[1]],
|
|
849
896
|
[_LatLonBoundingBox[2], _LatLonBoundingBox[3]],
|
|
850
897
|
]);
|
|
@@ -867,7 +914,7 @@ const MlWmsLoader = <span class="cstat-no" title="statement not covered" ><span
|
|
|
867
914
|
{error && <p>{error}</p>}
|
|
868
915
|
<h3 key="title">{capabilities?.Service?.Title}</h3>
|
|
869
916
|
{console.log(componentId.current)}
|
|
870
|
-
{capabilities?.Capability?.Layer?.Layer.map(<span class="fstat-no" title="function not covered" >(
|
|
917
|
+
{capabilities?.Capability?.Layer?.Layer.map(<span class="fstat-no" title="function not covered" >(i</span>dx: number) => (
|
|
871
918
|
<span class="cstat-no" title="statement not covered" > <MlLayer</span>
|
|
872
919
|
layerId={"Order-" + componentId.current + "-" + idx}
|
|
873
920
|
key={componentId.current + "-" + idx}
|
|
@@ -880,7 +927,7 @@ const MlWmsLoader = <span class="cstat-no" title="statement not covered" ><span
|
|
|
880
927
|
))}
|
|
881
928
|
<List dense key="layers">
|
|
882
929
|
{wmsUrl &&
|
|
883
|
-
layers?.map?.(<span class="fstat-no" title="function not covered" >(l</span>ayer, idx) => {
|
|
930
|
+
layers?.map?.(<span class="fstat-no" title="function not covered" >(l</span>ayer: typeof layerType, idx) => {
|
|
884
931
|
<span class="cstat-no" title="statement not covered" > return layer?.Name ? (</span>
|
|
885
932
|
<ListItem
|
|
886
933
|
key={layer.Name + idx}
|
|
@@ -889,7 +936,7 @@ const MlWmsLoader = <span class="cstat-no" title="statement not covered" ><span
|
|
|
889
936
|
edge="end"
|
|
890
937
|
aria-label="toggle visibility"
|
|
891
938
|
onClick={<span class="fstat-no" title="function not covered" >()</span> => {
|
|
892
|
-
let _layers = <span class="cstat-no" title="statement not covered" >[...layers];</span>
|
|
939
|
+
let _layers: Array<typeof layerType> = <span class="cstat-no" title="statement not covered" >[...layers];</span>
|
|
893
940
|
<span class="cstat-no" title="statement not covered" > _layers[idx].visible = !_layers[idx].visible;</span>
|
|
894
941
|
<span class="cstat-no" title="statement not covered" > setLayers([..._layers]);</span>
|
|
895
942
|
}}
|
|
@@ -933,29 +980,6 @@ const MlWmsLoader = <span class="cstat-no" title="statement not covered" ><span
|
|
|
933
980
|
},
|
|
934
981
|
};
|
|
935
982
|
|
|
936
|
-
<span class="cstat-no" title="statement not covered" >MlWmsLoader.propTypes = {</span>
|
|
937
|
-
/**
|
|
938
|
-
* WMS URL
|
|
939
|
-
*/
|
|
940
|
-
url: PropTypes.string.isRequired,
|
|
941
|
-
/**
|
|
942
|
-
* Id of the target MapLibre instance in mapContext
|
|
943
|
-
*/
|
|
944
|
-
mapId: PropTypes.string,
|
|
945
|
-
/**
|
|
946
|
-
* URL parameters that will be used in the getCapabilities request
|
|
947
|
-
*/
|
|
948
|
-
urlParameters: PropTypes.object,
|
|
949
|
-
/**
|
|
950
|
-
* URL parameters that will be added when requesting WMS capabilities
|
|
951
|
-
*/
|
|
952
|
-
wmsUrlParameters: PropTypes.object,
|
|
953
|
-
/**
|
|
954
|
-
* URL parameters that will be added when requesting tiles
|
|
955
|
-
*/
|
|
956
|
-
layerUrlParameters: PropTypes.object,
|
|
957
|
-
};
|
|
958
|
-
|
|
959
983
|
export default MlWmsLoader;
|
|
960
984
|
</pre></td></tr></table></pre>
|
|
961
985
|
|
|
@@ -964,7 +988,7 @@ export default MlWmsLoader;
|
|
|
964
988
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
965
989
|
Code coverage generated by
|
|
966
990
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
967
|
-
at
|
|
991
|
+
at Wed Apr 20 2022 08:13:18 GMT+0000 (Coordinated Universal Time)
|
|
968
992
|
</div>
|
|
969
993
|
<script src="../../../prettify.js"></script>
|
|
970
994
|
<script>
|
|
@@ -25,14 +25,14 @@
|
|
|
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/96</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/57</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -46,7 +46,7 @@
|
|
|
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/91</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="MlWmsLoader.
|
|
82
|
+
<td class="file low" data-value="MlWmsLoader.tsx"><a href="MlWmsLoader.tsx.html">MlWmsLoader.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="96" class="abs low">0/96</td>
|
|
88
88
|
<td data-value="0" class="pct low">0%</td>
|
|
89
|
-
<td data-value="
|
|
89
|
+
<td data-value="57" class="abs low">0/57</td>
|
|
90
90
|
<td data-value="0" class="pct low">0%</td>
|
|
91
91
|
<td data-value="21" class="abs low">0/21</td>
|
|
92
92
|
<td data-value="0" class="pct low">0%</td>
|
|
93
|
-
<td data-value="
|
|
93
|
+
<td data-value="91" class="abs low">0/91</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:13:18 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">54.54% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>96/176</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">53.33% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>56/105</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">59.25% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>16/27</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">55.02% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>93/169</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -79,33 +79,48 @@
|
|
|
79
79
|
</tr>
|
|
80
80
|
</thead>
|
|
81
81
|
<tbody><tr>
|
|
82
|
-
<td class="file medium" data-value="
|
|
83
|
-
<td data-value="
|
|
84
|
-
<div class="chart"><div class="cover-fill" style="width:
|
|
82
|
+
<td class="file medium" data-value="useLayer.ts"><a href="useLayer.ts.html">useLayer.ts</a></td>
|
|
83
|
+
<td data-value="74.57" class="pic medium">
|
|
84
|
+
<div class="chart"><div class="cover-fill" style="width: 74%"></div><div class="cover-empty" style="width: 26%"></div></div>
|
|
85
85
|
</td>
|
|
86
|
-
<td data-value="
|
|
87
|
-
<td data-value="
|
|
88
|
-
<td data-value="
|
|
89
|
-
<td data-value="
|
|
86
|
+
<td data-value="74.57" class="pct medium">74.57%</td>
|
|
87
|
+
<td data-value="59" class="abs medium">44/59</td>
|
|
88
|
+
<td data-value="70.17" class="pct medium">70.17%</td>
|
|
89
|
+
<td data-value="57" class="abs medium">40/57</td>
|
|
90
|
+
<td data-value="100" class="pct high">100%</td>
|
|
91
|
+
<td data-value="8" class="abs high">8/8</td>
|
|
92
|
+
<td data-value="75.43" class="pct medium">75.43%</td>
|
|
93
|
+
<td data-value="57" class="abs medium">43/57</td>
|
|
94
|
+
</tr>
|
|
95
|
+
|
|
96
|
+
<tr>
|
|
97
|
+
<td class="file high" data-value="useMap.ts"><a href="useMap.ts.html">useMap.ts</a></td>
|
|
98
|
+
<td data-value="80" class="pic high">
|
|
99
|
+
<div class="chart"><div class="cover-fill" style="width: 80%"></div><div class="cover-empty" style="width: 20%"></div></div>
|
|
100
|
+
</td>
|
|
101
|
+
<td data-value="80" class="pct high">80%</td>
|
|
102
|
+
<td data-value="30" class="abs high">24/30</td>
|
|
103
|
+
<td data-value="57.14" class="pct medium">57.14%</td>
|
|
104
|
+
<td data-value="14" class="abs medium">8/14</td>
|
|
90
105
|
<td data-value="80" class="pct high">80%</td>
|
|
91
106
|
<td data-value="5" class="abs high">4/5</td>
|
|
92
|
-
<td data-value="
|
|
93
|
-
<td data-value="
|
|
107
|
+
<td data-value="79.31" class="pct medium">79.31%</td>
|
|
108
|
+
<td data-value="29" class="abs medium">23/29</td>
|
|
94
109
|
</tr>
|
|
95
110
|
|
|
96
111
|
<tr>
|
|
97
|
-
<td class="file medium" data-value="useMapState.
|
|
98
|
-
<td data-value="
|
|
99
|
-
<div class="chart"><div class="cover-fill" style="width:
|
|
112
|
+
<td class="file medium" data-value="useMapState.ts"><a href="useMapState.ts.html">useMapState.ts</a></td>
|
|
113
|
+
<td data-value="56" class="pic medium">
|
|
114
|
+
<div class="chart"><div class="cover-fill" style="width: 56%"></div><div class="cover-empty" style="width: 44%"></div></div>
|
|
100
115
|
</td>
|
|
101
|
-
<td data-value="
|
|
102
|
-
<td data-value="
|
|
103
|
-
<td data-value="
|
|
104
|
-
<td data-value="
|
|
105
|
-
<td data-value="
|
|
106
|
-
<td data-value="7" class="abs medium">
|
|
107
|
-
<td data-value="
|
|
108
|
-
<td data-value="
|
|
116
|
+
<td data-value="56" class="pct medium">56%</td>
|
|
117
|
+
<td data-value="50" class="abs medium">28/50</td>
|
|
118
|
+
<td data-value="30.76" class="pct low">30.76%</td>
|
|
119
|
+
<td data-value="26" class="abs low">8/26</td>
|
|
120
|
+
<td data-value="57.14" class="pct medium">57.14%</td>
|
|
121
|
+
<td data-value="7" class="abs medium">4/7</td>
|
|
122
|
+
<td data-value="56.25" class="pct medium">56.25%</td>
|
|
123
|
+
<td data-value="48" class="abs medium">27/48</td>
|
|
109
124
|
</tr>
|
|
110
125
|
|
|
111
126
|
<tr>
|
|
@@ -131,7 +146,7 @@
|
|
|
131
146
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
132
147
|
Code coverage generated by
|
|
133
148
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
134
|
-
at
|
|
149
|
+
at Wed Apr 20 2022 08:13:18 GMT+0000 (Coordinated Universal Time)
|
|
135
150
|
</div>
|
|
136
151
|
<script src="../../prettify.js"></script>
|
|
137
152
|
<script>
|