You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using GeoJsonLayer with binary data, layer accessors receive a feature object which is missing important fields such as id. When creating a GeoJsonLayer with the same feature in GeoJSON format, the id field is present.
With no other changes, but supplying data to the layer as binary, the same accessor receives the object:
{
"properties": {
"foo": "bar"
}
}
Flavors
Script tag
React
Python/Jupyter notebook
MapboxOverlay
GoogleMapsOverlay
CartoLayer
ArcGIS
Expected Behavior
Although it may not be feasible to reconstruct the entire feature object for performance reasons, it would be really useful to still have access to the id field within accessors. This is useful for features like having a highlighted feature (not using autoHighlight) which is based on the feature's id.
As a workaround I am currently duplicating the id in the properties object as well, but it means I'm sending some unnecessary data in my MVT responses that I'd like to avoid.
Description
When using GeoJsonLayer with binary data, layer accessors receive a feature object which is missing important fields such as
id
. When creating a GeoJsonLayer with the same feature in GeoJSON format, theid
field is present.Example feature:
Creating a GeoJsonLayer from this feature, and providing it as a normal GeoJSON object, accessors such as
getText
will receive the object:With no other changes, but supplying data to the layer as binary, the same accessor receives the object:
Flavors
Expected Behavior
Although it may not be feasible to reconstruct the entire feature object for performance reasons, it would be really useful to still have access to the
id
field within accessors. This is useful for features like having a highlighted feature (not usingautoHighlight
) which is based on the feature'sid
.Steps to Reproduce
https://codepen.io/aethrXor/pen/gOVbrGv?editors=0010
Environment
Logs
No response
The text was updated successfully, but these errors were encountered: