@mapcomponents/react-maplibre 0.1.10 → 0.1.14

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.
Files changed (135) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +2 -2
  2. package/.github/ISSUE_TEMPLATE/feature_request.md +3 -3
  3. package/.github/workflows/node_version_test.yml +25 -0
  4. package/.github/workflows/storybook.yml +6 -3
  5. package/CONTRIBUTING.md +2 -2
  6. package/README.md +3 -7
  7. package/coverage/clover.xml +748 -625
  8. package/coverage/coverage-final.json +19 -14
  9. package/coverage/lcov-report/block-navigation.js +8 -0
  10. package/coverage/lcov-report/index.html +170 -104
  11. package/coverage/lcov-report/sorter.js +26 -0
  12. package/coverage/lcov-report/{components → src/components}/MapLibreMap/MapLibreMap.js.html +17 -11
  13. package/coverage/lcov-report/{components → src/components}/MapLibreMap/index.html +17 -11
  14. package/coverage/lcov-report/{components → src/components}/MlCreatePdfButton/MlCreatePdfButton.js.html +17 -11
  15. package/coverage/lcov-report/{components → src/components}/MlCreatePdfButton/index.html +17 -11
  16. package/coverage/lcov-report/{components → src/components}/MlFeatureEditor/MlFeatureEditor.js.html +17 -11
  17. package/coverage/lcov-report/{components → src/components}/MlFeatureEditor/index.html +17 -11
  18. package/coverage/lcov-report/{components → src/components}/MlFillExtrusionLayer/MlFillExtrusionLayer.js.html +17 -11
  19. package/coverage/lcov-report/{components → src/components}/MlFillExtrusionLayer/index.html +17 -11
  20. package/coverage/lcov-report/{components → src/components}/MlFollowGps/MlFollowGps.js.html +99 -48
  21. package/coverage/lcov-report/{components → src/components}/MlFollowGps/index.html +27 -21
  22. package/coverage/lcov-report/{components → src/components}/MlGPXViewer/MlGPXViewer.js.html +73 -61
  23. package/coverage/lcov-report/{components → src/components}/MlGPXViewer/gpxConverter.js.html +56 -71
  24. package/coverage/lcov-report/{components → src/components}/MlGPXViewer/index.html +32 -26
  25. package/coverage/lcov-report/{components → src/components}/MlGeoJsonLayer/MlGeoJsonLayer.js.html +91 -31
  26. package/coverage/lcov-report/{components → src/components}/MlGeoJsonLayer/index.html +35 -29
  27. package/coverage/lcov-report/{components → src/components}/MlImageMarkerLayer/MlImageMarkerLayer.js.html +26 -23
  28. package/coverage/lcov-report/{components → src/components}/MlImageMarkerLayer/index.html +26 -20
  29. package/coverage/lcov-report/{components → src/components}/MlLayer/MlLayer.js.html +37 -31
  30. package/coverage/lcov-report/{components → src/components}/MlLayer/index.html +33 -27
  31. package/coverage/lcov-report/{components → src/components}/MlLayerMagnify/MlLayerMagnify.js.html +48 -42
  32. package/coverage/lcov-report/{components → src/components}/MlLayerMagnify/index.html +31 -25
  33. package/coverage/lcov-report/{components → src/components}/MlLayerSwipe/MlLayerSwipe.js.html +45 -42
  34. package/coverage/lcov-report/{components → src/components}/MlLayerSwipe/index.html +31 -25
  35. package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +755 -0
  36. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +380 -0
  37. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +117 -0
  38. package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +117 -0
  39. package/coverage/lcov-report/{components → src/components}/MlMarker/MlMarker.js.html +18 -12
  40. package/coverage/lcov-report/{components → src/components}/MlMarker/index.html +17 -11
  41. package/coverage/lcov-report/{components → src/components}/MlNavigationCompass/MlNavigationCompass.js.html +17 -11
  42. package/coverage/lcov-report/{components → src/components}/MlNavigationCompass/index.html +17 -11
  43. package/coverage/lcov-report/{components → src/components}/MlNavigationTools/MlNavigationTools.js.html +55 -37
  44. package/coverage/lcov-report/{components → src/components}/MlNavigationTools/index.html +23 -17
  45. package/coverage/lcov-report/{components → src/components}/MlOsmLayer/MlOsmLayer.js.html +17 -11
  46. package/coverage/lcov-report/{components → src/components}/MlOsmLayer/index.html +17 -11
  47. package/coverage/lcov-report/{components → src/components}/MlScaleReference/MlScaleReference.js.html +17 -11
  48. package/coverage/lcov-report/{components → src/components}/MlScaleReference/index.html +17 -11
  49. package/coverage/lcov-report/{components → src/components}/MlShareMapState/MlShareMapState.js.html +17 -11
  50. package/coverage/lcov-report/{components → src/components}/MlShareMapState/index.html +17 -11
  51. package/coverage/lcov-report/{components → src/components}/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +17 -11
  52. package/coverage/lcov-report/{components → src/components}/MlSpatialElevationProfile/index.html +17 -11
  53. package/coverage/lcov-report/{components → src/components}/MlThreeJsLayer/MlThreeJsLayer.js.html +37 -55
  54. package/coverage/lcov-report/{components → src/components}/MlThreeJsLayer/index.html +31 -25
  55. package/coverage/lcov-report/{components → src/components}/MlUseMapDebugger/MlUseMapDebugger.js.html +17 -11
  56. package/coverage/lcov-report/{components → src/components}/MlUseMapDebugger/index.html +17 -11
  57. package/coverage/lcov-report/{components → src/components}/MlVectorTileLayer/MlVectorTileLayer.js.html +17 -11
  58. package/coverage/lcov-report/{components → src/components}/MlVectorTileLayer/index.html +17 -11
  59. package/coverage/lcov-report/{components → src/components}/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +17 -11
  60. package/coverage/lcov-report/{components → src/components}/MlWmsFeatureInfoPopup/index.html +17 -11
  61. package/coverage/lcov-report/{components → src/components}/MlWmsLayer/MlWmsLayer.js.html +20 -14
  62. package/coverage/lcov-report/{components → src/components}/MlWmsLayer/index.html +21 -15
  63. package/coverage/lcov-report/{components → src/components}/MlWmsLoader/MlWmsLoader.js.html +38 -20
  64. package/coverage/lcov-report/{components → src/components}/MlWmsLoader/index.html +23 -17
  65. package/coverage/lcov-report/{hooks → src/hooks}/index.html +17 -11
  66. package/coverage/lcov-report/{hooks → src/hooks}/useMap.js.html +17 -11
  67. package/coverage/lcov-report/{hooks → src/hooks}/useMapState.js.html +17 -11
  68. package/coverage/lcov-report/{hooks → src/hooks}/useWms.js.html +25 -19
  69. package/coverage/lcov-report/src/i18n.js.html +167 -0
  70. package/coverage/lcov-report/src/index.html +117 -0
  71. package/coverage/lcov-report/src/translations/english.js.html +95 -0
  72. package/coverage/lcov-report/src/translations/german.js.html +95 -0
  73. package/coverage/lcov-report/src/translations/index.html +132 -0
  74. package/coverage/lcov.info +1278 -1010
  75. package/dist/b556faa3bc6829d2.png +0 -0
  76. package/dist/index.esm.js +276 -90
  77. package/dist/index.esm.js.map +1 -1
  78. package/package.json +3 -1
  79. package/public/assets/dop.png +0 -0
  80. package/public/assets/historic.png +0 -0
  81. package/public/assets/osm.png +0 -0
  82. package/public/thumbnails/MlFollowGps.png +0 -0
  83. package/public/thumbnails/MlThreeJsLayer.png +0 -0
  84. package/rollup.config.js +7 -1
  85. package/src/components/MapLibreMap/lib/MapLibreGlWrapper.js +58 -73
  86. package/src/components/MlCreatePdfButton/MlCreatePdfButton.meta.json +1 -1
  87. package/src/components/MlFeatureEditor/MlFeatureEditor.meta.json +2 -2
  88. package/src/components/MlFollowGps/MlFollowGps.js +46 -31
  89. package/src/components/MlFollowGps/MlFollowGps.meta.json +2 -2
  90. package/src/components/MlFollowGps/assets/marker.png +0 -0
  91. package/src/components/MlGPXViewer/MlGPXViewer.js +45 -43
  92. package/src/components/MlGPXViewer/gpxConverter.js +22 -29
  93. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.js +27 -9
  94. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.meta.json +1 -1
  95. package/src/components/MlGeoJsonLayer/util/transitionFunctions.js +19 -12
  96. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.js +3 -4
  97. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.test.js +6 -7
  98. package/src/components/MlLayer/MlLayer.js +2 -2
  99. package/src/components/MlLayer/MlLayer.test.js +12 -10
  100. package/src/components/MlLayerMagnify/MlLayerMagnify.js +3 -3
  101. package/src/components/MlLayerSwipe/MlLayerSwipe.js +4 -5
  102. package/src/components/MlLayerSwitcher/MlLayerSwitcher.css +17 -0
  103. package/src/components/MlLayerSwitcher/MlLayerSwitcher.doc.de.md +3 -0
  104. package/src/components/MlLayerSwitcher/MlLayerSwitcher.js +223 -0
  105. package/src/components/MlLayerSwitcher/MlLayerSwitcher.meta_.json +15 -0
  106. package/src/components/MlLayerSwitcher/MlLayerSwitcher.stories.js +106 -0
  107. package/src/components/MlLayerSwitcher/assets/sample_1.json +26 -0
  108. package/src/components/MlLayerSwitcher/assets/sample_2.json +22 -0
  109. package/src/components/MlLayerSwitcher/components/LayerBox.js +98 -0
  110. package/src/components/MlMarker/MlMarker.js +1 -1
  111. package/src/components/MlNavigationTools/MlNavigationTools.js +26 -22
  112. package/src/components/MlScaleReference/MlScaleReference.meta.json +1 -1
  113. package/src/components/MlScaleReference/MlScaleReference.stories.js +25 -21
  114. package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.js +12 -6
  115. package/src/components/MlThreeJsLayer/MlThreeJsLayer.js +8 -15
  116. package/src/components/MlVectorTileLayer/MlVectorTileLayer.meta.json +3 -3
  117. package/src/components/MlWmsLayer/MlWmsLayer.js +1 -1
  118. package/src/components/MlWmsLoader/MlWmsLoader.js +8 -4
  119. package/src/components/MlWmsLoader/MlWmsLoader.meta.json +1 -1
  120. package/src/components/MlWmsLoader/MlWmsLoader.stories.js +5 -4
  121. package/src/decorators/EmptyMapContextDecorator.js +11 -6
  122. package/src/decorators/MapContext3DDecorator.js +25 -20
  123. package/src/decorators/MapContextDashboardDecorator.js +7 -7
  124. package/src/decorators/MapContextDecorator.js +7 -8
  125. package/src/decorators/MapContextKlokantechBasicDecorator.js +8 -9
  126. package/src/decorators/MultiMapContextDecorator.js +2 -6
  127. package/src/hooks/useMapState.stories.js +7 -2
  128. package/src/hooks/useWms.js +7 -6
  129. package/src/i18n.js +28 -0
  130. package/src/index.js +1 -0
  131. package/src/translations/english.js +4 -0
  132. package/src/translations/german.js +4 -0
  133. package/src/ui_components/ImageLoader.js +73 -0
  134. package/src/ui_components/Sidebar.js +76 -22
  135. package/src/ui_components/TopToolbar.js +18 -18
