mapbox-gl-js
mapbox-gl-js copied to clipboard
Features lose IDs in queryRenderedFeatures after setData with promoteId
mapbox-gl-js version: 3.0.0
browser: Chrome
Steps to Trigger Behavior
- Load the map with a GeoJSON layer that has two features and
promoteId: 'submissionID'. - Use
setDatato update the GeoJSON source with additional features. - Query rendered features on a map click and check the console for feature IDs.
Link to Demonstration
https://jsfiddle.net/iaezzy/5cphq7nd/1/
Expected Behavior
When querying rendered features after updating the GeoJSON source, the returned features should retain their IDs specified by the promoteId.
Actual Behavior
After updating the GeoJSON source using setData, querying rendered features returns features without their IDs, despite using promoteId to specify the property that should map to the feature ID.
A similar issue has been reported before which is probably still not fixed: https://github.com/mapbox/mapbox-gl-js/issues/10257