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

Automatically generate feature id values for geojson & cluster sources #6849

Closed
ryanbaumann opened this issue Jun 22, 2018 · 3 comments · Fixed by #7043
Closed

Automatically generate feature id values for geojson & cluster sources #6849

ryanbaumann opened this issue Jun 22, 2018 · 3 comments · Fixed by #7043

Comments

@ryanbaumann
Copy link
Contributor

ryanbaumann commented Jun 22, 2018

Motivation

Examples using map.setFeatureState() like this https://www.mapbox.com/mapbox-gl-js/example/hover-styles/ require that a user include an integer parent id value in their geojson or vector tile source.

Design Alternatives

  • Create more documentation about parent id requirement to use featureStates

Design

  • Automatically generate parent a id value for a geojson source in geojson-vt, so that all geojson source features support featureStates.

  • Automatically generate a parent id for clustered geojson datasources

  • Not sure if a similar approach is possible for vector tile sources.

Mock-Up

Geojson-vt auto-generates feature id values for geojson and cluster sources.

Concepts

  • Vector tile id values
  • The difference between how vector tile sources and geojson sources are created and how they support featureStates.
@andrewharvey
Copy link
Collaborator

👍 There's a discussion around this over at #6019

@ryanbaumann
Copy link
Contributor Author

Thanks, @andrewharvey! Open to feedback about whether to close ticket then and re-open a docs-focused ticket that details how to create id values for features to use with feature states.

@ryanbaumann ryanbaumann changed the title Automatically generate feature id values for geojson sources Automatically generate feature id values for geojson & cluster sources Jun 24, 2018
@asheemmamoowala
Copy link
Contributor

Depends on geojson-vt#109 and supercluster#94.

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

Successfully merging a pull request may close this issue.

3 participants