@@ -9,10 +9,10 @@ labels: 'Status: Unconfirmed'
9
9
  <!--
10
10
  Please provide a clear and concise description of what the bug is. Include
11
11
  screenshots if needed. Please test using the latest version of the relevant
12
- react-map-components-maplibre package to make sure your issue has not already been fixed.
12
+ @mapcomponents/react-maplibre package to make sure your issue has not already been fixed.
13
13
  -->
14
14
 
15
- react-map-components-maplibre version:
15
+ @mapcomponents/react-maplibre version:
16
16
 
17
17
  ## Steps To Reproduce
18
18
 
@@ -1,6 +1,6 @@
1
1
  ---
2
- name: "🫀 Feature request"
3
- about: Suggest a new idea for react-map-components-maplibre.
2
+ name: "💕 Feature request"
3
+ about: Suggest a new idea for @mapcomponents/react-maplibre.
4
4
  title: 'Feature: '
5
5
  labels: 'Status: needs print'
6
6
  Assignees: ''
@@ -11,7 +11,7 @@ Assignees: ''
11
11
  -->
12
12
 
13
13
 
14
- react-map-components-maplibre version:
14
+ @mapcomponents/react-maplibre version:
15
15
 
16
16
  ## Feature description
17
17
 
@@ -0,0 +1,25 @@
1
+ name: tests
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ pull_request:
7
+ branches:
8
+ - main
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+
13
+ strategy:
14
+ matrix:
15
+ node-versions: [10.x, 12.x, 14.x, 15.x, 16.x]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+ - name: Use Node.js ${{ matrix.node-version }}
20
+ # Setup .npmrc file to publish to npm
21
+ uses: actions/setup-node@v2
22
+ with:
23
+ node-version: ${{ matrix.node-version }}
24
+ - run: yarn
25
+ - run: yarn test:noninteractive
@@ -1,4 +1,4 @@
1
- name: Build and Deploy Storybook
1
+ name: Build and deploy storybook
2
2
  on:
