Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features lose IDs in queryRenderedFeatures after setData with promoteId #13165

Open
3zzy opened this issue Apr 29, 2024 · 0 comments
Open

Features lose IDs in queryRenderedFeatures after setData with promoteId #13165

3zzy opened this issue Apr 29, 2024 · 0 comments

Comments

@3zzy
Copy link

3zzy commented Apr 29, 2024

mapbox-gl-js version:
3.0.0

browser:
Chrome

Steps to Trigger Behavior

  1. Load the map with a GeoJSON layer that has two features and promoteId: 'submissionID'.
  2. Use setData to update the GeoJSON source with additional features.
  3. 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: #10257

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant