mapbox / mapbox/mapbox-gl-draw
UncombineFeatures does not copy the feature properties
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
When a MultiFeature is uncombined into its sub-features, each one is given the exact properties object of the multifeature, rather than a copy. The implication of this is that when `setFeatureProperty` is called with the id of one of the sub-features, the properties of all sub-features will affected, even though they all have different ids.
The line responsible for the problem:
https://github.com/mapbox/mapbox-gl-draw/blob/0efdb4d14a0ecae37cfe467334aaa5b2e501f702/src/modes/simple_select.js#L364
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
Inspect the linked line in src/modes/simple_select.js and trace how UncombineFeatures assigns properties to each sub-feature. Reproduce the case by calling setFeatureProperty on one sub-feature, then verify that changing it no longer affects the others; add or update coverage if the repository’s existing tests cover this behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 62/100