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

Handle feature id 0 #107

Merged
merged 2 commits into from Jun 27, 2018
Merged

Handle feature id 0 #107

merged 2 commits into from Jun 27, 2018

Conversation

ChrisLoer
Copy link
Contributor

I just ran into an odd test discrepancy between mapbox gl-native and gl-js and tracked it down to geojson-vt treating a feature with id of "0" as if it doesn't have an id.

We could alternatively get a little stricter and require it to be a number or a string? (as in: https://github.com/mapbox/geometry.hpp/blob/cfcb983f3571269653467f0a679bd956366c101e/include/mapbox/geometry/feature.hpp#L47)

/cc @mourner

@ChrisLoer ChrisLoer requested a review from mourner June 26, 2018 20:37
@mourner mourner merged commit 15f9f99 into master Jun 27, 2018
@mourner mourner deleted the feature-id-0 branch June 27, 2018 06:29
@andrewharvey
Copy link
Contributor

Great work @ChrisLoer, I just ran into this in GL JS wondering why one of my feature's wasn't working with feature-states, turns out it was the unlucky feature to get an id of 0. Easy to workaround by starting feature IDs from 1, but would be nice to have this in a geojson-vt release and updated in mapbox-gl-js for the next release.

@mourner
Copy link
Member

mourner commented Jul 9, 2018

@andrewharvey thanks for the reminder! Just published v3.1.4.

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

Successfully merging this pull request may close these issues.

None yet

3 participants