mapbox / mapbox/mapbox-gl-draw
doRender() does not force rerender
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
I am working on a custom mode and I would like the drawing to change based on user's text input during the drawing, dynamically. So I read the input's input event and update my drawing parameters. I update my features using feature.setCoordinates() and then call this.doRender(this.state.feature.id) expecting it would rerender the drawing using the updated feature. However, the render doesn't happen unless I move mouse over the map area.
First I added the text input on the map using mapbox's Popup. Seeing it didn't work like I described above, I tried to add plain dom elements positioned over the map without using Popup. I got the same result.
Am I missing something? is there a way to force rerender in my case?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the doRender() call and the feature.setCoordinates() update described in the report, then trace how mapbox-gl-draw responds to input events and mouse movement. Reproduce the custom-mode case with a text input and verify whether the drawing updates without moving over the map. Done means updated feature coordinates trigger a visible rerender without requiring pointer movement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100