-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
queryRenderedFeatures doesnt take into account feature states (#6569)
Update tile queryPadding with every feature state update and include feature state in expression evaluation for query intersection tests.
- Loading branch information
Asheem Mamoowala
authored
May 3, 2018
1 parent
db83b5e
commit c9c4f61
Showing
9 changed files
with
113 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
test/integration/query-tests/circle-radius/feature-state/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[ | ||
{ | ||
"type": "Feature", | ||
"id": 1, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [0, 0] | ||
}, | ||
"properties": {}, | ||
"source": "mapbox", | ||
"state": { "big": true } | ||
} | ||
] |
72 changes: 72 additions & 0 deletions
72
test/integration/query-tests/circle-radius/feature-state/style.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"width": 64, | ||
"height": 64, | ||
"operations": [ | ||
[ | ||
"wait" | ||
], | ||
[ | ||
"setFeatureState", | ||
{ "source": "mapbox", "id": 1}, | ||
{ "big": true } | ||
], | ||
[ | ||
"wait" | ||
] | ||
], | ||
"queryGeometry": [ | ||
32, | ||
16 | ||
] | ||
} | ||
}, | ||
"sources": { | ||
"mapbox": { | ||
"type": "geojson", | ||
"data": { | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"id": 1, | ||
"type": "Feature", | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
0, | ||
0 | ||
] | ||
} | ||
}, | ||
{ | ||
"id": 2, | ||
"type": "Feature", | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
5, | ||
15 | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"layers": [ | ||
{ | ||
"id": "circle", | ||
"type": "circle", | ||
"source": "mapbox", | ||
"paint": { | ||
"circle-radius": ["case", | ||
["boolean", ["feature-state", "big"], false], | ||
["number", 20], | ||
["number", 3] | ||
] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters