Skip to content

Commit

Permalink
fix(Style): take style.zoom into account for LabelLayer and Feature2T…
Browse files Browse the repository at this point in the history
…exture
  • Loading branch information
ftoromanoff committed Jan 15, 2025
1 parent 497ac8c commit 5ec037b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Converter/Feature2Texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ function drawFeature(ctx, feature, extent, invCtxScale) {
for (const geometry of feature.geometries) {
if (Extent.intersectsExtent(geometry.extent, extent)) {
context.setGeometry(geometry);
if (style.zoom.min > style.context.zoom || style.zoom.max <= style.context.zoom) {
return;
}

if (
feature.type === FEATURE_TYPES.POINT && style.point
Expand Down
4 changes: 4 additions & 0 deletions src/Layer/LabelLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ class LabelLayer extends GeometryLayer {
}
}

if (this.style.zoom.min > this.style.context.zoom || this.style.zoom.max <= this.style.context.zoom) {
return;
}

const label = new Label(content, coord.clone(), this.style);

label.layerId = this.id;
Expand Down

0 comments on commit 5ec037b

Please sign in to comment.