Skip to content

Commit

Permalink
fix assertion error
Browse files Browse the repository at this point in the history
  • Loading branch information
ansis committed Oct 18, 2021
1 parent 8047cd5 commit d0afb1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/source/source_cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ class SourceCache extends Evented {
if (idealTileIDs.length === 0) { return retain; }

const checked: {[_: number | string]: boolean } = {};
const minZoom = idealTileIDs[idealTileIDs.length - 1].overscaledZ;
const minZoom = idealTileIDs.reduce((min, id) => Math.min(min, id.overscaledZ), Infinity);
const maxZoom = idealTileIDs[0].overscaledZ;
assert(minZoom <= maxZoom);
const minCoveringZoom = Math.max(maxZoom - SourceCache.maxOverzooming, this._source.minzoom);
Expand Down

0 comments on commit d0afb1b

Please sign in to comment.