@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
|
@@ -12,7 +12,7 @@ jobs:
|
|
|
12
12
|
|
|
13
13
|
strategy:
|
|
14
14
|
matrix:
|
|
15
|
-
node-versions: [
|
|
15
|
+
node-versions: [14.x, 15.x, 16.x]
|
|
16
16
|
|
|
17
17
|
steps:
|
|
18
18
|
- uses: actions/checkout@v2
|
|
@@ -23,3 +23,4 @@ jobs:
|
|
|
23
23
|
node-version: ${{ matrix.node-version }}
|
|
24
24
|
- run: yarn
|
|
25
25
|
- run: yarn test:noninteractive
|
|
26
|
+
- run: yarn build
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## [v0.1.51] - 2022-07-12
|
|
3
4
|
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- @ 938f665: improve typescript type definitions for MlGeoJsonLayer attributes, useLayer hook props, maplibre reference returned by useMap hook
|
|
8
|
+
- 3349332: improve MlTransitionGeoJsonLayer attribute types
|
|
9
|
+
|
|
10
|
+
## [v0.1.49] - 2022-07-11
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- @c119564: add useLayer hook tests
|
|
15
|
+
- 27d9ded: add typescript type definitions
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- 9244711: update readme to make it more beginner friendly
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- 6b3c223: add touch support to MlFeatureEditor
|
|
23
|
+
- a531174: refactor MlFeatureEditor
|
|
24
|
+
|
|
25
|
+
## [v0.1.48] - 2022-06-15
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- 4d53b8a: add miles option to MlMeasureTool
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- 0082e6d: fix MlMeasureTools typescript transpilation errors
|
|
33
|
+
|
|
34
|
+
## [v0.1.47] (broken build) - 2022-06-15
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- ed194ff: fix MlWmsLoader & useWms hooks default param values of GetCapabilities request
|
|
4
39
|
## [v0.1.46] - 2022-06-09
|
|
5
40
|
|
|
6
41
|
### Fixed
|
package/README.md
CHANGED
|
@@ -6,196 +6,107 @@
|
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
|
+
@mapcomponents/react-maplibre is a react component library for declarative GIS application development.
|
|
10
|
+
## Links
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
- Documentation: https://mapcomponents.github.io/react-map-components-maplibre/
|
|
13
|
+
- Catalogue: https://www.mapcomponents.org/
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
2. Run ```yarn``` to install all dependencies.
|
|
14
|
-
3. Run ```yarn start``` to start the storybook server. It will watch files for changes and reload affected components. If cleanup functions are incomplete it might be required to reload the browser tab.
|
|
15
|
+
## Getting started
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
Use our Codesandbox template to quickly try out this library without any setup required. https://codesandbox.io/s/base-template-n0vp9
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
2. The new component should become available within your storybook webinterface. Start the component development inside the component file (former MlComponentTemplate.js) and see the changes reflected in your browser.
|
|
20
|
-
3. Once the component is ready to be published to the MapComponents catalogue, remove the ```_``` from the meta.json file ({component_name}.meta_.json) and to have it included in the next release.
|
|
19
|
+
### **How to use @mapcomponents/react-maplibre in ...**
|
|
21
20
|
|
|
22
|
-
###
|
|
21
|
+
### **... a new project**
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
2. Change the value of the property "type" in {component_name}.meta.json to "application"
|
|
23
|
+
The easiest way to start a new project using this framework is to bootstrap a react application using our [create-react-app-template](https://github.com/mapcomponents/react-map-components-maplibre-cra-template).
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
**Requirements:**
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
1. node.js >=16
|
|
28
|
+
2. yarn
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
Run the following commands in the terminal:
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
1. `npx create-react-app {your-app-name} --template @mapcomponents/cra-template`
|
|
33
|
+
2. `cd {your-app-name}`
|
|
34
|
+
3. `yarn start`
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
2. Add a MapcomponentsProvider to your react-dom (e.g. https://codesandbox.io/s/base-template-n0vp9?file=/src/index.js)
|
|
37
|
-
3. Add a MapLibreMap and any MapComponent you like to use in your app below MapcomponentsProvider.
|
|
38
|
-
## Anatomy of a MapComponent
|
|
36
|
+
This will start a development server that serves the mapcomponents app on port 3000 of your local machine as well as a browser tab with live reload enabled. This reloads the affected parts of the application if changes are detected to the corresponding files in the filesystem. Open the project folder in the IDE of your choice and start building your map client.
|
|
39
37
|
|
|
40
|
-
|
|
41
|
-
An example implementation of basic required functions for the maplibre instance retrieval process using the functions getMap, mapExists provided by mapContext, both accepting "mapId" (string) as parameter, can be seen in ./components/MlComponentTemplate/MlComponentTemplate.js.
|
|
42
|
-
If no attribute mapId is provided the map component is expected to work with the map instance provided by mapContext at ```mapContext.map``` (it is recommended to retrieve it using ```mapContext.getMap(props.mapId)```).
|
|
38
|
+
### **... an existing react project**
|
|
43
39
|
|
|
40
|
+
In this case, navigate to your project folder in a terminal and execute the following steps:
|
|
44
41
|
|
|
45
|
-
|
|
42
|
+
1. Add @mapcomponents/react-maplibre as a dependency to your project using `yarn add @mapcomponents/react-maplibre` or `npm i @mapcomponents/react-maplibre` depending on which package manager you prefer.
|
|
43
|
+
2. Add the MapComponentsProvider (named export of this module) to your applications react-DOM where it makes sense. Only children of this component will be able to render a map canvas or interact with a maplibre-gl instance. Place it in the index.js entrypoint if your application is a dedicated map app and all components have a high probability to interact with the maplibre-gl instance. Place it somewhere higher in the JSX tree if the map constitutes only a small portion of your app and components outside of the MapComponentsProvider have no need to interact with the map instance.
|
|
44
|
+
3. Add a MapLibreMap component to the react-DOM wherever the map canvas is supposed to be placed.
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
├── {component_name}.js // the only mandatory file is the component code
|
|
50
|
-
├── {component_name}.test.js // jest tests
|
|
51
|
-
└── {component_name}.stories.js // Storybook & catalogue
|
|
52
|
-
├── {component_name}.doc.en.md // Catalogue only
|
|
53
|
-
├── {component_name}.doc.de.md // catalogue only
|
|
54
|
-
├── {component_name}.meta.json // catalogue only
|
|
55
|
-
```
|
|
46
|
+
## How it works
|
|
47
|
+
### Anatomy of a MapComponent
|
|
56
48
|
|
|
57
|
-
|
|
49
|
+
A MapComponent is a react component that accepts at least 1 attribute "mapId" (there are some exceptions) and is expected to retrieve a maplibre-gl instance from mapContext and directly manipulate it or watch its state.
|
|
50
|
+
An example implementation of basic required functions for the maplibre instance retrieval process using the useMap hook, can be seen in [./components/MlComponentTemplate/MlComponentTemplate.tsx](https://github.com/mapcomponents/react-map-components-maplibre/blob/main/src/components/MlComponentTemplate/MlComponentTemplate.tsx)
|
|
51
|
+
If no attribute mapId is provided the map component is expected to work with the map instance provided by mapContext at ```mapContext.map``` (the first maplibre instance that is registered in MapContext).
|
|
58
52
|
|
|
59
|
-
React component implementation
|
|
60
53
|
|
|
61
|
-
|
|
54
|
+
### Cleanup functions
|
|
62
55
|
|
|
63
|
-
|
|
56
|
+
Once a component is removed from reactDOM we need to make sure everything it has added to the maplibre-gl instance is removed with it. The mapHook offers a convenient way to do this.
|
|
64
57
|
|
|
65
|
-
|
|
58
|
+
**- Retrieve the maplibre instance using the useMap hook**
|
|
66
59
|
|
|
67
|
-
|
|
60
|
+
Add `mapHook.map` to the dependency array of e.g. a useEffect hook to trigger it once the map instance becomes available.
|
|
68
61
|
|
|
69
62
|
```js
|
|
70
|
-
const mapRef = useRef(undefined);
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
**- Component cleanup function**
|
|
74
63
|
|
|
75
|
-
|
|
64
|
+
const mapHook = useMap({
|
|
65
|
+
mapId: props.mapId,
|
|
66
|
+
waitForLayer: props.insertBeforeLayer,
|
|
67
|
+
});
|
|
76
68
|
|
|
77
|
-
```js
|
|
78
69
|
useEffect(() => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
// This is the cleanup function, it is called when this react component is removed from react-dom
|
|
83
|
-
if (mapRef.current) {
|
|
84
|
-
mapRef.current.cleanup(_componentId);
|
|
85
|
-
|
|
86
|
-
mapRef.current = undefined;
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}, []);
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
**- Reference population**
|
|
93
|
-
|
|
94
|
-
This happens within the effect that discovers the map instance for the first time (watch the mapContext.mapIds state variable for added or removed map engine instances).
|
|
95
|
-
|
|
96
|
-
```js
|
|
97
|
-
useEffect(() => {
|
|
98
|
-
if (!mapContext.mapExists(props.mapId) || initializedRef.current) return;
|
|
99
|
-
// the MapLibre-gl instance (mapContext.map) is accessible here
|
|
100
|
-
// initialize the layer and add it to the MapLibre-gl instance or do something else with it
|
|
101
|
-
|
|
102
|
-
// set initializedRef.current to true to make sure this function gets only called once
|
|
103
|
-
initializedRef.current = true;
|
|
104
|
-
|
|
105
|
-
// populate the map reference
|
|
106
|
-
mapRef.current = mapContext.getMap(props.mapId);
|
|
70
|
+
if (!mapHook.map) return;
|
|
71
|
+
// the MapLibre-gl instance (mapHook.map) is accessible here
|
|
72
|
+
// initialize the layer and add it to the MapLibre-gl instance
|
|
107
73
|
|
|
108
74
|
// optionally add layers, sources, event listeners, controls, images to the MapLibre instance that are required by this component
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
75
|
+
mapHook.map.addLayer(
|
|
76
|
+
{/*layer-config*/},
|
|
77
|
+
props.insertBeforeLayer,
|
|
78
|
+
mapHook.componentId)
|
|
113
79
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
The function mentioned above have been overriden in the MapLibreGlWrapper instance that is returned by the mapContext.getMap(props.mapId) function.
|
|
117
|
-
All five functions expect an additional optional parameter "component_id" (string) as last or optional parameter (except for the beforeLayerId parameter of the addLayer function, which should be defined as props.beforeLayerId to make sure the parent component is able to control the layer order).
|
|
118
|
-
MapLibreGlWrapper uses the component_id to keep track of everything that has been added by a specific component (including implicitly added sources), enabling a safe and simple cleanup by calling ```mapRef.current.cleanup(component_id)``` as shown in the cleanup function example above.
|
|
119
|
-
|
|
120
|
-
### {component_name}.meta.json *//catalogue only*
|
|
121
|
-
|
|
122
|
-
Additional meta data regarding the component, this file is required for the component to become listed in the catalogue
|
|
123
|
-
|
|
124
|
-
```json
|
|
125
|
-
{
|
|
126
|
-
"name": "{component_name}", // must be identical to the react component name (string)
|
|
127
|
-
"title": "", // english component title (string)
|
|
128
|
-
"description": "", // english short description (string)
|
|
129
|
-
"i18n":{
|
|
130
|
-
"de":{
|
|
131
|
-
"title": "", // german component title (string)
|
|
132
|
-
"description": "", // german short description (string)
|
|
80
|
+
return () => {
|
|
81
|
+
mapHook.cleanup();
|
|
133
82
|
}
|
|
134
|
-
},
|
|
135
|
-
"tags": [ "Map add-on" ], // list of tags (Array<string>)
|
|
136
|
-
"category": "add-ons", // category (string)
|
|
137
|
-
"type": "component", // type "component" or "application" (string)
|
|
138
|
-
}
|
|
139
|
-
```
|
|
140
83
|
|
|
141
|
-
|
|
142
|
-
### {component_name}.doc.de.md *//catalogue only*
|
|
84
|
+
}, [mapHook.map]);
|
|
143
85
|
|
|
144
|
-
Description text, that is shown on the catalogue component detail page below the main image
|
|
145
|
-
|
|
146
|
-
### {component_name}.stories.js *//storybook only*
|
|
147
|
-
|
|
148
|
-
Example implementation of a component in context with all required dependent components to showcase the basic functionality of a single component. Decorators to choose from are located in ./src/decorators/. During development the command ```yarn start``` will start a server (localhost:6006) with live reload functionality. In case of example applications the stories are used as a wrapper to make the application available in the storybook build that is later used to access working demos from within the catalogue.
|
|
149
|
-
|
|
150
|
-
More information on writing storybook stories for react components: https://storybook.js.org/docs/react/get-started/browse-stories
|
|
151
|
-
|
|
152
|
-
# Tests
|
|
153
|
-
|
|
154
|
-
```
|
|
155
|
-
yarn test
|
|
156
86
|
```
|
|
87
|
+
**- Component cleanup function**
|
|
157
88
|
|
|
158
|
-
will
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
# Building the documentation
|
|
162
|
-
|
|
163
|
-
Install the dependencies globally:
|
|
89
|
+
`mapHook.cleanup()` will remove all ressources from the maplibre-gl instance that have been added using `mapHook.componentId` as additional parameter in `map.addLayer`, `map.addSource`, `map.on`, `map.addImage` or `map.addControl` calls.
|
|
164
90
|
|
|
165
|
-
```
|
|
166
|
-
yarn global add jsdoc parcel-bundler
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
Build the documentation:
|
|
91
|
+
```js
|
|
170
92
|
|
|
171
|
-
|
|
172
|
-
yarn docs-create
|
|
173
|
-
```
|
|
93
|
+
useEffect(() => {
|
|
174
94
|
|
|
175
|
-
|
|
95
|
+
return () => {
|
|
96
|
+
// This is the cleanup function, it is called when this react component is removed from react-dom
|
|
97
|
+
mapHook.cleanup();
|
|
98
|
+
};
|
|
99
|
+
}, []);
|
|
176
100
|
|
|
177
101
|
```
|
|
178
|
-
yarn docs-serve
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
# Release NPM package
|
|
182
102
|
|
|
183
|
-
|
|
184
|
-
Once the main branch ist ready for a new release you can use one of:
|
|
185
|
-
|
|
186
|
-
```yarn version --patch```
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
```yarn version --minor```
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
```yarn version --major```
|
|
193
|
-
|
|
194
|
-
to have yarn up the version number in package.json, create a new commit with the new version number as commit message and tag the commit with the same string (e.g. ```v0.1.15```).
|
|
103
|
+
**- addLayer, addSource, addImage, addControls, on**
|
|
195
104
|
|
|
196
|
-
|
|
197
|
-
|
|
105
|
+
The functions mentioned above have been overridden in the MapLibreGlWrapper instance that is referenced by mapHook.map.
|
|
106
|
+
All five functions expect an additional optional parameter "component_id" (string) as their last or optional parameter (except for the beforeLayerId parameter of the addLayer function, which should be defined as props.beforeLayerId to make sure the parent component is able to control the layer order).
|
|
107
|
+
A uuid `componentId` property is generated and available on the object returned by mapHook.
|
|
108
|
+
MapLibreGlWrapper uses the component_id to keep track of everything that has been added by a specific component (including implicitly added sources), enabling a safe and simple cleanup by calling ```mapHook.cleanup()``` as shown in the cleanup function example above.
|
|
198
109
|
|
|
199
|
-
##
|
|
110
|
+
## more links
|
|
200
111
|
|
|
201
|
-
|
|
112
|
+
- @mapcomponents/react-maplibre-lab storybook: https://mapcomponents.github.io/react-map-components-maplibre-lab
|