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
ID collisions in geometry returned from queryRenderedFeatures and querySourceFeatures result in inconsistent rendering after calling setFeatureState
#8707
Closed
sansumbrella opened this issue
Aug 29, 2019
· 2 comments
Create a tileset in studio with linestrings that cross tile boundaries
Use querySourceFeatures or queryRenderedFeatures to find the ids of those linestrings
Use setFeatureState to change a render property of the linestrings
I remember some discussion about providing an API for generating unique ids from properties of input geoJSON data. I expect tiled data to already be handled correctly and for the ids to be unique.
Link to Demonstration
I created a dataset with a unique source_id property on each linestring. That dataset was tiled and added to my style in studio, and is loaded in the map linked below: https://jsbin.com/sanuyut/edit?html,output
Expected Behavior
Mapbox tiling and queries to the source and rendered geometry produce unique ids for each piece of geometry. SetFeatureState is able to uniquely and consistently change properties for a given linestring.
Actual Behavior
Ids are reused across tiles, which makes it impossible to uniquely identify features. This causes style collisions where features with unique properties are assigned the same featurestate because they share an id generated by Mapbox.
Render duplicate ids:
Multiple features share map id 1 and have (properties.source_id) values: 2, 1004
Multiple features share map id 2 and have (properties.source_id) values: 1, 1005
runner-4.1.7.min.js:1 Source duplicate ids:
Multiple features share map id 1 and have (properties.source_id) values: 1004, 2
Multiple features share map id 2 and have (properties.source_id) values: 1005, 1
The text was updated successfully, but these errors were encountered:
mapbox-gl-js version: 1.3
browser: Chrome, Firefox (latest)
Steps to Trigger Behavior
I remember some discussion about providing an API for generating unique ids from properties of input geoJSON data. I expect tiled data to already be handled correctly and for the ids to be unique.
Link to Demonstration
I created a dataset with a unique
source_id
property on each linestring. That dataset was tiled and added to my style in studio, and is loaded in the map linked below:https://jsbin.com/sanuyut/edit?html,output
Expected Behavior
Mapbox tiling and queries to the source and rendered geometry produce unique ids for each piece of geometry. SetFeatureState is able to uniquely and consistently change properties for a given linestring.
Actual Behavior
Ids are reused across tiles, which makes it impossible to uniquely identify features. This causes style collisions where features with unique properties are assigned the same featurestate because they share an id generated by Mapbox.
The text was updated successfully, but these errors were encountered: