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

CP removeFeatureState fix #8090

Merged
merged 2 commits into from
Mar 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- Fixed a bug where default HTML marker positioning was slightly off. [#8074](https://github.com/mapbox/mapbox-gl-js/pull/8074)
- Fixed a bug where adding a fill extrusion layer for non-polygon layers would lead to visual artifacts. [#7685](https://github.com/mapbox/mapbox-gl-js/pull/7685)
- Fixed intermittent Flow failures on CI. [#8061](https://github.com/mapbox/mapbox-gl-js/pull/8061)
- Fixed a bug where calling `Map#removeFeatureState` does not remove the state from some tile zooms [#8087](https://github.com/mapbox/mapbox-gl-js/pull/8087)

## 0.53.1

Expand Down
6 changes: 4 additions & 2 deletions src/source/source_state.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ class SourceFeatureState {
const layerStates = {};

if (this.deletedStates[sourceLayer] === null) {
for (const ft in this.state[sourceLayer]) layerStates[ft] = {};
this.state[sourceLayer] = {};
for (const ft in this.state[sourceLayer]) {
layerStates[ft] = {};
this.state[sourceLayer][ft] = {};
}
} else {
for (const feature in this.deletedStates[sourceLayer]) {
const deleteWholeFeatureState = this.deletedStates[sourceLayer][feature] === null;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"version": 8,
"metadata": {
"test": {
"width": 64,
"height": 64,
"operations": [
[
"setFeatureState",
{
"source": "geojson",
"id": "1"
},
{
"color": "red"
}
],
[
"wait"
],
[
"setZoom", 3
]
,
[
"wait"
],
[
"removeFeatureState",
{
"source": "geojson"
}
],
[
"wait"
],
[
"setZoom", 2
],
[
"wait"
]
]
}
},
"zoom": 2,
"sources": {
"geojson": {
"type": "geojson",
"data": {
"type": "Feature",
"id": "1",
"geometry": {
"type": "Point",
"coordinates": [
0,
0
]
}
}
}
},
"layers": [
{
"id": "circle",
"type": "circle",
"source": "geojson",
"paint": {
"circle-radius": 5,
"circle-color": [
"coalesce",
[
"feature-state",
"color"
],
"black"
]
}
}
]
}