Skip to content

Commit

Permalink
Fix merge collision between PR#6559 and PR#6263.
Browse files Browse the repository at this point in the history
- Query tests now have extra data in them
- Tile#setFeatureState needs to switch to getting vtLayers from FeatureIndex.
  • Loading branch information
ChrisLoer authored and jfirebaugh committed May 1, 2018
1 parent e83054f commit aedbccc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 7 additions & 5 deletions src/source/tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,17 +413,19 @@ class Tile {
}

setFeatureState(states: LayerFeatureStates) {
if (!this.latestRawTileData || Object.keys(states).length === 0) return;

if (!this.vtLayers) {
this.vtLayers = new vt.VectorTile(new Protobuf(this.latestRawTileData)).layers;
if (!this.latestFeatureIndex ||
!this.latestFeatureIndex.rawTileData ||
Object.keys(states).length === 0) {
return;
}

const vtLayers = this.latestFeatureIndex.loadVTLayers();

for (const i in this.buckets) {
const bucket = this.buckets[i];
// Buckets are grouped by common source-layer
const sourceLayerId = bucket.layers[0]['sourceLayer'] || '_geojsonTileLayer';
const sourceLayer = this.vtLayers[sourceLayerId];
const sourceLayer = vtLayers[sourceLayerId];
const sourceLayerStates = states[sourceLayerId];
if (!sourceLayer || !sourceLayerStates || Object.keys(sourceLayerStates).length === 0) continue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
]
},
"type": "Feature",
"properties": {}
"properties": {},
"source": "source",
"state": {}
}
]
]

0 comments on commit aedbccc

Please sign in to comment.