[Bug] MVTLayer with `binary: false` moves feature ID into `feature.properties.id`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 14.6k
- Forks
- 2.3k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 42
Description
Description
For an MVTLayer with binary: false, when accessing feature data e.g. in an onClick handler, each feature's id is moved by deck.gl into feature.properties rather than being present as feature.id.
This issue appeared when updating deck.gl from 8.9.28 to 9.1.4.
Flavors
- Script tag
- React
- Python/Jupyter notebook
- MapboxOverlay
- GoogleMapsOverlay
- CARTO
- ArcGIS
Expected Behavior
When accessing in interaction handlers, accessor functions etc. - MVT features that do have an ID in the original dataset (as contrasted with an id property) should have a feature.id present, rather than a feature.properties.id.
Steps to Reproduce
The sandbox shows a sample point dataset. The original MVT features all have IDs.
The MVTLayer has autoHighlight enabled, as well as layer styling that is dependent on the selected feature ID.
The UI shows the stringified last clicked feature.
There's also toggles for binary and uniqueIdProperty props.
- With
binary: true:- auto-highlight works
- selection-based styling doesn't work (this is expected because the accessors don't have access to the binary feature data)
- the clicked features do have an
id
- After switching to
binary: false- auto-highlight stops working
- upon clicking a feature, it can be seen that the
idfor the feature has now ended up infeature.properties, which is unexpected - the selection-based styling still doesn't work because the features now don't have a
feature.id
- Only after setting
uniqueIdProperty: 'id'prop as a workaround:- auto highlight works again
- selection-based styling works
Environment
- Framework version: 9.1.4
- Browser:
- OS:
Logs
No response
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 with the linked CodeSandbox and reproduce the MVTLayer behavior by toggling binary and uniqueIdProperty. Trace the non-binary feature conversion and ID handling used by the React example. Done means original MVT feature IDs remain available as feature.id with binary: false, while autoHighlight and selection-based styling continue to work without the workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- data-visualization, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100