@mapcomponents/react-maplibre 0.1.8 → 0.1.12

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 (82) 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/CODE_OF_CONDUCT.md +70 -0
  6. package/CONTRIBUTING.md +149 -0
  7. package/README.md +16 -9
  8. package/coverage/clover.xml +76 -72
  9. package/coverage/coverage-final.json +2 -2
  10. package/coverage/lcov-report/block-navigation.js +8 -0
  11. package/coverage/lcov-report/components/MapLibreMap/MapLibreMap.js.html +8 -2
  12. package/coverage/lcov-report/components/MapLibreMap/index.html +8 -2
  13. package/coverage/lcov-report/components/MlCreatePdfButton/MlCreatePdfButton.js.html +8 -2
  14. package/coverage/lcov-report/components/MlCreatePdfButton/index.html +8 -2
  15. package/coverage/lcov-report/components/MlFeatureEditor/MlFeatureEditor.js.html +8 -2
  16. package/coverage/lcov-report/components/MlFeatureEditor/index.html +8 -2
  17. package/coverage/lcov-report/components/MlFillExtrusionLayer/MlFillExtrusionLayer.js.html +8 -2
  18. package/coverage/lcov-report/components/MlFillExtrusionLayer/index.html +8 -2
  19. package/coverage/lcov-report/components/MlFollowGps/MlFollowGps.js.html +53 -8
  20. package/coverage/lcov-report/components/MlFollowGps/index.html +18 -12
  21. package/coverage/lcov-report/components/MlGPXViewer/MlGPXViewer.js.html +8 -2
  22. package/coverage/lcov-report/components/MlGPXViewer/gpxConverter.js.html +8 -2
  23. package/coverage/lcov-report/components/MlGPXViewer/index.html +8 -2
  24. package/coverage/lcov-report/components/MlGeoJsonLayer/MlGeoJsonLayer.js.html +35 -17
  25. package/coverage/lcov-report/components/MlGeoJsonLayer/index.html +26 -20
  26. package/coverage/lcov-report/components/MlImageMarkerLayer/MlImageMarkerLayer.js.html +8 -2
  27. package/coverage/lcov-report/components/MlImageMarkerLayer/index.html +8 -2
  28. package/coverage/lcov-report/components/MlLayer/MlLayer.js.html +8 -2
  29. package/coverage/lcov-report/components/MlLayer/index.html +8 -2
  30. package/coverage/lcov-report/components/MlLayerMagnify/MlLayerMagnify.js.html +8 -2
  31. package/coverage/lcov-report/components/MlLayerMagnify/index.html +8 -2
  32. package/coverage/lcov-report/components/MlLayerSwipe/MlLayerSwipe.js.html +8 -2
  33. package/coverage/lcov-report/components/MlLayerSwipe/index.html +8 -2
  34. package/coverage/lcov-report/components/MlMarker/MlMarker.js.html +8 -2
  35. package/coverage/lcov-report/components/MlMarker/index.html +8 -2
  36. package/coverage/lcov-report/components/MlNavigationCompass/MlNavigationCompass.js.html +8 -2
  37. package/coverage/lcov-report/components/MlNavigationCompass/index.html +8 -2
  38. package/coverage/lcov-report/components/MlNavigationTools/MlNavigationTools.js.html +8 -2
  39. package/coverage/lcov-report/components/MlNavigationTools/index.html +8 -2
  40. package/coverage/lcov-report/components/MlOsmLayer/MlOsmLayer.js.html +8 -2
  41. package/coverage/lcov-report/components/MlOsmLayer/index.html +8 -2
  42. package/coverage/lcov-report/components/MlScaleReference/MlScaleReference.js.html +8 -2
  43. package/coverage/lcov-report/components/MlScaleReference/index.html +8 -2
  44. package/coverage/lcov-report/components/MlShareMapState/MlShareMapState.js.html +8 -2
  45. package/coverage/lcov-report/components/MlShareMapState/index.html +8 -2
  46. package/coverage/lcov-report/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +8 -2
  47. package/coverage/lcov-report/components/MlSpatialElevationProfile/index.html +8 -2
  48. package/coverage/lcov-report/components/MlThreeJsLayer/MlThreeJsLayer.js.html +8 -2
  49. package/coverage/lcov-report/components/MlThreeJsLayer/index.html +8 -2
  50. package/coverage/lcov-report/components/MlUseMapDebugger/MlUseMapDebugger.js.html +8 -2
  51. package/coverage/lcov-report/components/MlUseMapDebugger/index.html +8 -2
  52. package/coverage/lcov-report/components/MlVectorTileLayer/MlVectorTileLayer.js.html +8 -2
  53. package/coverage/lcov-report/components/MlVectorTileLayer/index.html +8 -2
  54. package/coverage/lcov-report/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +8 -2
  55. package/coverage/lcov-report/components/MlWmsFeatureInfoPopup/index.html +8 -2
  56. package/coverage/lcov-report/components/MlWmsLayer/MlWmsLayer.js.html +8 -2
  57. package/coverage/lcov-report/components/MlWmsLayer/index.html +8 -2
  58. package/coverage/lcov-report/components/MlWmsLoader/MlWmsLoader.js.html +8 -2
  59. package/coverage/lcov-report/components/MlWmsLoader/index.html +8 -2
  60. package/coverage/lcov-report/hooks/index.html +8 -2
  61. package/coverage/lcov-report/hooks/useMap.js.html +8 -2
  62. package/coverage/lcov-report/hooks/useMapState.js.html +8 -2
  63. package/coverage/lcov-report/hooks/useWms.js.html +8 -2
  64. package/coverage/lcov-report/index.html +32 -26
  65. package/coverage/lcov-report/sorter.js +26 -0
  66. package/coverage/lcov.info +153 -149
  67. package/dist/index.esm.js +68 -38
  68. package/dist/index.esm.js.map +1 -1
  69. package/package.json +1 -1
  70. package/rollup.config.js +10 -2
  71. package/src/components/MlCreatePdfButton/MlCreatePdfButton.meta.json +1 -1
  72. package/src/components/MlFollowGps/MlFollowGps.js +14 -1
  73. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.js +8 -4
  74. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.meta.json +1 -1
  75. package/src/components/MlGeoJsonLayer/util/transitionFunctions.js +19 -12
  76. package/src/components/MlVectorTileLayer/MlVectorTileLayer.meta.json +3 -3
  77. package/src/decorators/MapContextDashboardDecorator.js +0 -5
  78. package/src/decorators/MapContextDecorator.js +0 -5
  79. package/src/decorators/MapContextKlokantechBasicDecorator.js +0 -5
  80. package/src/decorators/MultiMapContextDecorator.js +0 -5
  81. package/src/hooks/useMapState.stories.js +7 -2
  82. package/src/ui_components/Sidebar.js +7 -8
