feat: Add GlobeControl for maplibre #2554
Open
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.
What
maplibre-gl-js has officially added GlobeControl:
https://maplibre.org/maplibre-gl-js/docs/API/classes/GlobeControl/
This pull request enables the use of GlobeControl in react-map-gl as well.
Intended behavior
Screen record
e35f3d83a562206ac3f2aa09f55300da.mp4
Why
I love using react-map-gl when developing interactive map applications by combining React and maplibre-gl-js.
Since GlobeControl does not exist on react-map-gl, I am implementing it myself:
https://github.com/yuiseki/TRIDENT/blob/main/src/components/GlobeControl/index.ts
This implementation is a custom extension that follows the existing GeolocateControl and NavigationControl on react-map-gl.
I am submitting a pull request because I would very much like to use this as an official component of react-map-gl.
How
The following files have been added:
The following files have been modified:
PR Checklist
yarn test
must be successful.docs/api-reference
.docs/upgrade-guide.md
.docs/whats-new.md
.