mapbox / mapbox/mapbox-gl-draw
Flickering and Deselection When Clicking Vertices on Large GeoJSON Line Features
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
Description:
When adding a large GeoJSON line feature (e.g., complex geometries with thousands of vertices) to Mapbox-GL-Draw, selecting the feature and clicking on any of its vertices causes the layer to flicker and deselect the feature. The expected behavior is for the clicked vertex to be selected and remain interactive without losing the feature's selection state.
Steps to Reproduce:
Load a large GeoJSON line feature (e.g., a polyline with high vertex density) into Mapbox-GL-Draw.
Select the feature using draw.set({ }) or by clicking it.
Click on any vertex of the selected feature.
Expected Result:
The clicked vertex is highlighted, and the feature remains selected for further interactions (e.g., vertex drag-and-drop or deletion).
Actual Result:
The feature briefly flickers.
The selection state is lost (feature and vertex deselection).
The interaction requires reselecting the feature to proceed.
Environment:
Mapbox-GL-Draw version: [e.g., 1.4.2]
Mapbox-GL-JS version: [e.g., 1.13.0]
Browser: [e.g., Chrome 120, Firefox 115]
OS: [e.g., Windows 10,]
Additional Context:
Issue is more prominent with large datasets but may also occur with moderately complex geometries.
No console errors observed, suggesting a rendering/state synchronization issue. #


[testClick.zip](https://github.com/user-attachments/files/19480689/testClick.zip)
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 by reproducing the issue with the attached testClick.zip and a large GeoJSON line feature, using draw.set() before clicking a vertex. Trace the selection and vertex-click interaction path in Mapbox-GL-Draw. Done means the clicked vertex remains highlighted and the feature stays selected without flickering, including during further vertex interactions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100