-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Enable auto generation of ids for GeoJSON sources #7043
Conversation
2af2d7d
to
55ef37c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good! Although worth noting that I just realized that Supercluster doesn't have an equivalent of generateId
option, so if the original GeoJSON doesn't have id
in features, they will only be present for the clusters, not the points. Should we add it there as well? Should be trivial.
It looks like this is only done when you initialise a new GeoJSON source, if you subsequently use |
@andrewharvey it should generate ids every time. I just realized that this is somewhat of a problem though. |
Previously cached internally to GL JS or by the user outside GL JS? I should be fine if ID's change since you're resetting the data anyway, and anyone who needs stable IDs can provide their own. |
|
@andrewharvey this would be both. |
55ef37c
to
79a1ec8
Compare
…json-vt generateId
79a1ec8
to
3778d05
Compare
…reset in `Map#setFeatureState`
3778d05
to
57c1e14
Compare
How to use auto-generated-ID? |
@hoogw You can enable id generation by setting the generateId flag on your GeoJSON source. |
@asheemmamoowala What if I have type: vector instead of type: geojson I want to use map.setFeatureState(), have to have a unique id, How to get "generateid" ? |
this works fine.
"generateId":true also works in vector source?
and this ???
|
Closes #6849.
Upgrades geojson related libraries to include auto-generation of ids for geojson features and clusters.
cc @ryanbaumann