Skip to content

Commit

Permalink
fix(VectorTile): loading texture on VectorTile when node.pendingSubdi…
Browse files Browse the repository at this point in the history
…vision !need improvment!
  • Loading branch information
ftoromanoff committed Sep 5, 2023
1 parent bd5f80a commit a2da04a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Layer/LayerUpdateStrategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ export const STRATEGY_GROUP = 1;
export const STRATEGY_PROGRESSIVE = 2;
export const STRATEGY_DICHOTOMY = 3;

function _minimizeNetworkTraffic(node, nodeLevel, currentLevel) {
if (node.pendingSubdivision) {
function _minimizeNetworkTraffic(node, nodeLevel, currentLevel, source) {
// TO DO source.isVectorTileSource is a temp fix for pendingSubdivision
if (node.pendingSubdivision && !source.isVectorTileSource) {
return currentLevel;
}
return nodeLevel;
Expand Down Expand Up @@ -72,7 +73,7 @@ export function chooseNextLevelToFetch(strategy, node, nodeLevel = node.level, c
// default strategy
case STRATEGY_MIN_NETWORK_TRAFFIC:
default:
nextLevelToFetch = _minimizeNetworkTraffic(node, nodeLevel, currentLevel);
nextLevelToFetch = _minimizeNetworkTraffic(node, nodeLevel, currentLevel, layer.source);
}
nextLevelToFetch = Math.min(nextLevelToFetch, maxZoom);
}
Expand Down
1 change: 1 addition & 0 deletions src/Source/VectorTilesSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class VectorTilesSource extends TMSSource {
this.layers = {};
this.styles = {};
let promise;
this.isVectorTileSource = true;

this.accessToken = source.accessToken;

Expand Down

0 comments on commit a2da04a

Please sign in to comment.