@mapcomponents/react-maplibre 0.1.46 → 0.1.51
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/.github/workflows/node_version_test.yml +2 -1
- package/CHANGELOG.md +35 -0
- package/README.md +61 -150
- package/coverage/clover.xml +233 -226
- package/coverage/coverage-final.json +9 -9
- package/coverage/lcov-report/index.html +34 -34
- package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +25 -25
- package/coverage/lcov-report/src/components/MapLibreMap/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +72 -66
- package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +18 -18
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFollowGps/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGPXViewer/MlGPXViewer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +1 -1
- package/coverage/lcov-report/src/components/MlGPXViewer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +26 -11
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
- 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.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
- package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +103 -22
- package/coverage/lcov-report/src/components/MlMeasureTool/index.html +15 -15
- package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationTools/index.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.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 +1 -1
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +22 -19
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
- 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.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +1 -1
- 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.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +2 -2
- package/coverage/lcov-report/src/components/MlWmsLoader/index.html +1 -1
- package/coverage/lcov-report/src/contexts/MapContext.tsx.html +23 -23
- package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
- package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
- package/coverage/lcov-report/src/contexts/index.html +1 -1
- package/coverage/lcov-report/src/hooks/index.html +15 -15
- package/coverage/lcov-report/src/hooks/useLayer.ts.html +78 -69
- package/coverage/lcov-report/src/hooks/useMap.ts.html +25 -25
- package/coverage/lcov-report/src/hooks/useMapState.ts.html +28 -28
- package/coverage/lcov-report/src/hooks/useWms.js.html +2 -2
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.ts.html +5 -2
- package/coverage/lcov.info +464 -443
- package/dist/components/MapLibreMap/MapLibreMap.d.ts +31 -0
- package/dist/components/MapLibreMap/MapLibreMap.stories.d.ts +15 -0
- package/dist/components/MapLibreMap/MapLibreMap.test.d.ts +1 -0
- package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +76 -0
- package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.test.d.ts +1 -0
- package/dist/components/MlBasicComponent.d.ts +5 -0
- package/dist/components/MlComponentTemplate/MlComponentTemplate.d.ts +22 -0
- package/dist/components/MlComponentTemplate/MlComponentTemplate.stories.d.ts +10 -0
- package/dist/components/MlCreatePdfButton/MlCreatePdfButton.d.ts +21 -0
- package/dist/components/MlCreatePdfButton/MlCreatePdfButton.stories.d.ts +10 -0
- package/dist/components/MlCreatePdfButton/lib/createPdf.d.ts +2 -0
- package/dist/components/MlCreatePdfButton/lib/nominatimMap.d.ts +2 -0
- package/dist/components/MlFeatureEditor/MlFeatureEditor.d.ts +35 -0
- package/dist/components/MlFeatureEditor/MlFeatureEditor.stories.d.ts +15 -0
- package/dist/components/MlFeatureEditor/MlFeatureEditor.test.d.ts +1 -0
- package/dist/components/MlFeatureEditor/custom-direct-select-mode.d.ts +37 -0
- package/dist/components/MlFeatureEditor/custom-polygon-mode.d.ts +16 -0
- package/dist/components/MlFeatureEditor/custom-select-mode.d.ts +37 -0
- package/dist/components/MlFeatureEditor/lib/common_selectors.d.ts +11 -0
- package/dist/components/MlFeatureEditor/lib/constants.d.ts +85 -0
- package/dist/components/MlFeatureEditor/lib/constrain_feature_movement.d.ts +2 -0
- package/dist/components/MlFeatureEditor/lib/create_midpoint.d.ts +15 -0
- package/dist/components/MlFeatureEditor/lib/create_supplementary_points.d.ts +2 -0
- package/dist/components/MlFeatureEditor/lib/create_vertex.d.ts +13 -0
- package/dist/components/MlFeatureEditor/lib/double_click_zoom.d.ts +7 -0
- package/dist/components/MlFeatureEditor/lib/euclidean_distance.d.ts +5 -0
- package/dist/components/MlFeatureEditor/lib/features_at.d.ts +7 -0
- package/dist/components/MlFeatureEditor/lib/get_features_and_set_cursor.d.ts +1 -0
- package/dist/components/MlFeatureEditor/lib/is_click.d.ts +1 -0
- package/dist/components/MlFeatureEditor/lib/is_event_at_coordinates.d.ts +6 -0
- package/dist/components/MlFeatureEditor/lib/is_tap.d.ts +3 -0
- package/dist/components/MlFeatureEditor/lib/map_event_to_bounding_box.d.ts +12 -0
- package/dist/components/MlFeatureEditor/lib/mode_handler.d.ts +24 -0
- package/dist/components/MlFeatureEditor/lib/mouse_event_point.d.ts +11 -0
- package/dist/components/MlFeatureEditor/lib/move_features.d.ts +2 -0
- package/dist/components/MlFeatureEditor/lib/sort_features.d.ts +2 -0
- package/dist/components/MlFeatureEditor/lib/string_set.d.ts +21 -0
- package/dist/components/MlFeatureEditor/lib/string_sets_are_equal.d.ts +5 -0
- package/dist/components/MlFeatureEditor/lib/theme.d.ts +88 -0
- package/dist/components/MlFeatureEditor/lib/to_dense_array.d.ts +12 -0
- package/dist/components/MlFeatureEditor/lib/utils.d.ts +10 -0
- package/dist/components/MlFillExtrusionLayer/MlFillExtrusionLayer.d.ts +61 -0
- package/dist/components/MlFillExtrusionLayer/MlFillExtrusionLayer.stories.d.ts +10 -0
- package/dist/components/MlFillExtrusionLayer/MlFillExtrusionLayer.test.d.ts +1 -0
- package/dist/components/MlFollowGps/MlFollowGps.d.ts +80 -0
- package/dist/components/MlFollowGps/MlFollowGps.stories.d.ts +10 -0
- package/dist/components/MlFollowGps/MlFollowGps.test.d.ts +1 -0
- package/dist/components/MlGPXViewer/MlGPXViewer.d.ts +29 -0
- package/dist/components/MlGPXViewer/MlGPXViewer.stories.d.ts +16 -0
- package/dist/components/MlGPXViewer/MlGPXViewer.test.d.ts +1 -0
- package/dist/components/MlGPXViewer/gpxConverter.d.ts +11 -0
- package/dist/components/MlGPXViewer/util/GeoJsonContext.d.ts +10 -0
- package/dist/components/MlGPXViewer/util/GeoJsonProvider.d.ts +4 -0
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +76 -0
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +12 -0
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.test.d.ts +1 -0
- package/dist/components/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry.d.ts +2 -0
- package/dist/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.d.ts +2 -0
- package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.d.ts +29 -0
- package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.d.ts +10 -0
- package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.test.d.ts +1 -0
- package/dist/components/MlLayer/MlLayer.d.ts +26 -0
- package/dist/components/MlLayer/MlLayer.stories.d.ts +10 -0
- package/dist/components/MlLayer/MlLayer.test.d.ts +1 -0
- package/dist/components/MlLayerMagnify/MlLayerMagnify.d.ts +27 -0
- package/dist/components/MlLayerMagnify/MlLayerMagnify.stories.d.ts +10 -0
- package/dist/components/MlLayerMagnify/MlLayerMagnify.test.d.ts +1 -0
- package/dist/components/MlLayerSwipe/MlLayerSwipe.d.ts +16 -0
- package/dist/components/MlLayerSwipe/MlLayerSwipe.stories.d.ts +11 -0
- package/dist/components/MlLayerSwipe/MlLayerSwipe.test.d.ts +1 -0
- package/dist/components/MlLayerSwitcher/MlLayerSwitcher.d.ts +30 -0
- package/dist/components/MlLayerSwitcher/MlLayerSwitcher.stories.d.ts +13 -0
- package/dist/components/MlLayerSwitcher/components/LayerBox.d.ts +6 -0
- package/dist/components/MlMarker/MlMarker.d.ts +33 -0
- package/dist/components/MlMarker/MlMarker.stories.d.ts +9 -0
- package/dist/components/MlMeasureTool/MlMeasureTool.d.ts +20 -0
- package/dist/components/MlMeasureTool/MlMeasureTool.stories.d.ts +11 -0
- package/dist/components/MlNavigationCompass/MlNavigationCompass.d.ts +47 -0
- package/dist/components/MlNavigationCompass/MlNavigationCompass.stories.d.ts +10 -0
- package/dist/components/MlNavigationCompass/MlNavigationCompass.test.d.ts +1 -0
- package/dist/components/MlNavigationTools/MlNavigationTools.d.ts +9 -0
- package/dist/components/MlNavigationTools/MlNavigationTools.stories.d.ts +13 -0
- package/dist/components/MlOsmLayer/MlOsmLayer.d.ts +18 -0
- package/dist/components/MlOsmLayer/MlOsmLayer.stories_.d.ts +16 -0
- package/dist/components/MlOsmLayer/MlOsmLayer.test.d.ts +1 -0
- package/dist/components/MlScaleReference/MlScaleReference.d.ts +2 -0
- package/dist/components/MlScaleReference/MlScaleReference.stories.d.ts +14 -0
- package/dist/components/MlShareMapState/MlShareMapState.d.ts +22 -0
- package/dist/components/MlShareMapState/MlShareMapState.stories.d.ts +10 -0
- package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.d.ts +20 -0
- package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.d.ts +16 -0
- package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.test.d.ts +1 -0
- package/dist/components/MlThreeJsLayer/MlThreeJsLayer.d.ts +15 -0
- package/dist/components/MlThreeJsLayer/MlThreeJsLayer.stories.d.ts +16 -0
- package/dist/components/MlThreeJsLayer/MlThreeJsLayer.test.d.ts +1 -0
- package/dist/components/MlThreeJsLayer/lib/GLTFLoader.d.ts +17 -0
- package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +73 -0
- package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.stories.d.ts +13 -0
- package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.test.d.ts +1 -0
- package/dist/components/MlTransitionGeoJsonLayer/util/transitionFunctions.d.ts +2 -0
- package/dist/components/MlUseMapDebugger/MlUseMapDebugger.d.ts +22 -0
- package/dist/components/MlUseMapDebugger/MlUseMapDebugger.stories.d.ts +13 -0
- package/dist/components/MlVectorTileLayer/MlVectorTileLayer.d.ts +37 -0
- package/dist/components/MlVectorTileLayer/MlVectorTileLayer.stories.d.ts +13 -0
- package/dist/components/MlVectorTileLayer/MlVectorTileLayer.test.d.ts +1 -0
- package/dist/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.d.ts +22 -0
- package/dist/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.stories.d.ts +13 -0
- package/dist/components/MlWmsLayer/MlWmsLayer.d.ts +100 -0
- package/dist/components/MlWmsLayer/MlWmsLayer.stories.d.ts +13 -0
- package/dist/components/MlWmsLayer/MlWmsLayer.test.d.ts +1 -0
- package/dist/components/MlWmsLoader/MlWmsLoader.d.ts +48 -0
- package/dist/components/MlWmsLoader/MlWmsLoader.stories.d.ts +13 -0
- package/dist/contexts/MapComponentsProvider.test.d.ts +1 -0
- package/dist/contexts/MapContext.d.ts +13 -0
- package/dist/contexts/SimpleDataContext.d.ts +4 -0
- package/dist/contexts/SimpleDataProvider.d.ts +8 -0
- package/dist/contexts/SimpleDataProvider.test.d.ts +1 -0
- package/dist/custom.d.d.ts +22 -0
- package/dist/decorators/MapContextDecorator.d.ts +2 -0
- package/dist/decorators/MultiMapContextDecorator.d.ts +2 -0
- package/dist/hooks/useLayer.d.ts +26 -0
- package/dist/hooks/useLayer.test.d.ts +1 -0
- package/dist/hooks/useMap.d.ts +14 -0
- package/dist/hooks/useMapState.d.ts +62 -0
- package/dist/hooks/useMapState.stories.d.ts +14 -0
- package/dist/hooks/useWms.d.ts +18 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.esm.js +66 -24
- package/dist/index.esm.js.map +1 -1
- package/dist/setupTests.d.ts +12 -0
- package/dist/stories/components/Readme.d.ts +2 -0
- package/dist/ui_components/ImageLoader.d.ts +2 -0
- package/dist/ui_components/Legend.d.ts +1 -0
- package/dist/ui_components/LoadingOverlay.d.ts +2 -0
- package/dist/ui_components/LoadingOverlayContext.d.ts +11 -0
- package/dist/ui_components/Sidebar.d.ts +1 -0
- package/dist/ui_components/Tooltip.d.ts +1 -0
- package/dist/ui_components/TopToolbar.d.ts +1 -0
- package/dist/util/index.d.ts +3 -0
- package/dist/util/layerRemovalTest.d.ts +2 -0
- package/dist/util/sourceRemovalTest.d.ts +2 -0
- package/package.json +2 -1
- package/public/catalogue/mc_meta.json +1 -0
- package/src/components/MapLibreMap/MapLibreMap.tsx +1 -1
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +4 -3
- package/src/components/MlFeatureEditor/MlFeatureEditor.stories.js +1 -2
- package/src/components/MlFeatureEditor/MlFeatureEditor.test.js +3 -3
- package/src/components/MlFeatureEditor/MlFeatureEditor.tsx +40 -38
- package/src/components/MlFeatureEditor/lib/utils.js +1 -2
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +14 -9
- package/src/components/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry.ts +2 -1
- package/src/components/MlMeasureTool/MlMeasureTool.stories.js +68 -39
- package/src/components/MlMeasureTool/MlMeasureTool.tsx +38 -11
- package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx +18 -17
- package/src/components/MlWmsLoader/MlWmsLoader.stories.js +1 -1
- package/src/components/MlWmsLoader/MlWmsLoader.tsx +1 -1
- package/src/hooks/useLayer.test.js +205 -0
- package/src/hooks/useLayer.ts +11 -8
- package/src/hooks/useWms.js +1 -1
- package/src/index.ts +1 -0
- package/tsconfig.json +35 -7
- package/docs-build/0.0ee4f98c.iframe.bundle.js +0 -2
- package/docs-build/0.0ee4f98c.iframe.bundle.js.map +0 -1
- package/docs-build/0.20735a16c2ad9677fe7d.manager.bundle.js +0 -1
- package/docs-build/1.bb3cf738.iframe.bundle.js +0 -10
- package/docs-build/1.bb3cf738.iframe.bundle.js.map +0 -1
- package/docs-build/17.97db5b3f.iframe.bundle.js +0 -2
- package/docs-build/17.97db5b3f.iframe.bundle.js.map +0 -1
- package/docs-build/18.f8d843df.iframe.bundle.js +0 -17
- package/docs-build/18.f8d843df.iframe.bundle.js.map +0 -1
- package/docs-build/19.c45e6b08.iframe.bundle.js +0 -14
- package/docs-build/19.c45e6b08.iframe.bundle.js.map +0 -1
- package/docs-build/2.42c790e4.iframe.bundle.js +0 -2
- package/docs-build/2.42c790e4.iframe.bundle.js.map +0 -1
- package/docs-build/20.120bbcfb.iframe.bundle.js +0 -2
- package/docs-build/20.120bbcfb.iframe.bundle.js.map +0 -1
- package/docs-build/21.37c885f1.iframe.bundle.js +0 -4
- package/docs-build/21.37c885f1.iframe.bundle.js.map +0 -1
- package/docs-build/22.7fbc99f4.iframe.bundle.js +0 -22
- package/docs-build/22.7fbc99f4.iframe.bundle.js.map +0 -1
- package/docs-build/3.1a37a83e.iframe.bundle.js +0 -2
- package/docs-build/3.1a37a83e.iframe.bundle.js.map +0 -1
- package/docs-build/4.8ac31bba1926f4f011b0.manager.bundle.js +0 -2
- package/docs-build/4.8ac31bba1926f4f011b0.manager.bundle.js.LICENSE.txt +0 -8
- package/docs-build/5.daf044a6c0f55d839078.manager.bundle.js +0 -1
- package/docs-build/6.99fba2cf6af0473f8209.manager.bundle.js +0 -2
- package/docs-build/6.99fba2cf6af0473f8209.manager.bundle.js.LICENSE.txt +0 -12
- package/docs-build/7.b6a48b90f61cb575c2e4.manager.bundle.js +0 -1
- package/docs-build/8.50518a5391398d9d5812.manager.bundle.js +0 -1
- package/docs-build/assets/3D/godzilla_simple.glb +0 -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 +0 -716
- package/docs-build/catalogue/.gitkeep +0 -0
- package/docs-build/catalogue/mc_meta.json +0 -1
- package/docs-build/favicon.ico +0 -0
- package/docs-build/iframe.html +0 -348
- package/docs-build/index.html +0 -59
- package/docs-build/logo.png +0 -0
- package/docs-build/main.ef9704b1252e8efa56a0.manager.bundle.js +0 -1
- package/docs-build/main~24120820.905c51c8.iframe.bundle.js +0 -2
- package/docs-build/main~24120820.905c51c8.iframe.bundle.js.map +0 -1
- package/docs-build/manifest.json +0 -25
- package/docs-build/robots.txt +0 -3
- package/docs-build/runtime~main.6e6ed7dc9ea4785ef286.manager.bundle.js +0 -1
- 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/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/MlMeasureTool.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.4b570b3072ba06ee44b5.manager.bundle.js +0 -2
- package/docs-build/vendors~main.4b570b3072ba06ee44b5.manager.bundle.js.LICENSE.txt +0 -104
- package/docs-build/vendors~main~0ad7406a.93aea1be.iframe.bundle.js +0 -8
- package/docs-build/vendors~main~0ad7406a.93aea1be.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~0f485567.6e7163ef.iframe.bundle.js +0 -2
- package/docs-build/vendors~main~0f485567.6e7163ef.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~41a6ab2c.da377733.iframe.bundle.js +0 -2
- package/docs-build/vendors~main~41a6ab2c.da377733.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~52589227.cebbe724.iframe.bundle.js +0 -8
- package/docs-build/vendors~main~52589227.cebbe724.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~57c1f6cb.86178471.iframe.bundle.js +0 -2
- package/docs-build/vendors~main~57c1f6cb.86178471.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~73914085.e2f34f8e.iframe.bundle.js +0 -293
- package/docs-build/vendors~main~73914085.e2f34f8e.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~9c5b28f6.eefa7445.iframe.bundle.js +0 -7
- package/docs-build/vendors~main~9c5b28f6.eefa7445.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~b5906859.210afc21.iframe.bundle.js +0 -21
- package/docs-build/vendors~main~b5906859.210afc21.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~b8f44717.7b869975.iframe.bundle.js +0 -89
- package/docs-build/vendors~main~b8f44717.7b869975.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~b9cf3951.62d39717.iframe.bundle.js +0 -63
- package/docs-build/vendors~main~b9cf3951.62d39717.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~d939e436.394e3bc7.iframe.bundle.js +0 -2
- package/docs-build/vendors~main~d939e436.394e3bc7.iframe.bundle.js.map +0 -1
- package/docs-build/vendors~main~f420d588.88814a6a.iframe.bundle.js +0 -107
- package/docs-build/vendors~main~f420d588.88814a6a.iframe.bundle.js.map +0 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import PropTypes from "prop-types";
|
|
2
|
+
interface MlWmsLayerProps {
|
|
3
|
+
urlParameters?: any;
|
|
4
|
+
url: string;
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
attribution?: string;
|
|
7
|
+
mapId?: string;
|
|
8
|
+
sourceOptions?: any;
|
|
9
|
+
layerOptions?: any;
|
|
10
|
+
insertBeforeLayer?: string;
|
|
11
|
+
layerId?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Adds a WMS raster source & layer to the maplibre-gl instance
|
|
15
|
+
*
|
|
16
|
+
* @param {object} props
|
|
17
|
+
* @param {object} props.urlParameters URL query parameters that will be added to the WMS URL. A layers property (string) is mandatory. Any value defined on this attribute will extend the default object
|
|
18
|
+
* @param {string} props.url WMS URL
|
|
19
|
+
* @param {bool} props.visible Sets layer "visibility" property to "visible" if true or "none" if false
|
|
20
|
+
* @param {string} props.attribution MapLibre attribution shown in the bottom right of the map, if this layer is visible
|
|
21
|
+
* @param {string} props.mapId Id of the target MapLibre instance in mapContext
|
|
22
|
+
* @param {object} props.sourceOptions Object that is passed to the MapLibre.addSource call as config option parameter
|
|
23
|
+
* @param {object} props.layerOptions Object that is passed to the MapLibre.addLayer call as config option parameter
|
|
24
|
+
* @param {string} props.insertBeforeLayer Id of an existing layer in the mapLibre instance to help specify the layer order
|
|
25
|
+
This layer will be visually beneath the layer with the "insertBeforeLayer" id
|
|
26
|
+
*
|
|
27
|
+
* @component
|
|
28
|
+
*/
|
|
29
|
+
declare const MlWmsLayer: {
|
|
30
|
+
(props: MlWmsLayerProps): JSX.Element;
|
|
31
|
+
defaultProps: {
|
|
32
|
+
visible: boolean;
|
|
33
|
+
urlParameters: {
|
|
34
|
+
bbox: string;
|
|
35
|
+
format: string;
|
|
36
|
+
service: string;
|
|
37
|
+
version: string;
|
|
38
|
+
request: string;
|
|
39
|
+
srs: string;
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
styles: string;
|
|
43
|
+
};
|
|
44
|
+
attribution: string;
|
|
45
|
+
sourceOptions: {
|
|
46
|
+
minZoom: number;
|
|
47
|
+
maxZoom: number;
|
|
48
|
+
};
|
|
49
|
+
layerOptions: {
|
|
50
|
+
minZoom: number;
|
|
51
|
+
maxZoom: number;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
propTypes: {
|
|
55
|
+
/**
|
|
56
|
+
* WMS URL
|
|
57
|
+
*/
|
|
58
|
+
url: PropTypes.Validator<string>;
|
|
59
|
+
/**
|
|
60
|
+
* URL query parameters that will be added to the WMS URL. A layers property (string) is mandatory. Any value defined on this attribute will extend the default object.
|
|
61
|
+
*/
|
|
62
|
+
urlParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
63
|
+
layers: PropTypes.Validator<string>;
|
|
64
|
+
bbox: PropTypes.Requireable<string>;
|
|
65
|
+
format: PropTypes.Requireable<string>;
|
|
66
|
+
service: PropTypes.Requireable<string>;
|
|
67
|
+
version: PropTypes.Requireable<string>;
|
|
68
|
+
request: PropTypes.Requireable<string>;
|
|
69
|
+
srs: PropTypes.Requireable<string>;
|
|
70
|
+
width: PropTypes.Requireable<number>;
|
|
71
|
+
height: PropTypes.Requireable<number>;
|
|
72
|
+
}>>;
|
|
73
|
+
/**
|
|
74
|
+
* Id of the target MapLibre instance in mapContext
|
|
75
|
+
*/
|
|
76
|
+
mapId: PropTypes.Requireable<string>;
|
|
77
|
+
/**
|
|
78
|
+
* MapLibre attribution shown in the bottom right of the map, if this layer is visible
|
|
79
|
+
*/
|
|
80
|
+
attribution: PropTypes.Requireable<string>;
|
|
81
|
+
/**
|
|
82
|
+
* Object that is passed to the MapLibre.addLayer call as config option parameter
|
|
83
|
+
*/
|
|
84
|
+
layerOptions: PropTypes.Requireable<object>;
|
|
85
|
+
/**
|
|
86
|
+
* Object that is passed to the MapLibre.addSource call as config option parameter
|
|
87
|
+
*/
|
|
88
|
+
sourceOptions: PropTypes.Requireable<object>;
|
|
89
|
+
/**
|
|
90
|
+
* Id of an existing layer in the mapLibre instance to help specify the layer order
|
|
91
|
+
* This layer will be visually beneath the layer with the "insertBeforeLayer" id.
|
|
92
|
+
*/
|
|
93
|
+
insertBeforeLayer: PropTypes.Requireable<string>;
|
|
94
|
+
/**
|
|
95
|
+
* Sets layer "visibility" property to "visible" if true or "none" if false
|
|
96
|
+
*/
|
|
97
|
+
visible: PropTypes.Requireable<boolean>;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
export default MlWmsLayer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default storyoptions;
|
|
2
|
+
export const ExampleConfig: any;
|
|
3
|
+
declare namespace storyoptions {
|
|
4
|
+
export const title: string;
|
|
5
|
+
export { MlWmsLayer as component };
|
|
6
|
+
export namespace argTypes {
|
|
7
|
+
const url: {};
|
|
8
|
+
const layer: {};
|
|
9
|
+
}
|
|
10
|
+
export { mapContextDecorator as decorators };
|
|
11
|
+
}
|
|
12
|
+
import MlWmsLayer from "./MlWmsLayer";
|
|
13
|
+
import mapContextDecorator from "../../decorators/MapContextDecorator";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { LngLat } from "maplibre-gl";
|
|
2
|
+
interface MlWmsLoaderProps {
|
|
3
|
+
/**
|
|
4
|
+
* WMS URL
|
|
5
|
+
*/
|
|
6
|
+
url: string;
|
|
7
|
+
/**
|
|
8
|
+
* Id of the target MapLibre instance in mapContext
|
|
9
|
+
*/
|
|
10
|
+
mapId: string;
|
|
11
|
+
/**
|
|
12
|
+
* URL parameters that will be used in the getCapabilities request
|
|
13
|
+
*/
|
|
14
|
+
urlParameters: object;
|
|
15
|
+
/**
|
|
16
|
+
* URL parameters that will be added when requesting WMS capabilities
|
|
17
|
+
*/
|
|
18
|
+
wmsUrlParameters: object;
|
|
19
|
+
/**
|
|
20
|
+
* URL parameters that will be added when requesting tiles
|
|
21
|
+
*/
|
|
22
|
+
layerUrlParameters: object;
|
|
23
|
+
lngLat: LngLat;
|
|
24
|
+
idPrefix: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Loads a WMS getCapabilities xml document and adds a MlWmsLayer component for each layer that is
|
|
28
|
+
* offered by the WMS.
|
|
29
|
+
*
|
|
30
|
+
* TODO: EaseTo the extend offered by the WMS in a zoom level that is supported
|
|
31
|
+
*
|
|
32
|
+
* @component
|
|
33
|
+
*/
|
|
34
|
+
declare const MlWmsLoader: {
|
|
35
|
+
(props: MlWmsLoaderProps): JSX.Element;
|
|
36
|
+
defaultProps: {
|
|
37
|
+
url: string;
|
|
38
|
+
urlParameters: {
|
|
39
|
+
SERVICE: string;
|
|
40
|
+
VERSION: string;
|
|
41
|
+
REQUEST: string;
|
|
42
|
+
};
|
|
43
|
+
wmsUrlParameters: {
|
|
44
|
+
TRANSPARENT: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export default MlWmsLoader;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default storyoptions;
|
|
2
|
+
export const ExampleConfig: any;
|
|
3
|
+
declare namespace storyoptions {
|
|
4
|
+
export const title: string;
|
|
5
|
+
export { MlWmsLoader as component };
|
|
6
|
+
export namespace argTypes {
|
|
7
|
+
const url: {};
|
|
8
|
+
const layer: {};
|
|
9
|
+
}
|
|
10
|
+
export { mapContextDecorator as decorators };
|
|
11
|
+
}
|
|
12
|
+
import MlWmsLoader from "./MlWmsLoader";
|
|
13
|
+
import mapContextDecorator from "../../decorators/MapContextDecorator";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const MapContext: React.Context<MapContextType>;
|
|
3
|
+
/**
|
|
4
|
+
* MapComponentsProvider must be imported and wrapped around component where at least one of its child nodes requires access to a MapLibre-gl or openlayers instance that is registered in this mapContext.
|
|
5
|
+
MapComponentsProvider must be used one level higher than the first use of MapContext.
|
|
6
|
+
*
|
|
7
|
+
* MapComponentsProvider requires at least one use of the MapLibreMap component somewhere down the component tree that will create the MapLibre-gl object and set the reference at MapContext.map. For MapLibre maps it is a good idea to provide a mapId attribute to the MapLibreMap Component even if you are only using a single map instance at start. It will make a later transition to using multiple instances within the same project much easier.
|
|
8
|
+
*/
|
|
9
|
+
declare const MapComponentsProvider: ({ children }: {
|
|
10
|
+
children: any;
|
|
11
|
+
}) => JSX.Element;
|
|
12
|
+
export { MapComponentsProvider };
|
|
13
|
+
export default MapContext;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export default SimpleDataProvider;
|
|
2
|
+
declare function SimpleDataProvider(props: any): JSX.Element;
|
|
3
|
+
declare namespace SimpleDataProvider {
|
|
4
|
+
namespace propTypes {
|
|
5
|
+
const children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
import PropTypes from "prop-types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare module "*.svg" {
|
|
2
|
+
const content: any;
|
|
3
|
+
export default content;
|
|
4
|
+
export { content as ReactComponent };
|
|
5
|
+
}
|
|
6
|
+
declare module "*.js" {
|
|
7
|
+
const content: any;
|
|
8
|
+
export default content;
|
|
9
|
+
}
|
|
10
|
+
declare type MapContextType = {
|
|
11
|
+
mapIds: [string?];
|
|
12
|
+
mapExists: Function;
|
|
13
|
+
maps: [];
|
|
14
|
+
map: any;
|
|
15
|
+
getMap: Function;
|
|
16
|
+
setMap: Function;
|
|
17
|
+
};
|
|
18
|
+
interface GeoJSON {
|
|
19
|
+
type: string;
|
|
20
|
+
features?: any;
|
|
21
|
+
geometry?: any;
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useMapType } from "./useMap";
|
|
2
|
+
import { LayerSpecification } from "maplibre-gl";
|
|
3
|
+
import MapLibreGlWrapper from "../components/MapLibreMap/lib/MapLibreGlWrapper";
|
|
4
|
+
import { MapLayerMouseEvent } from "maplibre-gl";
|
|
5
|
+
import { GeoJSONObject } from "@turf/turf";
|
|
6
|
+
declare type useLayerType = {
|
|
7
|
+
map: MapLibreGlWrapper | undefined;
|
|
8
|
+
layer: LayerSpecification;
|
|
9
|
+
layerId: string;
|
|
10
|
+
componentId: string;
|
|
11
|
+
mapHook: useMapType;
|
|
12
|
+
};
|
|
13
|
+
interface useLayerProps {
|
|
14
|
+
mapId?: string;
|
|
15
|
+
layerId?: string;
|
|
16
|
+
idPrefix?: string;
|
|
17
|
+
insertBeforeLayer?: string;
|
|
18
|
+
insertBeforeFirstSymbolLayer?: boolean;
|
|
19
|
+
geojson?: GeoJSONObject;
|
|
20
|
+
options: Partial<LayerSpecification>;
|
|
21
|
+
onHover?: MapLayerMouseEvent;
|
|
22
|
+
onClick?: MapLayerMouseEvent;
|
|
23
|
+
onLeave?: MapLayerMouseEvent;
|
|
24
|
+
}
|
|
25
|
+
declare function useLayer(props: useLayerProps): useLayerType;
|
|
26
|
+
export default useLayer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import MapLibreGlWrapper, { LayerState } from "../components/MapLibreMap/lib/MapLibreGlWrapper";
|
|
2
|
+
declare type useMapType = {
|
|
3
|
+
map: MapLibreGlWrapper | undefined;
|
|
4
|
+
mapIsReady: boolean;
|
|
5
|
+
componentId: string;
|
|
6
|
+
layers: (LayerState | undefined)[];
|
|
7
|
+
cleanup: Function;
|
|
8
|
+
};
|
|
9
|
+
declare function useMap(props: {
|
|
10
|
+
mapId?: string;
|
|
11
|
+
waitForLayer?: string;
|
|
12
|
+
}): useMapType;
|
|
13
|
+
export default useMap;
|
|
14
|
+
export type { useMapType };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import PropTypes from "prop-types";
|
|
2
|
+
import { LayerState, ViewportState } from "../components/MapLibreMap/lib/MapLibreGlWrapper";
|
|
3
|
+
declare type useMapStateType = {
|
|
4
|
+
layers: (LayerState | undefined)[];
|
|
5
|
+
viewport: ViewportState | undefined;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* React hook that allows subscribing to map state changes
|
|
9
|
+
*
|
|
10
|
+
* @component
|
|
11
|
+
*/
|
|
12
|
+
declare function useMapState(props: {
|
|
13
|
+
mapId?: string;
|
|
14
|
+
watch?: {
|
|
15
|
+
layers?: boolean;
|
|
16
|
+
sources?: boolean;
|
|
17
|
+
viewport?: boolean;
|
|
18
|
+
};
|
|
19
|
+
filter?: {
|
|
20
|
+
includeBaseLayers?: boolean;
|
|
21
|
+
matchLayerIds?: RegExp | string;
|
|
22
|
+
matchSourceIds?: RegExp | string;
|
|
23
|
+
};
|
|
24
|
+
}): useMapStateType;
|
|
25
|
+
declare namespace useMapState {
|
|
26
|
+
var defaultProps: {
|
|
27
|
+
mapId: undefined;
|
|
28
|
+
watch: {
|
|
29
|
+
layers: boolean;
|
|
30
|
+
sources: boolean;
|
|
31
|
+
viewport: boolean;
|
|
32
|
+
};
|
|
33
|
+
filter: {
|
|
34
|
+
includeBaseLayers: boolean;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
var propTypes: {
|
|
38
|
+
/**
|
|
39
|
+
* Id of the target MapLibre instance in mapContext
|
|
40
|
+
*/
|
|
41
|
+
mapId: PropTypes.Requireable<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Defines map Resources to watch
|
|
44
|
+
*/
|
|
45
|
+
watch: PropTypes.Requireable<PropTypes.InferProps<{
|
|
46
|
+
layers: PropTypes.Requireable<boolean>;
|
|
47
|
+
sources: PropTypes.Requireable<boolean>;
|
|
48
|
+
viewport: PropTypes.Requireable<boolean>;
|
|
49
|
+
}>>;
|
|
50
|
+
/**
|
|
51
|
+
* Filter string or RegExp to more explicitly define the elements watched and increase performance
|
|
52
|
+
* strings will be matched using layerId.includes(matchString)
|
|
53
|
+
* RegExps will be matched using matchRegExp.test(layerId)
|
|
54
|
+
*/
|
|
55
|
+
filter: PropTypes.Requireable<PropTypes.InferProps<{
|
|
56
|
+
includeBaseLayers: PropTypes.Requireable<boolean>;
|
|
57
|
+
matchLayerIds: PropTypes.Requireable<string | RegExp>;
|
|
58
|
+
matchSourceIds: PropTypes.Requireable<string | RegExp>;
|
|
59
|
+
}>>;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export default useMapState;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default storyoptions;
|
|
2
|
+
export const ViewportOnly: any;
|
|
3
|
+
export const IncludeBaseLayers: any;
|
|
4
|
+
export const MatchLayerIdString: any;
|
|
5
|
+
export const MatchLayerIdRegexp: any;
|
|
6
|
+
export const NonBaseLayersOnly: any;
|
|
7
|
+
declare namespace storyoptions {
|
|
8
|
+
export const title: string;
|
|
9
|
+
export { useMapState as component };
|
|
10
|
+
export const argTypes: {};
|
|
11
|
+
export { mapContextDecorator as decorators };
|
|
12
|
+
}
|
|
13
|
+
import useMapState from "./useMapState";
|
|
14
|
+
import mapContextDecorator from "../decorators/MapContextDecorator";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default useWms;
|
|
2
|
+
declare function useWms(props: any): {
|
|
3
|
+
capabilities: undefined;
|
|
4
|
+
getFeatureInfoUrl: undefined;
|
|
5
|
+
wmsUrl: string;
|
|
6
|
+
error: undefined;
|
|
7
|
+
setUrl: import("react").Dispatch<any>;
|
|
8
|
+
};
|
|
9
|
+
declare namespace useWms {
|
|
10
|
+
namespace defaultProps {
|
|
11
|
+
const url: string;
|
|
12
|
+
namespace urlParameters {
|
|
13
|
+
const SERVICE: string;
|
|
14
|
+
const VERSION: string;
|
|
15
|
+
const REQUEST: string;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export { default as MapLibreMap } from "./components/MapLibreMap/MapLibreMap";
|
|
2
|
+
export { default as MlComponentTemplate } from "./components/MlComponentTemplate/MlComponentTemplate";
|
|
3
|
+
export { default as MlCreatePdfButton } from "./components/MlCreatePdfButton/MlCreatePdfButton";
|
|
4
|
+
export { default as MlFeatureEditor } from "./components/MlFeatureEditor/MlFeatureEditor";
|
|
5
|
+
export { default as MlFillExtrusionLayer } from "./components/MlFillExtrusionLayer/MlFillExtrusionLayer";
|
|
6
|
+
export { default as MlFollowGps } from "./components/MlFollowGps/MlFollowGps";
|
|
7
|
+
export { default as MlGeoJsonLayer } from "./components/MlGeoJsonLayer/MlGeoJsonLayer";
|
|
8
|
+
export { default as MlImageMarkerLayer } from "./components/MlImageMarkerLayer/MlImageMarkerLayer";
|
|
9
|
+
export { default as MlMeasureTool } from "./components/MlMeasureTool/MlMeasureTool";
|
|
10
|
+
export { default as MlNavigationTools } from "./components/MlNavigationTools/MlNavigationTools";
|
|
11
|
+
export { default as MlNavigationCompass } from "./components/MlNavigationCompass/MlNavigationCompass";
|
|
12
|
+
export { default as MlLayer } from "./components/MlLayer/MlLayer";
|
|
13
|
+
export { default as MlVectorTileLayer } from "./components/MlVectorTileLayer/MlVectorTileLayer";
|
|
14
|
+
export { default as MlWmsLayer } from "./components/MlWmsLayer/MlWmsLayer";
|
|
15
|
+
export { default as MlLayerMagnify } from "./components/MlLayerMagnify/MlLayerMagnify";
|
|
16
|
+
export { default as MlLayerSwipe } from "./components/MlLayerSwipe/MlLayerSwipe";
|
|
17
|
+
export { default as MlTransitionGeoJsonLayer } from "./components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer";
|
|
18
|
+
export { default as MlMarker } from "./components/MlMarker/MlMarker";
|
|
19
|
+
export { default as MlGPXViewer } from "./components/MlGPXViewer/MlGPXViewer";
|
|
20
|
+
export { default as GeoJsonProvider } from "./components/MlGPXViewer/util/GeoJsonProvider";
|
|
21
|
+
export { default as GeoJsonContext } from "./components/MlGPXViewer/util/GeoJsonContext";
|
|
22
|
+
export { default as MlSpatialElevationProfile } from "./components/MlSpatialElevationProfile/MlSpatialElevationProfile.js";
|
|
23
|
+
export { default as MlOsmLayer } from "./components/MlOsmLayer/MlOsmLayer.js";
|
|
24
|
+
export { default as MlBasicComponent } from "./components/MlBasicComponent.js";
|
|
25
|
+
export { default as useLayer } from "./hooks/useLayer";
|
|
26
|
+
export { default as useMapState } from "./hooks/useMapState";
|
|
27
|
+
export { default as useMap } from "./hooks/useMap";
|
|
28
|
+
export { default as useWms } from "./hooks/useWms.js";
|
|
29
|
+
export { MapComponentsProvider } from "./contexts/MapContext";
|
|
30
|
+
export { default as MapContext } from "./contexts/MapContext";
|
|
31
|
+
export { default as SimpleDataProvider } from "./contexts/SimpleDataProvider";
|
|
32
|
+
export { default as SimpleDataContext } from "./contexts/SimpleDataContext";
|
package/dist/index.esm.js
CHANGED
|
@@ -11859,7 +11859,9 @@ var drawUtils = {
|
|
|
11859
11859
|
},
|
|
11860
11860
|
getDrawInstance: function getDrawInstance(map) {
|
|
11861
11861
|
for (var i = map._controls.length - 1; i >= 0; i--) {
|
|
11862
|
-
|
|
11862
|
+
var _map$_controls$i, _map$_controls$i$mode;
|
|
11863
|
+
|
|
11864
|
+
if (((_map$_controls$i = map._controls[i]) === null || _map$_controls$i === void 0 ? void 0 : (_map$_controls$i$mode = _map$_controls$i.modes) === null || _map$_controls$i$mode === void 0 ? void 0 : _map$_controls$i$mode.SIMPLE_SELECT) === "simple_select") {
|
|
11863
11865
|
return map._controls[i];
|
|
11864
11866
|
}
|
|
11865
11867
|
}
|
|
@@ -12143,21 +12145,15 @@ var MlFeatureEditor = function (props) {
|
|
|
12143
12145
|
mapId: props.mapId,
|
|
12144
12146
|
waitForLayer: props.insertBeforeLayer,
|
|
12145
12147
|
});
|
|
12146
|
-
var onChangeRef = useRef(props.onChange);
|
|
12147
12148
|
var drawToolsInitialized = useRef(false);
|
|
12148
12149
|
var _a = useState(false), drawToolsReady = _a[0], setDrawToolsReady = _a[1];
|
|
12149
|
-
var _b = useState(0), mouseUpTrigger = _b[0], setMouseUpTrigger = _b[1];
|
|
12150
12150
|
var modeChangeHandler = function (e) {
|
|
12151
12151
|
console.log("MlFeatureEditor mode change to " + e.mode);
|
|
12152
12152
|
//setDrawMode(e.mode);
|
|
12153
12153
|
};
|
|
12154
|
-
var mouseUpHandler = function () {
|
|
12155
|
-
setMouseUpTrigger(Math.random());
|
|
12156
|
-
};
|
|
12157
12154
|
useEffect(function () {
|
|
12158
12155
|
var _a;
|
|
12159
|
-
if (mapHook.map &&
|
|
12160
|
-
!drawToolsInitialized.current) {
|
|
12156
|
+
if (mapHook.map && !drawToolsInitialized.current) {
|
|
12161
12157
|
drawToolsInitialized.current = true;
|
|
12162
12158
|
if (mapHook.map.map.style &&
|
|
12163
12159
|
mapHook.map.map.getSource("mapbox-gl-draw-cold") &&
|
|
@@ -12176,35 +12172,46 @@ var MlFeatureEditor = function (props) {
|
|
|
12176
12172
|
custom_direct_select: DirectSelect,
|
|
12177
12173
|
}, MapboxDraw.modes),
|
|
12178
12174
|
});
|
|
12179
|
-
mapHook.map.on("draw.modechange", modeChangeHandler, mapHook.componentId);
|
|
12180
12175
|
mapHook.map.addControl(draw.current, "top-left", mapHook.componentId);
|
|
12181
|
-
mapHook.map.on("
|
|
12176
|
+
mapHook.map.on("draw.modechange", modeChangeHandler, mapHook.componentId);
|
|
12182
12177
|
setDrawToolsReady(true);
|
|
12183
12178
|
}
|
|
12184
12179
|
}, [mapHook.map, props, drawToolsInitialized]);
|
|
12180
|
+
useEffect(function () {
|
|
12181
|
+
if (!mapHook.map || !drawToolsReady)
|
|
12182
|
+
return;
|
|
12183
|
+
var changeHandler = function () {
|
|
12184
|
+
var _a, _b;
|
|
12185
|
+
if (draw.current) {
|
|
12186
|
+
// update drawnFeatures state object
|
|
12187
|
+
if (typeof props.onChange === "function") {
|
|
12188
|
+
var currentFeatureCollection = (_b = (_a = draw.current).getAll) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
12189
|
+
props.onChange(currentFeatureCollection === null || currentFeatureCollection === void 0 ? void 0 : currentFeatureCollection.features);
|
|
12190
|
+
}
|
|
12191
|
+
}
|
|
12192
|
+
};
|
|
12193
|
+
mapHook.map.on("mouseup", changeHandler);
|
|
12194
|
+
mapHook.map.on("touchend", changeHandler);
|
|
12195
|
+
return function () {
|
|
12196
|
+
if (!mapHook.map)
|
|
12197
|
+
return;
|
|
12198
|
+
mapHook.map.map.off("mouseup", changeHandler);
|
|
12199
|
+
mapHook.map.map.off("touchend", changeHandler);
|
|
12200
|
+
};
|
|
12201
|
+
}, [drawToolsReady, mapHook.map]);
|
|
12185
12202
|
useEffect(function () {
|
|
12186
12203
|
var _a;
|
|
12187
|
-
if (draw.current &&
|
|
12188
|
-
((_a = props.geojson) === null || _a === void 0 ? void 0 : _a.geometry)) {
|
|
12204
|
+
if (draw.current && ((_a = props.geojson) === null || _a === void 0 ? void 0 : _a.geometry)) {
|
|
12189
12205
|
draw.current.set({ type: "FeatureCollection", features: [props.geojson] });
|
|
12190
12206
|
}
|
|
12191
12207
|
}, [props.geojson, drawToolsReady]);
|
|
12192
|
-
useEffect(function () {
|
|
12193
|
-
if (draw.current && mouseUpTrigger) {
|
|
12194
|
-
// update drawnFeatures state object
|
|
12195
|
-
var currentFeatureCollection = draw.current.getAll();
|
|
12196
|
-
if (typeof onChangeRef.current === "function") {
|
|
12197
|
-
onChangeRef.current(currentFeatureCollection.features);
|
|
12198
|
-
}
|
|
12199
|
-
}
|
|
12200
|
-
}, [mouseUpTrigger]);
|
|
12201
12208
|
useEffect(function () {
|
|
12202
12209
|
if (props.mode && draw.current) {
|
|
12203
12210
|
// @ts-ignore
|
|
12204
12211
|
draw.current.changeMode(props.mode);
|
|
12205
12212
|
}
|
|
12206
12213
|
}, [props.mode]);
|
|
12207
|
-
return
|
|
12214
|
+
return React__default.createElement(React__default.Fragment, null);
|
|
12208
12215
|
};
|
|
12209
12216
|
|
|
12210
12217
|
var legalLayerTypes = [
|
|
@@ -12686,6 +12693,41 @@ var MlImageMarkerLayer = function (props) {
|
|
|
12686
12693
|
return React__default.createElement(React__default.Fragment, null);
|
|
12687
12694
|
};
|
|
12688
12695
|
|
|
12696
|
+
//const unitSquareConvert = {
|
|
12697
|
+
// kilometers: 1,
|
|
12698
|
+
// miles: 1 / 2.58998811,
|
|
12699
|
+
//};
|
|
12700
|
+
function getUnitSquareMultiplier(measureType) {
|
|
12701
|
+
return measureType === "miles" ? 1 / 2.58998811 : 1;
|
|
12702
|
+
}
|
|
12703
|
+
function getUnitLabel(measureType) {
|
|
12704
|
+
return measureType === "miles" ? 'mi' : 'km';
|
|
12705
|
+
}
|
|
12706
|
+
var MlMeasureTool = function (props) {
|
|
12707
|
+
var _a = useState(0), length = _a[0], setLength = _a[1];
|
|
12708
|
+
var _b = useState([undefined]), currentFeatures = _b[0], setCurrentFeatures = _b[1];
|
|
12709
|
+
useEffect(function () {
|
|
12710
|
+
if (currentFeatures[0]) {
|
|
12711
|
+
setLength(props.measureType === "polygon"
|
|
12712
|
+
? (turf.area(currentFeatures[0]) / 1000000) * getUnitSquareMultiplier(props.unit)
|
|
12713
|
+
: turf.length(currentFeatures[0], { units: props.unit }));
|
|
12714
|
+
}
|
|
12715
|
+
}, [props.unit, currentFeatures]);
|
|
12716
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
12717
|
+
React__default.createElement(MlFeatureEditor, { onChange: function (features) {
|
|
12718
|
+
setCurrentFeatures(features);
|
|
12719
|
+
}, mode: props.measureType === "polygon" ? "custom_polygon" : "draw_line_string" }),
|
|
12720
|
+
length.toFixed(2),
|
|
12721
|
+
" ",
|
|
12722
|
+
getUnitLabel(props.unit),
|
|
12723
|
+
props.measureType === "polygon" ? "²" : ""));
|
|
12724
|
+
};
|
|
12725
|
+
MlMeasureTool.defaultProps = {
|
|
12726
|
+
mapId: undefined,
|
|
12727
|
+
measureType: "line",
|
|
12728
|
+
unit: "kilometers",
|
|
12729
|
+
};
|
|
12730
|
+
|
|
12689
12731
|
function getButtonGroupUtilityClass(slot) {
|
|
12690
12732
|
return generateUtilityClass('MuiButtonGroup', slot);
|
|
12691
12733
|
}
|
|
@@ -18658,7 +18700,7 @@ useWms.defaultProps = {
|
|
|
18658
18700
|
urlParameters: {
|
|
18659
18701
|
SERVICE: "WMS",
|
|
18660
18702
|
VERSION: "1.3.0",
|
|
18661
|
-
REQUEST: "
|
|
18703
|
+
REQUEST: "GetCapabilities"
|
|
18662
18704
|
}
|
|
18663
18705
|
};
|
|
18664
18706
|
|
|
@@ -18724,5 +18766,5 @@ SimpleDataProvider.propTypes = {
|
|
|
18724
18766
|
children: PropTypes.node.isRequired
|
|
18725
18767
|
};
|
|
18726
18768
|
|
|
18727
|
-
export { GeoJsonContext, GeoJsonProvider, MapComponentsProvider, MapContext, MapLibreMap, MlBasicComponent, MlComponentTemplate, MlCreatePdfButton, MlFeatureEditor, MlFillExtrusionLayer, MlFollowGps, MlGPXViewer, MlGeoJsonLayer, MlImageMarkerLayer, MlLayer, MlLayerMagnify, MlLayerSwipe, MlMarker, MlNavigationCompass, MlNavigationTools, MlOsmLayer, MlSpatialElevationProfile, MlTransitionGeoJsonLayer, MlVectorTileLayer, MlWmsLayer, SimpleDataContext, SimpleDataProvider, useLayer, useMap, useMapState, useWms };
|
|
18769
|
+
export { GeoJsonContext, GeoJsonProvider, MapComponentsProvider, MapContext, MapLibreMap, MlBasicComponent, MlComponentTemplate, MlCreatePdfButton, MlFeatureEditor, MlFillExtrusionLayer, MlFollowGps, MlGPXViewer, MlGeoJsonLayer, MlImageMarkerLayer, MlLayer, MlLayerMagnify, MlLayerSwipe, MlMarker, MlMeasureTool, MlNavigationCompass, MlNavigationTools, MlOsmLayer, MlSpatialElevationProfile, MlTransitionGeoJsonLayer, MlVectorTileLayer, MlWmsLayer, SimpleDataContext, SimpleDataProvider, useLayer, useMap, useMapState, useWms };
|
|
18728
18770
|
//# sourceMappingURL=index.esm.js.map
|