Skip to content

Commit

Permalink
fix precedence of promoteId over feature id in fill extrusions (#9863)
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner authored Jul 9, 2020
1 parent 1e9b41d commit 25afccb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/data/bucket/fill_extrusion_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class FillExtrusionBucket implements Bucket {

if (!this.layers[0]._featureFilter.filter(new EvaluationParameters(this.zoom), evaluationFeature, canonical)) continue;

const patternFeature: BucketFeature = {
const bucketFeature: BucketFeature = {
id,
sourceLayerIndex,
index,
Expand All @@ -111,17 +111,13 @@ class FillExtrusionBucket implements Bucket {
patterns: {}
};

if (typeof feature.id !== 'undefined') {
patternFeature.id = feature.id;
}

if (this.hasPattern) {
this.features.push(addPatternDependencies('fill-extrusion', this.layers, patternFeature, this.zoom, options));
this.features.push(addPatternDependencies('fill-extrusion', this.layers, bucketFeature, this.zoom, options));
} else {
this.addFeature(patternFeature, patternFeature.geometry, index, canonical, {});
this.addFeature(bucketFeature, bucketFeature.geometry, index, canonical, {});
}

options.featureIndex.insert(feature, patternFeature.geometry, index, sourceLayerIndex, this.index, true);
options.featureIndex.insert(feature, bucketFeature.geometry, index, sourceLayerIndex, this.index, true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"id": 1,
"geometry": {
"type": "Polygon",
"coordinates": [
Expand Down Expand Up @@ -71,6 +72,7 @@
}
}, {
"type": "Feature",
"id": 1,
"geometry": {
"type": "Polygon",
"coordinates": [
Expand Down Expand Up @@ -103,6 +105,7 @@
}
}, {
"type": "Feature",
"id": 1,
"geometry": {
"type": "Polygon",
"coordinates": [
Expand Down

0 comments on commit 25afccb

Please sign in to comment.