-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Using setFeatureState
with Vector Tiles
#7049
Comments
Tippecanoe is reporting correctly that string values are not valid ids in v2.1 of the spec. Try using integer ids instead. |
Hi @asheemmamoowala! I unfortunately cannot use integer ids (since the feature ids are generated elsewhere as uuids). Is there any way around this? |
I recently added a Tippecanoe feature to auto-assign numeric IDs, which you may find useful: mapbox/tippecanoe#615 |
Thanks for the pointer, @ericfischer. This will be helpful, but I will still have to maintain a mapping between the auto-generated ids and the feature uuids somewhere for the local join to work. I am wondering if there is an easier way to do this. |
Hello, I started using tippecanoe about 15 minutes ago and I have a question on using this new feature. How exactly would I use this new feature to set the feature.id to be equal to an id attribute in the geojson? In the super basic example command from the documentation, the command I'm using is this (on a Mac): How do I use --generate-ids to convert my attribute "LHA_NUM" to be the feature.id of the output .mbtiles? Thanks for your help in advance! |
@devPuppySim this issue tracker is for reporting bugs and feature requests for the gl-js project only. |
mapbox-gl-js version: 0.47.0
Question
Is there a way to use
setFeatureState
with VectorTile layers if the feature id is a string?Context: I have a VectorTile source that serves tiles I generated using Tippecanoe. Having noticed that
setFeatureState
relies on having a unique id for each feature, I tried re-generating the tiles with Tippecanoe, this time with setting theid
property for each feature with it's uuid property (an identifier that I don't control myself). Tippecanoe complains that non-numeric ids aren't allowed according to the Vector Tile Spec. How do I set the state of the feature if I can't set its id? CansetFeatureState
be used with properties (by havingid
under the feature properties)?The text was updated successfully, but these errors were encountered: