map.queryRenderedFeatures(...) fails to return geojson MutliPolygon features where a MutliPolygon overlaps
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
**mapbox-gl-js version**: 1.11.1, 1.12.0
**browser**: google chrome, firefox, safari, etc.
## Summary
map.queryRenderedFeatures(...) fails to return geojson MutliPolygon features where a MutliPolygon overlaps.
The following geojson contains a mutlipolygon that contains overlap:
```
{
"id": 1,
"type": "Feature",
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]], [[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]]
[[[100.5, 0.5], [101.5, 0.5], [101.5, 1.5], [100.5, 1.5], [100.5, 0.5]]],
]
}
}
```

map.queryRenderedFeatures(...) will not return any features where the first polygon in the multipolygon overlaps the second polygon in the multipolygon.
### Link to Demonstration
If you have a mapboxgl accessToken, see the demo here:
https://jsfiddle.net/5on0krp8/
### Expected Behavior
map.queryRenderedFeatures(...) should return MutliPolygon features where a MutliPolygon overlaps.
### Actual Behavior
map.queryRenderedFeatures(...) fails to return MutliPolygon features where a MutliPolygon overlaps.
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
Reproduce the issue using the linked JSFiddle with mapbox-gl-js 1.11.1 or 1.12.0, focusing on map.queryRenderedFeatures for the overlapping MultiPolygon. Trace the query entry point and rendering geometry handling; done means the feature is returned when the pointer is over the overlapping area.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100