Skip to content

Commit

Permalink
fix(layer): updateInResolutionRange works properly if maxResolution =…
Browse files Browse the repository at this point in the history
… 0 (#597)

* fix(layer): updateInResolutionRange works properly if maxResolution = 0

* Update layer.ts

Co-authored-by: Marc-André Barbeau <[email protected]>
  • Loading branch information
drekss and mbarbeau committed May 11, 2020
1 parent 0eb7b21 commit cb6226a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/geo/src/lib/layer/shared/layers/layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,8 @@ export abstract class Layer {
if (this.map !== undefined) {
const resolution = this.map.viewController.getResolution();
const minResolution = this.minResolution;
const maxResolution = this.maxResolution;
this.isInResolutionsRange =
resolution >= minResolution && resolution <= maxResolution;
const maxResolution = this.maxResolution === undefined ? Infinity : this.maxResolution;
this.isInResolutionsRange = resolution >= minResolution && resolution <= maxResolution;
} else {
this.isInResolutionsRange = false;
}
Expand Down

0 comments on commit cb6226a

Please sign in to comment.