mapbox / mapbox/mapbox-gl-draw

doRender() does not force rerender

Open
#959 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug question
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.