@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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<html lang="en">
|
|
4
4
|
|
|
5
5
|
<head>
|
|
6
|
-
<title>Code coverage report for src/components/
|
|
6
|
+
<title>Code coverage report for src/components/MlImageMarkerLayer/MlImageMarkerLayer.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/
|
|
22
|
+
<h1><a href="../../../index.html">All files</a> / <a href="index.html">src/components/MlImageMarkerLayer</a> MlImageMarkerLayer.tsx</h1>
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">64.86% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>24/37</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">45.45% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>15/33</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">70.58% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>24/34</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line medium'></div>
|
|
65
65
|
<pre><table class="coverage">
|
|
66
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -192,31 +192,7 @@
|
|
|
192
192
|
<a name='L127'></a><a href='#L127'>127</a>
|
|
193
193
|
<a name='L128'></a><a href='#L128'>128</a>
|
|
194
194
|
<a name='L129'></a><a href='#L129'>129</a>
|
|
195
|
-
<a name='L130'></a><a href='#L130'>130</a>
|
|
196
|
-
<a name='L131'></a><a href='#L131'>131</a>
|
|
197
|
-
<a name='L132'></a><a href='#L132'>132</a>
|
|
198
|
-
<a name='L133'></a><a href='#L133'>133</a>
|
|
199
|
-
<a name='L134'></a><a href='#L134'>134</a>
|
|
200
|
-
<a name='L135'></a><a href='#L135'>135</a>
|
|
201
|
-
<a name='L136'></a><a href='#L136'>136</a>
|
|
202
|
-
<a name='L137'></a><a href='#L137'>137</a>
|
|
203
|
-
<a name='L138'></a><a href='#L138'>138</a>
|
|
204
|
-
<a name='L139'></a><a href='#L139'>139</a>
|
|
205
|
-
<a name='L140'></a><a href='#L140'>140</a>
|
|
206
|
-
<a name='L141'></a><a href='#L141'>141</a>
|
|
207
|
-
<a name='L142'></a><a href='#L142'>142</a>
|
|
208
|
-
<a name='L143'></a><a href='#L143'>143</a>
|
|
209
|
-
<a name='L144'></a><a href='#L144'>144</a>
|
|
210
|
-
<a name='L145'></a><a href='#L145'>145</a>
|
|
211
|
-
<a name='L146'></a><a href='#L146'>146</a>
|
|
212
|
-
<a name='L147'></a><a href='#L147'>147</a>
|
|
213
|
-
<a name='L148'></a><a href='#L148'>148</a>
|
|
214
|
-
<a name='L149'></a><a href='#L149'>149</a>
|
|
215
|
-
<a name='L150'></a><a href='#L150'>150</a>
|
|
216
|
-
<a name='L151'></a><a href='#L151'>151</a>
|
|
217
|
-
<a name='L152'></a><a href='#L152'>152</a>
|
|
218
|
-
<a name='L153'></a><a href='#L153'>153</a>
|
|
219
|
-
<a name='L154'></a><a href='#L154'>154</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
195
|
+
<a name='L130'></a><a href='#L130'>130</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
220
196
|
<span class="cline-any cline-neutral"> </span>
|
|
221
197
|
<span class="cline-any cline-neutral"> </span>
|
|
222
198
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -228,46 +204,11 @@
|
|
|
228
204
|
<span class="cline-any cline-neutral"> </span>
|
|
229
205
|
<span class="cline-any cline-neutral"> </span>
|
|
230
206
|
<span class="cline-any cline-neutral"> </span>
|
|
231
|
-
<span class="cline-any cline-yes">1x</span>
|
|
232
|
-
<span class="cline-any cline-yes">4x</span>
|
|
233
|
-
<span class="cline-any cline-yes">4x</span>
|
|
234
207
|
<span class="cline-any cline-neutral"> </span>
|
|
235
|
-
<span class="cline-any cline-yes">4x</span>
|
|
236
|
-
<span class="cline-any cline-yes">4x</span>
|
|
237
208
|
<span class="cline-any cline-neutral"> </span>
|
|
238
209
|
<span class="cline-any cline-neutral"> </span>
|
|
239
|
-
<span class="cline-any cline-yes">4x</span>
|
|
240
|
-
<span class="cline-any cline-yes">4x</span>
|
|
241
210
|
<span class="cline-any cline-neutral"> </span>
|
|
242
|
-
<span class="cline-any cline-yes">4x</span>
|
|
243
|
-
<span class="cline-any cline-yes">2x</span>
|
|
244
211
|
<span class="cline-any cline-neutral"> </span>
|
|
245
|
-
<span class="cline-any cline-yes">2x</span>
|
|
246
|
-
<span class="cline-any cline-yes">1x</span>
|
|
247
|
-
<span class="cline-any cline-yes">1x</span>
|
|
248
|
-
<span class="cline-any cline-yes">1x</span>
|
|
249
|
-
<span class="cline-any cline-neutral"> </span>
|
|
250
|
-
<span class="cline-any cline-yes">1x</span>
|
|
251
|
-
<span class="cline-any cline-neutral"> </span>
|
|
252
|
-
<span class="cline-any cline-neutral"> </span>
|
|
253
|
-
<span class="cline-any cline-neutral"> </span>
|
|
254
|
-
<span class="cline-any cline-yes">4x</span>
|
|
255
|
-
<span class="cline-any cline-yes">4x</span>
|
|
256
|
-
<span class="cline-any cline-neutral"> </span>
|
|
257
|
-
<span class="cline-any cline-neutral"> </span>
|
|
258
|
-
<span class="cline-any cline-yes">2x</span>
|
|
259
|
-
<span class="cline-any cline-yes">2x</span>
|
|
260
|
-
<span class="cline-any cline-neutral"> </span>
|
|
261
|
-
<span class="cline-any cline-yes">2x</span>
|
|
262
|
-
<span class="cline-any cline-yes">2x</span>
|
|
263
|
-
<span class="cline-any cline-no"> </span>
|
|
264
|
-
<span class="cline-any cline-neutral"> </span>
|
|
265
|
-
<span class="cline-any cline-neutral"> </span>
|
|
266
|
-
<span class="cline-any cline-yes">2x</span>
|
|
267
|
-
<span class="cline-any cline-no"> </span>
|
|
268
|
-
<span class="cline-any cline-neutral"> </span>
|
|
269
|
-
<span class="cline-any cline-neutral"> </span>
|
|
270
|
-
<span class="cline-any cline-yes">2x</span>
|
|
271
212
|
<span class="cline-any cline-neutral"> </span>
|
|
272
213
|
<span class="cline-any cline-neutral"> </span>
|
|
273
214
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -284,50 +225,41 @@
|
|
|
284
225
|
<span class="cline-any cline-neutral"> </span>
|
|
285
226
|
<span class="cline-any cline-neutral"> </span>
|
|
286
227
|
<span class="cline-any cline-neutral"> </span>
|
|
228
|
+
<span class="cline-any cline-yes">1x</span>
|
|
229
|
+
<span class="cline-any cline-yes">12x</span>
|
|
287
230
|
<span class="cline-any cline-neutral"> </span>
|
|
288
231
|
<span class="cline-any cline-neutral"> </span>
|
|
289
232
|
<span class="cline-any cline-neutral"> </span>
|
|
290
233
|
<span class="cline-any cline-neutral"> </span>
|
|
234
|
+
<span class="cline-any cline-yes">12x</span>
|
|
235
|
+
<span class="cline-any cline-yes">12x</span>
|
|
236
|
+
<span class="cline-any cline-yes">12x</span>
|
|
291
237
|
<span class="cline-any cline-neutral"> </span>
|
|
292
238
|
<span class="cline-any cline-neutral"> </span>
|
|
293
239
|
<span class="cline-any cline-neutral"> </span>
|
|
294
|
-
<span class="cline-any cline-yes">
|
|
240
|
+
<span class="cline-any cline-yes">12x</span>
|
|
295
241
|
<span class="cline-any cline-yes">4x</span>
|
|
296
242
|
<span class="cline-any cline-neutral"> </span>
|
|
297
243
|
<span class="cline-any cline-neutral"> </span>
|
|
298
|
-
<span class="cline-any cline-yes">2x</span>
|
|
299
244
|
<span class="cline-any cline-neutral"> </span>
|
|
300
245
|
<span class="cline-any cline-neutral"> </span>
|
|
301
246
|
<span class="cline-any cline-yes">4x</span>
|
|
302
247
|
<span class="cline-any cline-neutral"> </span>
|
|
303
248
|
<span class="cline-any cline-neutral"> </span>
|
|
304
249
|
<span class="cline-any cline-neutral"> </span>
|
|
305
|
-
<span class="cline-any cline-no"> </span>
|
|
306
|
-
<span class="cline-any cline-neutral"> </span>
|
|
307
|
-
<span class="cline-any cline-neutral"> </span>
|
|
308
|
-
<span class="cline-any cline-neutral"> </span>
|
|
309
|
-
<span class="cline-any cline-neutral"> </span>
|
|
310
|
-
<span class="cline-any cline-neutral"> </span>
|
|
311
|
-
<span class="cline-any cline-neutral"> </span>
|
|
312
|
-
<span class="cline-any cline-yes">1x</span>
|
|
313
|
-
<span class="cline-any cline-neutral"> </span>
|
|
314
|
-
<span class="cline-any cline-neutral"> </span>
|
|
315
|
-
<span class="cline-any cline-neutral"> </span>
|
|
316
|
-
<span class="cline-any cline-neutral"> </span>
|
|
317
|
-
<span class="cline-any cline-neutral"> </span>
|
|
318
|
-
<span class="cline-any cline-neutral"> </span>
|
|
319
|
-
<span class="cline-any cline-neutral"> </span>
|
|
320
|
-
<span class="cline-any cline-neutral"> </span>
|
|
321
|
-
<span class="cline-any cline-neutral"> </span>
|
|
322
|
-
<span class="cline-any cline-neutral"> </span>
|
|
323
250
|
<span class="cline-any cline-neutral"> </span>
|
|
251
|
+
<span class="cline-any cline-no"> </span>
|
|
252
|
+
<span class="cline-any cline-no"> </span>
|
|
253
|
+
<span class="cline-any cline-no"> </span>
|
|
324
254
|
<span class="cline-any cline-neutral"> </span>
|
|
325
255
|
<span class="cline-any cline-neutral"> </span>
|
|
326
256
|
<span class="cline-any cline-neutral"> </span>
|
|
327
257
|
<span class="cline-any cline-neutral"> </span>
|
|
328
|
-
<span class="cline-any cline-yes">1x</span>
|
|
329
258
|
<span class="cline-any cline-neutral"> </span>
|
|
330
259
|
<span class="cline-any cline-neutral"> </span>
|
|
260
|
+
<span class="cline-any cline-no"> </span>
|
|
261
|
+
<span class="cline-any cline-no"> </span>
|
|
262
|
+
<span class="cline-any cline-no"> </span>
|
|
331
263
|
<span class="cline-any cline-neutral"> </span>
|
|
332
264
|
<span class="cline-any cline-neutral"> </span>
|
|
333
265
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -336,192 +268,188 @@
|
|
|
336
268
|
<span class="cline-any cline-neutral"> </span>
|
|
337
269
|
<span class="cline-any cline-neutral"> </span>
|
|
338
270
|
<span class="cline-any cline-neutral"> </span>
|
|
271
|
+
<span class="cline-any cline-yes">12x</span>
|
|
272
|
+
<span class="cline-any cline-yes">4x</span>
|
|
339
273
|
<span class="cline-any cline-neutral"> </span>
|
|
274
|
+
<span class="cline-any cline-yes">4x</span>
|
|
340
275
|
<span class="cline-any cline-neutral"> </span>
|
|
341
276
|
<span class="cline-any cline-neutral"> </span>
|
|
342
277
|
<span class="cline-any cline-neutral"> </span>
|
|
343
278
|
<span class="cline-any cline-neutral"> </span>
|
|
279
|
+
<span class="cline-any cline-yes">4x</span>
|
|
280
|
+
<span class="cline-any cline-yes">4x</span>
|
|
344
281
|
<span class="cline-any cline-neutral"> </span>
|
|
345
282
|
<span class="cline-any cline-neutral"> </span>
|
|
346
283
|
<span class="cline-any cline-neutral"> </span>
|
|
347
284
|
<span class="cline-any cline-neutral"> </span>
|
|
348
285
|
<span class="cline-any cline-neutral"> </span>
|
|
349
286
|
<span class="cline-any cline-neutral"> </span>
|
|
287
|
+
<span class="cline-any cline-yes">12x</span>
|
|
288
|
+
<span class="cline-any cline-yes">8x</span>
|
|
289
|
+
<span class="cline-any cline-yes">4x</span>
|
|
350
290
|
<span class="cline-any cline-neutral"> </span>
|
|
291
|
+
<span class="cline-any cline-yes">4x</span>
|
|
351
292
|
<span class="cline-any cline-neutral"> </span>
|
|
293
|
+
<span class="cline-any cline-yes">4x</span>
|
|
294
|
+
<span class="cline-any cline-yes">4x</span>
|
|
295
|
+
<span class="cline-any cline-no"> </span>
|
|
352
296
|
<span class="cline-any cline-neutral"> </span>
|
|
297
|
+
<span class="cline-any cline-no"> </span>
|
|
353
298
|
<span class="cline-any cline-neutral"> </span>
|
|
299
|
+
<span class="cline-any cline-no"> </span>
|
|
354
300
|
<span class="cline-any cline-neutral"> </span>
|
|
355
301
|
<span class="cline-any cline-neutral"> </span>
|
|
356
302
|
<span class="cline-any cline-neutral"> </span>
|
|
303
|
+
<span class="cline-any cline-yes">4x</span>
|
|
357
304
|
<span class="cline-any cline-neutral"> </span>
|
|
358
305
|
<span class="cline-any cline-neutral"> </span>
|
|
306
|
+
<span class="cline-any cline-yes">12x</span>
|
|
307
|
+
<span class="cline-any cline-yes">4x</span>
|
|
359
308
|
<span class="cline-any cline-neutral"> </span>
|
|
360
309
|
<span class="cline-any cline-neutral"> </span>
|
|
361
310
|
<span class="cline-any cline-neutral"> </span>
|
|
362
311
|
<span class="cline-any cline-neutral"> </span>
|
|
312
|
+
<span class="cline-any cline-yes">4x</span>
|
|
363
313
|
<span class="cline-any cline-neutral"> </span>
|
|
364
314
|
<span class="cline-any cline-neutral"> </span>
|
|
315
|
+
<span class="cline-any cline-no"> </span>
|
|
365
316
|
<span class="cline-any cline-neutral"> </span>
|
|
366
317
|
<span class="cline-any cline-neutral"> </span>
|
|
367
318
|
<span class="cline-any cline-neutral"> </span>
|
|
368
319
|
<span class="cline-any cline-neutral"> </span>
|
|
320
|
+
<span class="cline-any cline-yes">12x</span>
|
|
369
321
|
<span class="cline-any cline-neutral"> </span>
|
|
370
322
|
<span class="cline-any cline-neutral"> </span>
|
|
371
323
|
<span class="cline-any cline-neutral"> </span>
|
|
372
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, {
|
|
373
|
-
import PropTypes from "prop-types";
|
|
374
|
-
import { MapContext } from "@mapcomponents/react-core";
|
|
324
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React, { useRef, useCallback, useEffect } from "react";
|
|
375
325
|
|
|
376
|
-
import {
|
|
377
|
-
import
|
|
326
|
+
import { GeoJSONSource } from "maplibre-gl";
|
|
327
|
+
import useMap from "../../hooks/useMap";
|
|
378
328
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
329
|
+
interface MlImageMarkerLayerProps {
|
|
330
|
+
/**
|
|
331
|
+
* Id of the target MapLibre instance in mapContext
|
|
332
|
+
*/
|
|
333
|
+
mapId?: string;
|
|
334
|
+
/**
|
|
335
|
+
* The layerId of an existing layer this layer should be rendered visually beneath
|
|
336
|
+
* https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see "beforeId" property
|
|
337
|
+
*/
|
|
338
|
+
insertBeforeLayer?: string;
|
|
339
|
+
/**
|
|
340
|
+
* Id of the layer that will be added by this component to the maplibre-gl instance
|
|
341
|
+
*/
|
|
342
|
+
layerId?: string;
|
|
343
|
+
/**
|
|
344
|
+
* Id of the image that will be added by this component to the maplibre-gl instance
|
|
345
|
+
*/
|
|
346
|
+
imageId?: string;
|
|
347
|
+
/**
|
|
348
|
+
* Path or URL to a supported raster image
|
|
349
|
+
*/
|
|
350
|
+
imgSrc?: string;
|
|
351
|
+
/**
|
|
352
|
+
* Javascript object that is passed the addLayer command as first parameter.
|
|
353
|
+
*/
|
|
354
|
+
options?: any;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
const MlImageMarkerLayer = (props: MlImageMarkerLayerProps) => {
|
|
358
|
+
const mapHook = useMap({
|
|
359
|
+
mapId: props.mapId,
|
|
360
|
+
waitForLayer: props.insertBeforeLayer,
|
|
361
|
+
});
|
|
387
362
|
|
|
388
|
-
const
|
|
389
|
-
const
|
|
390
|
-
|
|
363
|
+
const layerInitializedRef = useRef(false);
|
|
364
|
+
const imageIdRef = useRef(props.imageId || "img_" + new Date().getTime());
|
|
365
|
+
const layerId = useRef(
|
|
366
|
+
props.layerId || "MlImageMarkerLayer-" + mapHook.componentId
|
|
391
367
|
);
|
|
392
|
-
const initializedRef = useRef(false);
|
|
393
|
-
const layerId = useRef(props.layerId || "MlFillExtrusionLayer-" + uuidv4());
|
|
394
368
|
|
|
395
369
|
useEffect(() => {
|
|
396
|
-
|
|
370
|
+
<span class="missing-if-branch" title="else path not taken" >E</span>if (
|
|
371
|
+
!mapHook.map ||
|
|
372
|
+
(<span class="branch-1 cbranch-no" title="branch not covered" >mapHook.map </span>&& <span class="branch-2 cbranch-no" title="branch not covered" >!mapHook.map.map.getLayer(layerId.current))</span> ||
|
|
373
|
+
<span class="branch-3 cbranch-no" title="branch not covered" > !props.options</span>
|
|
374
|
+
)
|
|
375
|
+
return;
|
|
376
|
+
// the MapLibre-gl instance (mapContext.map) is accessible here
|
|
377
|
+
// initialize the layer and add it to the MapLibre-gl instance or do something else with it
|
|
378
|
+
var key;
|
|
397
379
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
380
|
+
<span class="cstat-no" title="statement not covered" > if (props.options.layout) {</span>
|
|
381
|
+
<span class="cstat-no" title="statement not covered" > for (key in props.options.layout) {</span>
|
|
382
|
+
<span class="cstat-no" title="statement not covered" > mapHook.map.map.setLayoutProperty(</span>
|
|
383
|
+
layerId.current,
|
|
384
|
+
key,
|
|
385
|
+
props.options.layout[key]
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
<span class="cstat-no" title="statement not covered" > if (props.options.paint) {</span>
|
|
390
|
+
<span class="cstat-no" title="statement not covered" > for (key in props.options.paint) {</span>
|
|
391
|
+
<span class="cstat-no" title="statement not covered" > mapHook.map.map.setPaintProperty(</span>
|
|
392
|
+
layerId.current,
|
|
393
|
+
key,
|
|
394
|
+
props.options.paint[key]
|
|
395
|
+
);
|
|
402
396
|
}
|
|
403
|
-
|
|
397
|
+
}
|
|
398
|
+
}, [props.options, layerId.current, props.mapId]);
|
|
399
|
+
|
|
400
|
+
const addLayer = useCallback(() => {
|
|
401
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if(!mapHook.map)<span class="cstat-no" title="statement not covered" >return;</span>
|
|
402
|
+
|
|
403
|
+
let tmpOptions = {
|
|
404
|
+
id: layerId.current,
|
|
405
|
+
layout: {},
|
|
406
|
+
...props.options,
|
|
404
407
|
};
|
|
405
|
-
|
|
408
|
+
tmpOptions.layout["icon-image"] = imageIdRef.current;
|
|
409
|
+
mapHook.map.addLayer(
|
|
410
|
+
tmpOptions,
|
|
411
|
+
props.insertBeforeLayer,
|
|
412
|
+
mapHook.componentId
|
|
413
|
+
);
|
|
414
|
+
}, [props, mapHook.map]);
|
|
406
415
|
|
|
407
416
|
useEffect(() => {
|
|
408
|
-
if (!
|
|
409
|
-
|
|
410
|
-
// initialize the layer and add it to the MapLibre-gl instance or do something else with it
|
|
411
|
-
initializedRef.current = true;
|
|
412
|
-
mapRef.current = mapContext.getMap(props.mapId);
|
|
417
|
+
if (!props.options || !mapHook.map || layerInitializedRef.current)
|
|
418
|
+
return;
|
|
413
419
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
<span class="
|
|
417
|
-
|
|
420
|
+
layerInitializedRef.current = true;
|
|
421
|
+
|
|
422
|
+
<span class="missing-if-branch" title="else path not taken" >E</span>if (props.imgSrc) {
|
|
423
|
+
mapHook.map.map.loadImage(props.imgSrc, <span class="fstat-no" title="function not covered" >fu</span>nction (error, image) {
|
|
424
|
+
<span class="cstat-no" title="statement not covered" > if (error) <span class="cstat-no" title="statement not covered" >throw error;</span></span>
|
|
425
|
+
|
|
426
|
+
<span class="cstat-no" title="statement not covered" > if(!mapHook.map)<span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
418
427
|
|
|
419
|
-
|
|
420
|
-
|
|
428
|
+
<span class="cstat-no" title="statement not covered" > mapHook.map.addImage(imageIdRef.current, image, mapHook.componentId);</span>
|
|
429
|
+
});
|
|
421
430
|
}
|
|
422
431
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
id: layerId.current,
|
|
426
|
-
type: "fill-extrusion",
|
|
427
|
-
source: props.sourceId || "openmaptiles",
|
|
428
|
-
"source-layer": props.sourceLayer || "building",
|
|
429
|
-
minzoom: props.minZoom || 14,
|
|
430
|
-
paint: {
|
|
431
|
-
...props.paint,
|
|
432
|
-
},
|
|
433
|
-
},
|
|
434
|
-
props.insertBeforeLayer || lastLabelLayerId,
|
|
435
|
-
componentId.current
|
|
436
|
-
);
|
|
437
|
-
}, [
|
|
438
|
-
mapContext,
|
|
439
|
-
props.insertBeforeLayer,
|
|
440
|
-
props.mapId,
|
|
441
|
-
props.minZoom,
|
|
442
|
-
props.paint,
|
|
443
|
-
props.sourceId,
|
|
444
|
-
props.sourceLayer,
|
|
445
|
-
]);
|
|
432
|
+
addLayer();
|
|
433
|
+
}, [mapHook.map, addLayer, props]);
|
|
446
434
|
|
|
447
435
|
useEffect(() => {
|
|
448
|
-
if (
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
<Button
|
|
456
|
-
color="primary"
|
|
457
|
-
variant={showLayer ? "contained" : <span class="branch-1 cbranch-no" title="branch not covered" >"outlined"}</span>
|
|
458
|
-
onClick={<span class="fstat-no" title="function not covered" >()</span> => <span class="cstat-no" title="statement not covered" >setShowLayer(!showLayer)}</span>
|
|
459
|
-
>
|
|
460
|
-
Composite
|
|
461
|
-
</Button>
|
|
462
|
-
);
|
|
463
|
-
};
|
|
436
|
+
<span class="missing-if-branch" title="else path not taken" >E</span>if (
|
|
437
|
+
!mapHook.map ||
|
|
438
|
+
(<span class="branch-1 cbranch-no" title="branch not covered" >mapHook.map </span>&& <span class="branch-2 cbranch-no" title="branch not covered" >!mapHook.map.map.getLayer(layerId.current))</span> ||
|
|
439
|
+
<span class="branch-3 cbranch-no" title="branch not covered" > !props.options</span>
|
|
440
|
+
) {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
464
443
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
"fill-extrusion-height": {
|
|
470
|
-
property: "render_height",
|
|
471
|
-
type: "identity",
|
|
472
|
-
},
|
|
473
|
-
"fill-extrusion-base": {
|
|
474
|
-
property: "render_min_height",
|
|
475
|
-
type: "identity",
|
|
476
|
-
},
|
|
477
|
-
"fill-extrusion-opacity": 1,
|
|
478
|
-
},
|
|
479
|
-
};
|
|
444
|
+
<span class="cstat-no" title="statement not covered" > (mapHook.map.map</span>
|
|
445
|
+
.getSource(layerId.current) as GeoJSONSource)
|
|
446
|
+
.setData(props.options.source.data);
|
|
447
|
+
}, [props.options.source.data, props]);
|
|
480
448
|
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* Id of the target MapLibre instance in mapContext
|
|
484
|
-
*/
|
|
485
|
-
mapId: PropTypes.string,
|
|
486
|
-
/**
|
|
487
|
-
* Id of the layer that will be added by this component
|
|
488
|
-
*/
|
|
489
|
-
layerId: PropTypes.string,
|
|
490
|
-
/**
|
|
491
|
-
* Prefix of the component id this component uses when adding elements to the MapLibreGl-instance
|
|
492
|
-
*/
|
|
493
|
-
idPrefix: PropTypes.string,
|
|
494
|
-
/**
|
|
495
|
-
* Paint properties of the config object that is passed to the MapLibreGl.addLayer call. All
|
|
496
|
-
* available properties are documented in the MapLibreGl documentation
|
|
497
|
-
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill-extrusion
|
|
498
|
-
*/
|
|
499
|
-
paint: PropTypes.object,
|
|
500
|
-
/**
|
|
501
|
-
* Source id of a vector tile source containing the geometries to use for this fill-extrusion
|
|
502
|
-
* layer.
|
|
503
|
-
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#source-layer
|
|
504
|
-
*/
|
|
505
|
-
sourceId: PropTypes.string,
|
|
506
|
-
/**
|
|
507
|
-
* Layer id from a vector tile source containing the geometries to use for this fill-extrusion
|
|
508
|
-
* layer.
|
|
509
|
-
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#source-layer
|
|
510
|
-
*/
|
|
511
|
-
sourceLayer: PropTypes.string,
|
|
512
|
-
/**
|
|
513
|
-
* This layer will be hidde for zoom levels lower than defined on this property
|
|
514
|
-
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#minzoom
|
|
515
|
-
*/
|
|
516
|
-
minZoom: PropTypes.number,
|
|
517
|
-
/**
|
|
518
|
-
* The layerId of an existing layer this layer should be rendered visually beneath
|
|
519
|
-
* https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see "beforeId" property
|
|
520
|
-
*/
|
|
521
|
-
insertBeforeLayer: PropTypes.string,
|
|
449
|
+
return <></>;
|
|
522
450
|
};
|
|
523
451
|
|
|
524
|
-
export default
|
|
452
|
+
export default MlImageMarkerLayer;
|
|
525
453
|
</pre></td></tr></table></pre>
|
|
526
454
|
|
|
527
455
|
<div class='push'></div><!-- for sticky footer -->
|
|
@@ -529,7 +457,7 @@ export default MlFillExtrusionLayer;
|
|
|
529
457
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
530
458
|
Code coverage generated by
|
|
531
459
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
532
|
-
at
|
|
460
|
+
at Wed Apr 20 2022 08:13:18 GMT+0000 (Coordinated Universal Time)
|
|
533
461
|
</div>
|
|
534
462
|
<script src="../../../prettify.js"></script>
|
|
535
463
|
<script>
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">64.86% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>24/37</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">45.45% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>15/33</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">70.
|
|
47
|
+
<span class="strong">70.58% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>24/34</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 medium" data-value="MlImageMarkerLayer.
|
|
83
|
-
<td data-value="
|
|
84
|
-
<div class="chart"><div class="cover-fill" style="width:
|
|
82
|
+
<td class="file medium" data-value="MlImageMarkerLayer.tsx"><a href="MlImageMarkerLayer.tsx.html">MlImageMarkerLayer.tsx</a></td>
|
|
83
|
+
<td data-value="64.86" class="pic medium">
|
|
84
|
+
<div class="chart"><div class="cover-fill" style="width: 64%"></div><div class="cover-empty" style="width: 36%"></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="64.86" class="pct medium">64.86%</td>
|
|
87
|
+
<td data-value="37" class="abs medium">24/37</td>
|
|
88
|
+
<td data-value="45.45" class="pct low">45.45%</td>
|
|
89
|
+
<td data-value="33" class="abs low">15/33</td>
|
|
90
90
|
<td data-value="83.33" class="pct high">83.33%</td>
|
|
91
91
|
<td data-value="6" class="abs high">5/6</td>
|
|
92
|
-
<td data-value="70.
|
|
93
|
-
<td data-value="
|
|
92
|
+
<td data-value="70.58" class="pct medium">70.58%</td>
|
|
93
|
+
<td data-value="34" class="abs medium">24/34</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>
|