Docs: Add types to use control example#2109
Draft
tordans wants to merge 2 commits intovisgl:masterfrom
Draft
Conversation
Pessimistress
approved these changes
Apr 10, 2023
Contributor
Author
|
FYI, we have very similar types in use at https://github.com/FixMyBerlin/atlas-app/blob/develop/src/components/MapInterface/Map/Calculator/CalculatorControlsDrawControl.tsx#L10-L17 so this PR might be right after all… |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The page https://github.com/visgl/react-map-gl/blob/master/docs/api-reference/use-control.md?plain=1#L9 / http://visgl.github.io/react-map-gl/docs/api-reference/use-control uses the Types
DrawControlPropswhich are not specified in the example / on the page.They are specified on this page https://github.com/visgl/react-map-gl/blob/master/examples/draw-polygon/src/draw-control.ts#L6-L12 , however.
This PR add them to the example.
Update: Looking at https://github.com/visgl/react-map-gl/blob/master/examples/draw-polygon/src/app.tsx more, I am now pretty sure this PR is not correct. Will mark it as draft, first. Maybe someone can look into it in more detail…