From a2da04aec58c6a4a883eea5b3dca03b17266c31c Mon Sep 17 00:00:00 2001 From: ftoromanoff Date: Fri, 21 Jul 2023 12:18:35 +0200 Subject: [PATCH] fix(VectorTile): loading texture on VectorTile when node.pendingSubdivision !need improvment! --- src/Layer/LayerUpdateStrategy.js | 7 ++++--- src/Source/VectorTilesSource.js | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Layer/LayerUpdateStrategy.js b/src/Layer/LayerUpdateStrategy.js index 83d0ee13cc..32d8343a8f 100644 --- a/src/Layer/LayerUpdateStrategy.js +++ b/src/Layer/LayerUpdateStrategy.js @@ -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; @@ -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); } diff --git a/src/Source/VectorTilesSource.js b/src/Source/VectorTilesSource.js index c67fd6cf9e..b2095f50c6 100644 --- a/src/Source/VectorTilesSource.js +++ b/src/Source/VectorTilesSource.js @@ -56,6 +56,7 @@ class VectorTilesSource extends TMSSource { this.layers = {}; this.styles = {}; let promise; + this.isVectorTileSource = true; this.accessToken = source.accessToken;