feat: switch from Mapbox GL JS to MapLibre GL JS (DHIS2-11406) #374
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: https://jira.dhis2.org/browse/DHIS2-11406
As Mapbox GL JS v2 is no longer under a BSD-3-Clause license, this PR is switching to MapLibre GL JS, a community led fork derived from mapbox-gl-js prior to their switch to a non-OSS license: https://github.com/maplibre/maplibre-gl-js
Main changes:
The reason mapboxgl-spiderifier code was included directly in the repo is that the dependency requires mapbox-gl to display markers. The code was adapted to use markers from maplibre-gl instead.
BREAKING CHANGE: It was made a breaking change as the maps-app (and possibly other apps) uses the "mapboxgl-" class names.
After this PR the map controls display as before:
The spiderify of events still works as before:
![spiderify](https://user-images.githubusercontent.com/548708/124614779-e6854b80-de74-11eb-9231-9b9876961765.gif)