Skip to content

Commit

Permalink
Go back to previous algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhamley committed Oct 29, 2019
1 parent 86139df commit 09dd98d
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/render/painter.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,16 +432,24 @@ class Painter {

if (this.options.showTileBoundaries) {
//Use source with highest maxzoom
let maxZoomSourceCache;
for (const source in this.style.sourceCaches) {
const cache = this.style.sourceCaches[source];
if (!maxZoomSourceCache || cache._source.maxzoom > maxZoomSourceCache._source.maxZoom) {
maxZoomSourceCache = cache;
let selectedSource;
let sourceCache;
const layers = values(this.style._layers);

layers.forEach((layer) => {
if (layer.source && !layer.isHidden(this.transform.zoom)) {
if (layer.source !== (sourceCache && sourceCache.id)) {
sourceCache = this.style.sourceCaches[layer.source];
}

if (!selectedSource || (selectedSource.getSource().maxzoom < sourceCache.getSource().maxzoom)) {
selectedSource = sourceCache;
}
}
}
});

if (maxZoomSourceCache) {
draw.debug(this, maxZoomSourceCache, maxZoomSourceCache.getVisibleCoordinates());
if (selectedSource) {
draw.debug(this, selectedSource, selectedSource.getVisibleCoordinates());
}
}

Expand Down

0 comments on commit 09dd98d

Please sign in to comment.