Fix GeoJSONSource#updateData for symbol layers #6801
+64
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6795
Problem
When calling
GeoJSONSource#updateDatato remove features, symbol layers would incorrectly keep displaying the removed features or hide features at the wrong times during zoom operations.Root Cause
The code was iterating through
tile.latestFeatureIndex.featureIndexArrayto determine which tiles needed reloading. However,featureIndexArrayexcludes symbol features. This meant that tiles containing symbol features would not be marked for reload when those features were updated or removed.Solution
Changed the reload detection logic to iterate through
layers[GEOJSON_TILE_LAYER_NAME], which includes all features including symbol features. This ensures tiles are properly reloaded when any feature is updated, regardless of layer type.Testing
Added integration regression test at test/integration/render/tests/regressions/mapbox-gl-js#6795/
Launch Checklist
CHANGELOG.mdunder the## mainsection.