3
3
  [push]
4
4
  jobs:
@@ -9,10 +9,13 @@ jobs:
9
9
  uses: actions/checkout@v2.3.1
10
10
  with:
11
11
  persist-credentials: false
12
- - name: Install and Build 🔧
12
+ - name: Install and build 🔧
13
13
  run: | # Install packages and build the Storybook files
14
- yarn install
14
+ yarn
15
+ yarn build-catalogue-meta
16
+ yarn build-catalogue-markdown-docs
15
17
  yarn build-storybook
18
+ npx sb extract ./docs-build ./docs-build/stories.json
16
19
  - name: Deploy 🚀
17
20
  uses: JamesIves/github-pages-deploy-action@3.6.2
18
21
  with:
package/CONTRIBUTING.md CHANGED
@@ -71,7 +71,7 @@ Depending on how large the project is, you may want to outsource the questioning
71
71
  A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
72
72
 
73
73
  - Make sure that you are using the latest version.
74
- - Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](). If you are looking for support, you might want to check [this section](#i-have-a-question)).
74
+ - Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://mapcomponents.github.io/react-map-components-maplibre/). If you are looking for support, you might want to check [this section](#i-have-a-question)).
75
75
  - To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/mapcomponents/react-map-components-maplibre/issues?q=label%3Abug).