@@ -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:
@@ -0,0 +1,70 @@
1
+ # Code of Conduct - react-map-components-maplibre
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to make participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to a positive environment for our
15
+ community include:
16
+
17
+ * Demonstrating empathy and kindness toward other people
18
+ * Being respectful of differing opinions, viewpoints, and experiences
19
+ * Giving and gracefully accepting constructive feedback
20
+ * Accepting responsibility and apologizing to those affected by our mistakes,
21
+ and learning from the experience
22
+ * Focusing on what is best not just for us as individuals, but for the
23
+ overall community
24
+
25
+ Examples of unacceptable behavior include:
26
+
27
+ * The use of sexualized language or imagery, and sexual attention or
28
+ advances
29
+ * Trolling, insulting or derogatory comments, and personal or political attacks
30
+ * Public or private harassment
31
+ * Publishing others' private information, such as a physical or email
32
+ address, without their explicit permission
33
+ * Other conduct which could reasonably be considered inappropriate in a
34
+ professional setting
35
+
36
+ ## Our Responsibilities
37
+
38
+ Project maintainers are responsible for clarifying and enforcing our standards of
39
+ acceptable behavior and will take appropriate and fair corrective action in
40
+ response to any instances of unacceptable behavior.
41
+
42
+ Project maintainers have the right and responsibility to remove, edit, or reject
43
+ comments, commits, code, wiki edits, issues, and other contributions that are
44
+ not aligned to this Code of Conduct, or to ban
45
+ temporarily or permanently any contributor for other behaviors that they deem
46
+ inappropriate, threatening, offensive, or harmful.
47
+
48
+ ## Scope
49
+
50
+ This Code of Conduct applies within all community spaces, and also applies when
51
+ an individual is officially representing the community in public spaces.
52
+ Examples of representing our community include using an official e-mail address,
53
+ posting via an official social media account, or acting as an appointed
54
+ representative at an online or offline event.
55
+
56
+ ## Enforcement
57
+
58
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
59
+ reported to the community leaders responsible for enforcement at <info@wheregroup.com>.
60
+ All complaints will be reviewed and investigated promptly and fairly.
61
+
62
+ All community leaders are obligated to respect the privacy and security of the
63
+ reporter of any incident.
64
+
65
+ ## Attribution
66
+
67
+ This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version
68
+ [1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and
69
+ [2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md),
70
+ and was generated by [contributing-gen](https://github.com/bttger/contributing-gen).
@@ -0,0 +1,149 @@
1
+ <!-- omit in toc -->
2
+ # Contributing to react-map-components-maplibre
3
+
4
+ First off, thanks for taking the time to contribute! ❤️
5
+
6
+ All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉
7
+
8
+ > And if you like theut it project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
9
+ > - Star the project
10
+ > - Tweet about it
11
+ > - Refer this project in your project's readme
12
+ > - Mention the project at local meetups and tell your friends/colleagues
13
+
14
+ <!-- omit in toc -->
15
+ ## Table of Contents
16
+
17
+ - [Code of Conduct](#code-of-conduct)
18
+ - [I Have a Question](#i-have-a-question)
19
+ - [I Want To Contribute](#i-want-to-contribute)
20
+ - [Reporting Bugs](#reporting-bugs)
21
+ - [Suggesting Enhancements](#suggesting-enhancements)
22
+
23
+
24
+ ## Code of Conduct
25
+
26
+ This project and everyone participating in it is governed by the
27
+ [react-map-components-maplibre Code of Conduct](https://github.com/mapcomponents/react-map-components-maplibre/blob/master/CODE_OF_CONDUCT.md).
28
+ By participating, you are expected to uphold this code. Please report unacceptable behavior
29
+ to <info@wheregroup.com>.
30
+
31
+
32
+ ## I Have a Question
33
+
34
+ > If you want to ask a question, we assume that you have read the available [Documentation](https://mapcomponents.github.io/react-map-components-maplibre).
35
+
36
+ Before you ask a question, it is best to search for existing [Issues](https://github.com/mapcomponents/react-map-components-maplibre/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.
37
+
38
+ If you then still feel the need to ask a question and need clarification, we recommend the following:
39
+
40
+ - Open an [Issue](https://github.com/mapcomponents/react-map-components-maplibre/issues/new).
41
+ - Provide as much context as you can about what you're running into.
42
+ - Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant.
43
+
44
+ We will then take care of the issue as soon as possible.
45
+
46
+ <!--
47
+ You might want to create a separate issue tag for questions and include it in this description. People should then tag their issues accordingly.
48
+
49
+ Depending on how large the project is, you may want to outsource the questioning, e.g. to Stack Overflow or Gitter. You may add additional contact and information possibilities:
50
+ - IRC
51
+ - Slack
52
+ - Gitter
53
+ - Stack Overflow tag
54
+ - Blog
55
+ - FAQ
56
+ - Roadmap
57
+ - E-Mail List
58
+ - Forum
59
+ -->
60
+
61
+ ## I Want To Contribute
62
+
63
+ > ### Legal Notice <!-- omit in toc -->
64
+ > When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.
65
+
66
+ ### Reporting Bugs
67
+
68
+ <!-- omit in toc -->
69
+ #### Before Submitting a Bug Report
70
+
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
+
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](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
+ - 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
+ - Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
77
+ - Collect information about the bug:
78
+ - Stack trace (Traceback)
79
+ - OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
80
+ - Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant.
81
+ - Possibly your input and the output
82
+ - Can you reliably reproduce the issue? And can you also reproduce it with older versions?
83
+
84
+ <!-- omit in toc -->
85
+ #### How Do I Submit a Good Bug Report?
86
+
87
+ > You must never report security related issues, vulnerabilities or bugs to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to <info@wheregroup.com>.
88
+ <!-- You may add a PGP key to allow the messages to be sent encrypted as well. -->
89
+
90
+ We use GitHub issues to track bugs and errors. If you run into an issue with the project:
91
+
92
+ - Open an [Issue](https://github.com/mapcomponents/react-map-components-maplibre/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
93
+ - Explain the behavior you would expect and the actual behavior.
94
+ - Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
95
+ - Provide the information you collected in the previous section.
96
+
97
+ Once it's filed:
98
+
99
+ - The project team will label the issue accordingly.
100
+ - A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced.
101
+ - If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution).
102
+
103
+ <!-- You might want to create an issue template for bugs and errors that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. -->
104
+
105
+
106
+ ### Suggesting Enhancements
107
+
108
+ This section guides you through submitting an enhancement suggestion for react-map-components-maplibre, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.
109
+
110
+ <!-- omit in toc -->
111
+ #### Before Submitting an Enhancement
112
+
113
+ - Make sure that you are using the latest version.
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
+ - 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
+ - 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
+
118
+ <!-- omit in toc -->
119
+ #### How Do I Submit a Good Enhancement Suggestion?
120
+
121
+ Enhancement suggestions are tracked as [GitHub issues](https://github.com/mapcomponents/react-map-components-maplibre/issues).
122
+
123
+ - Use a **clear and descriptive title** for the issue to identify the suggestion.
124
+ - Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
125
+ - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you.
126
+ - You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. <!-- this should only be included if the project has a GUI -->
127
+ - **Explain why this enhancement would be useful** to most react-map-components-maplibre users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
128
+
129
+ <!-- You might want to create an issue template for enhancement suggestions that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. -->
130
+
131
+ <!-- TODO
132
+ ### Your First Code Contribution
133
+ include Setup of env, IDE and typical getting started instructions?
134
+
135
+
136
+ ### Improving The Documentation
137
+ Updating, improving and correcting the documentation
138
+
139
+
140
+ ## Styleguides
141
+ ### Commit Messages
142
+
143
+
144
+ ## Join The Project Team
145
+ <!-- TODO -->
146
+
147
+ <!-- omit in toc -->
148
+ ## Attribution
149
+ This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)!
package/README.md CHANGED
@@ -2,9 +2,12 @@
2
2
 
3
3
  # [MapComponents MapLibre](https://mapcomponents.org/)
4
4
 
5
- [![npm version](https://badge.fury.io/js/react-map-components-maplibre.svg)](https://badge.fury.io/js/react-map-components-maplibre) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) ![downloads](https://img.shields.io/npm/dt/react-map-components-maplibre.svg) ![downloads](https://img.shields.io/npm/dm/react-map-components-maplibre.svg)
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
- ## Getting started
7
+ ![Tests](https://github.com/mapcomponents/react-map-components-maplibre/actions/workflows/node_version_test.yml/badge.svg)
8
+
9
+
10
+ ## Getting started (Using the storybook dev server)
8
11
 
9
12
  1. Clone the repository and ```cd``` into the folder
10
13
  2. Run ```yarn``` to install all dependencies.
@@ -21,6 +24,17 @@
21
24
  1. Follow all steps of "Create a new component"
22
25
  2. Change the value of the property "type" in {component_name}.meta.json to "application"
23
26
 
27
+ ## Project setup
28
+
29
+ ### Starting a new project
30
+
31
+ Fork our codesandbox project setup template to get started instantly. https://codesandbox.io/s/base-template-n0vp9
32
+
33
+ ### Integrate MapComponents into an existing react project
34
+
35
+ 1. Add the dependency ```yarn add @mapcomponents/react-maplibre```
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.
24
38
  ## Anatomy of a MapComponent
25
39
 
26
40
  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.
@@ -135,13 +149,6 @@ Example implementation of a component in context with all required dependent com
135
149
 
136
150
  More information on writing storybook stories for react components: https://storybook.js.org/docs/react/get-started/browse-stories
137
151
 
138
- ## LoadingOverlay and LoadingOverlayProvider (currently located in ./ui_components/)
139
-
140
- The loading overlay component is added in the storybook decorator.
141
- 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.
142
-
143
- For decorator integration examples check the storybook decorators located in ./decorators/.
144
-
145
152
  # Tests
146
153
 
147
154
  ```
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <coverage generated="1637853048003" clover="3.2.0">
3
- <project timestamp="1637853048004" name="All files">
4
- <metrics statements="1505" coveredstatements="559" conditionals="829" coveredconditionals="252" methods="259" coveredmethods="91" elements="2593" coveredelements="902" complexity="0" loc="1505" ncloc="1505" packages="25" files="28" classes="28"/>
2
+ <coverage generated="1638615355631" clover="3.2.0">
3
+ <project timestamp="1638615355631" name="All files">
4
+ <metrics statements="1509" coveredstatements="562" conditionals="831" coveredconditionals="253" methods="258" coveredmethods="91" elements="2598" coveredelements="906" complexity="0" loc="1509" ncloc="1509" packages="25" files="28" classes="28"/>
5
5
  <package name="components.MapLibreMap">
6
6
  <metrics statements="25" coveredstatements="25" conditionals="4" coveredconditionals="3" methods="6" coveredmethods="6"/>
7
7
  <file name="MapLibreMap.js" path="/home/runner/work/react-map-components-maplibre/react-map-components-maplibre/src/components/MapLibreMap/MapLibreMap.js">
@@ -136,9 +136,9 @@
136
136
  </file>
137
137
  </package>
138
138
  <package name="components.MlFollowGps">
139
- <metrics statements="38" coveredstatements="26" conditionals="22" coveredconditionals="13" methods="7" coveredmethods="4"/>
139
+ <metrics statements="40" coveredstatements="27" conditionals="22" coveredconditionals="13" methods="7" coveredmethods="4"/>
140
140
  <file name="MlFollowGps.js" path="/home/runner/work/react-map-components-maplibre/react-map-components-maplibre/src/components/MlFollowGps/MlFollowGps.js">
141
- <metrics statements="38" coveredstatements="26" conditionals="22" coveredconditionals="13" methods="7" coveredmethods="4"/>
141
+ <metrics statements="40" coveredstatements="27" conditionals="22" coveredconditionals="13" methods="7" coveredmethods="4"/>
142
142
  <line num="21" count="1" type="stmt"/>
143
143
  <line num="23" count="7" type="stmt"/>
144
144
  <line num="24" count="7" type="stmt"/>
@@ -148,35 +148,37 @@
148
148
  <line num="29" count="7" type="stmt"/>
149
149
  <line num="30" count="7" type="stmt"/>
150
150
  <line num="31" count="7" type="cond" truecount="1" falsecount="1"/>
151
- <line num="33" count="7" type="stmt"/>
152
- <line num="34" count="2" type="stmt"/>
153
- <line num="37" count="2" type="stmt"/>
154
- <line num="44" count="0" type="cond" truecount="0" falsecount="2"/>
155
- <line num="45" count="0" type="stmt"/>
151
+ <line num="32" count="7" type="stmt"/>
152
+ <line num="34" count="7" type="stmt"/>
153
+ <line num="35" count="2" type="stmt"/>
154
+ <line num="38" count="2" type="stmt"/>
155
+ <line num="45" count="0" type="cond" truecount="0" falsecount="2"/>
156
156
  <line num="46" count="0" type="stmt"/>
157
- <line num="48" count="0" type="cond" truecount="0" falsecount="2"/>
158
- <line num="49" count="0" type="stmt"/>
157
+ <line num="47" count="0" type="stmt"/>
158
+ <line num="49" count="0" type="cond" truecount="0" falsecount="2"/>
159
159
  <line num="50" count="0" type="stmt"/>
160
160
  <line num="51" count="0" type="stmt"/>
161
- <line num="56" count="7" type="stmt"/>
162
- <line num="57" count="4" type="cond" truecount="4" falsecount="0"/>
163
- <line num="60" count="2" type="stmt"/>
161
+ <line num="52" count="0" type="stmt"/>
162
+ <line num="57" count="7" type="stmt"/>
163
+ <line num="58" count="4" type="cond" truecount="4" falsecount="0"/>
164
164
  <line num="61" count="2" type="stmt"/>
165
165
  <line num="62" count="2" type="stmt"/>
166
- <line num="66" count="7" type="stmt"/>
167
- <line num="67" count="0" type="cond" truecount="0" falsecount="2"/>
168
- <line num="68" count="0" type="stmt"/>
166
+ <line num="63" count="2" type="stmt"/>
167
+ <line num="67" count="7" type="stmt"/>
168
+ <line num="68" count="0" type="cond" truecount="0" falsecount="2"/>
169
169
  <line num="69" count="0" type="stmt"/>
170
- <line num="72" count="7" type="stmt"/>
171
- <line num="73" count="0" type="stmt"/>
172
- <line num="74" count="0" type="stmt"/>
173
- <line num="77" count="7" type="stmt"/>
174
- <line num="111" count="3" type="cond" truecount="2" falsecount="0"/>
175
- <line num="112" count="1" type="stmt"/>
176
- <line num="114" count="2" type="stmt"/>
177
- <line num="119" count="3" type="stmt"/>
178
- <line num="129" count="1" type="stmt"/>
179
- <line num="146" count="1" type="stmt"/>
170
+ <line num="70" count="0" type="stmt"/>
171
+ <line num="71" count="0" type="stmt"/>
172
+ <line num="74" count="7" type="stmt"/>
173
+ <line num="75" count="0" type="stmt"/>
174
+ <line num="76" count="0" type="stmt"/>
175
+ <line num="79" count="7" type="stmt"/>
176
+ <line num="124" count="3" type="cond" truecount="2" falsecount="0"/>
177
+ <line num="125" count="1" type="stmt"/>
178
+ <line num="127" count="2" type="stmt"/>
179
+ <line num="132" count="3" type="stmt"/>
180
+ <line num="142" count="1" type="stmt"/>
181
+ <line num="159" count="1" type="stmt"/>
180
182
  </file>
181
183
  </package>
182
184
  <package name="components.MlGPXViewer">
@@ -588,9 +590,9 @@
588
590
  </file>
589
591
  </package>
590
592
  <package name="components.MlGeoJsonLayer">
591
- <metrics statements="56" coveredstatements="37" conditionals="48" coveredconditionals="27" methods="8" coveredmethods="6"/>
593
+ <metrics statements="58" coveredstatements="39" conditionals="50" coveredconditionals="28" methods="7" coveredmethods="6"/>
592
594
  <file name="MlGeoJsonLayer.js" path="/home/runner/work/react-map-components-maplibre/react-map-components-maplibre/src/components/MlGeoJsonLayer/MlGeoJsonLayer.js">
593
- <metrics statements="56" coveredstatements="37" conditionals="48" coveredconditionals="27" methods="8" coveredmethods="6"/>
595
+ <metrics statements="58" coveredstatements="39" conditionals="50" coveredconditionals="28" methods="7" coveredmethods="6"/>
594
596
  <line num="10" count="2" type="stmt"/>
595
597
  <line num="17" count="2" type="stmt"/>
596
598
  <line num="19" count="8" type="stmt"/>
@@ -602,51 +604,53 @@
602
604
  <line num="25" count="8" type="stmt"/>
603
605
  <line num="26" count="8" type="stmt"/>
604
606
  <line num="27" count="8" type="stmt"/>
605
- <line num="30" count="8" type="cond" truecount="2" falsecount="0"/>
606
- <line num="32" count="8" type="stmt"/>
607
- <line num="33" count="4" type="stmt"/>
607
+ <line num="28" count="8" type="stmt"/>
608
+ <line num="31" count="8" type="cond" truecount="2" falsecount="0"/>
609
+ <line num="33" count="8" type="stmt"/>
608
610
  <line num="34" count="4" type="stmt"/>
609
- <line num="36" count="2" type="cond" truecount="1" falsecount="1"/>
610
- <line num="37" count="2" type="stmt"/>
611
- <line num="39" count="2" type="stmt"/>
612
- <line num="44" count="8" type="stmt"/>
613
- <line num="45" count="8" type="cond" truecount="2" falsecount="2"/>
614
- <line num="49" count="0" type="stmt"/>
615
- <line num="50" count="0" type="stmt"/>
616
- <line num="54" count="8" type="stmt"/>
617
- <line num="56" count="0" type="stmt"/>
618
- <line num="72" count="8" type="stmt"/>
619
- <line num="73" count="8" type="cond" truecount="2" falsecount="2"/>
620
- <line num="77" count="0" type="cond" truecount="0" falsecount="2"/>
621
- <line num="82" count="0" type="stmt"/>
622
- <line num="83" count="0" type="stmt"/>
623
- <line num="84" count="0" type="stmt"/>
624
- <line num="85" count="0" type="stmt"/>
625
- <line num="86" count="0" type="stmt"/>
611
+ <line num="35" count="4" type="stmt"/>
612
+ <line num="37" count="2" type="cond" truecount="1" falsecount="1"/>
613
+ <line num="38" count="0" type="stmt"/>
614
+ <line num="40" count="2" type="cond" truecount="1" falsecount="1"/>
615
+ <line num="42" count="2" type="stmt"/>
616
+ <line num="44" count="2" type="stmt"/>
617
+ <line num="49" count="8" type="stmt"/>
618
+ <line num="50" count="8" type="cond" truecount="2" falsecount="2"/>
619
+ <line num="54" count="0" type="stmt"/>
620
+ <line num="55" count="0" type="stmt"/>
621
+ <line num="59" count="8" type="stmt"/>
622
+ <line num="61" count="0" type="stmt"/>
623
+ <line num="78" count="8" type="stmt"/>
624
+ <line num="79" count="8" type="cond" truecount="2" falsecount="2"/>
625
+ <line num="83" count="0" type="cond" truecount="0" falsecount="2"/>
626
626
  <line num="88" count="0" type="stmt"/>
627
+ <line num="89" count="0" type="stmt"/>
627
628
  <line num="90" count="0" type="stmt"/>
628
- <line num="100" count="8" type="stmt"/>
629
- <line num="101" count="8" type="cond" truecount="4" falsecount="0"/>
630
- <line num="105" count="4" type="cond" truecount="1" falsecount="1"/>
631
- <line num="106" count="4" type="stmt"/>
632
- <line num="107" count="4" type="stmt"/>
633
- <line num="109" count="4" type="cond" truecount="1" falsecount="1"/>
634
- <line num="115" count="0" type="stmt"/>
635
- <line num="116" count="0" type="stmt"/>
636
- <line num="119" count="4" type="stmt"/>
637
- <line num="121" count="4" type="stmt"/>
638
- <line num="138" count="4" type="cond" truecount="1" falsecount="1"/>
639
- <line num="139" count="0" type="stmt"/>
640
- <line num="142" count="4" type="cond" truecount="1" falsecount="1"/>
641
- <line num="143" count="0" type="stmt"/>
642
- <line num="146" count="4" type="cond" truecount="1" falsecount="1"/>
643
- <line num="147" count="0" type="stmt"/>
644
- <line num="150" count="4" type="cond" truecount="1" falsecount="1"/>
645
- <line num="155" count="0" type="stmt"/>
646
- <line num="156" count="0" type="stmt"/>
647
- <line num="157" count="0" type="stmt"/>
648
- <line num="163" count="8" type="stmt"/>
649
- <line num="166" count="2" type="stmt"/>
629
+ <line num="91" count="0" type="stmt"/>
630
+ <line num="92" count="0" type="stmt"/>
631
+ <line num="94" count="0" type="stmt"/>
632
+ <line num="96" count="0" type="stmt"/>
633
+ <line num="106" count="8" type="stmt"/>
634
+ <line num="107" count="8" type="cond" truecount="4" falsecount="0"/>
635
+ <line num="111" count="4" type="cond" truecount="1" falsecount="1"/>
636
+ <line num="112" count="4" type="stmt"/>
637
+ <line num="113" count="4" type="stmt"/>
638
+ <line num="115" count="4" type="cond" truecount="1" falsecount="1"/>
639
+ <line num="121" count="0" type="stmt"/>
640
+ <line num="122" count="0" type="stmt"/>
641
+ <line num="125" count="4" type="stmt"/>
642
+ <line num="127" count="4" type="stmt"/>
643
+ <line num="144" count="4" type="cond" truecount="1" falsecount="1"/>
644
+ <line num="145" count="0" type="stmt"/>
645
+ <line num="148" count="4" type="cond" truecount="1" falsecount="1"/>
646
+ <line num="149" count="0" type="stmt"/>
647
+ <line num="152" count="4" type="cond" truecount="1" falsecount="1"/>
648
+ <line num="153" count="0" type="stmt"/>
649
+ <line num="156" count="4" type="cond" truecount="1" falsecount="1"/>
650
+ <line num="161" count="0" type="stmt"/>
651
+ <line num="162" count="0" type="stmt"/>
652
+ <line num="167" count="8" type="stmt"/>
653
+ <line num="170" count="2" type="stmt"/>
650
654
  </file>
651
655
  </package>
652
656
  <package name="components.MlImageMarkerLayer">