76
76
  - Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
77
77
  - Collect information about the bug:
@@ -111,7 +111,7 @@ This section guides you through submitting an enhancement suggestion for react-m
111
111
  #### Before Submitting an Enhancement
112
112
 
113
113
  - Make sure that you are using the latest version.
114
- - Read the [documentation]() carefully and find out if the functionality is already covered, maybe by an individual configuration.
114
+ - Read the [documentation](https://mapcomponents.github.io/react-map-components-maplibre) carefully and find out if the functionality is already covered, maybe by an individual configuration.
115
115
  - Perform a [search](https://github.com/mapcomponents/react-map-components-maplibre/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
116
116
  - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.
117
117
 
package/README.md CHANGED
@@ -4,6 +4,9 @@
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/@mapcomponents%2Freact-maplibre.svg)](https://badge.fury.io/js/@mapcomponents%2Freact-maplibre) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) ![downloads](https://img.shields.io/npm/dt/@mapcomponents%2Freact-maplibre.svg) ![downloads](https://img.shields.io/npm/dm/@mapcomponents%2Freact-maplibre.svg)
6
6
 
7
+ ![Tests](https://github.com/mapcomponents/react-map-components-maplibre/actions/workflows/node_version_test.yml/badge.svg)
8
+
9
+
7
10
  ## Getting started (Using the storybook dev server)
8
11
 
9
12
  1. Clone the repository and ```cd``` into the folder
@@ -146,13 +149,6 @@ Example implementation of a component in context with all required dependent com
146
149
 
147
150
  More information on writing storybook stories for react components: https://storybook.js.org/docs/react/get-started/browse-stories
148
151
 
149
- ## LoadingOverlay and LoadingOverlayProvider (currently located in ./ui_components/)
150
-
151
- The loading overlay component is added in the storybook decorator.
152
- Without any further configuration it will listen for new MapLibre instances registered in MapContext and fade out once all of them have fired an "idle" event. For more precise control the LoadingOverlayContext provides a ```loadingOverlayContext.setControlled(true)``` function that will, if called with true as first parameter, switch the LoadingOverlay to manual control. Once the application has loaded completely call the ```loadingOverlayContext.setLoadingDone(true)``` function to trigger the LoadingOverlay Component to fade out.
153
-
154
- For decorator integration examples check the storybook decorators located in ./decorators/.
155
-
156
152
  # Tests
157
153
 
158
154
  ```