diff --git a/components/map/layers/BingLayer.js b/components/map/layers/BingLayer.js index 477cb43fc..d3b0d275d 100644 --- a/components/map/layers/BingLayer.js +++ b/components/map/layers/BingLayer.js @@ -9,6 +9,8 @@ import ol from 'openlayers'; +import ConfigUtils from '../../../utils/ConfigUtils'; + export default { create: (options) => { if (!options.apiKey) { @@ -18,7 +20,7 @@ export default { const layer = new ol.layer.Tile({ minResolution: options.minResolution, maxResolution: options.maxResolution, - preload: Infinity, + preload: ConfigUtils.getConfigProp("tilePreloadLevels", null, 0), source: new ol.source.BingMaps({ projection: options.projection, key: options.apiKey, diff --git a/components/map/layers/OSMLayer.js b/components/map/layers/OSMLayer.js index af7e151e3..fad7a05ac 100644 --- a/components/map/layers/OSMLayer.js +++ b/components/map/layers/OSMLayer.js @@ -9,11 +9,14 @@ import ol from 'openlayers'; +import ConfigUtils from '../../../utils/ConfigUtils'; + export default { create: (options) => { return new ol.layer.Tile({ minResolution: options.minResolution, maxResolution: options.maxResolution, + preload: ConfigUtils.getConfigProp("tilePreloadLevels", null, 0), source: new ol.source.OSM({ url: options.url, projection: options.projection, diff --git a/components/map/layers/WMSLayer.js b/components/map/layers/WMSLayer.js index ca190d65c..01d1dc0e0 100644 --- a/components/map/layers/WMSLayer.js +++ b/components/map/layers/WMSLayer.js @@ -97,6 +97,7 @@ export default { const layer = new ol.layer.Tile({ minResolution: options.minResolution, maxResolution: options.maxResolution, + preload: ConfigUtils.getConfigProp("tilePreloadLevels", null, 0), source: new ol.source.TileWMS({ urls: [options.url.split("?")[0]], params: queryParameters, diff --git a/components/map/layers/WMTSLayer.js b/components/map/layers/WMTSLayer.js index 92c615090..c89710f03 100644 --- a/components/map/layers/WMTSLayer.js +++ b/components/map/layers/WMTSLayer.js @@ -11,6 +11,7 @@ import ColorLayer from '@giro3d/giro3d/core/layer/ColorLayer'; import TiledImageSource from "@giro3d/giro3d/sources/TiledImageSource.js"; import ol from 'openlayers'; +import ConfigUtils from '../../../utils/ConfigUtils'; import CoordinatesUtils from '../../../utils/CoordinatesUtils'; function getWMSURLs(urls) { @@ -60,6 +61,7 @@ export default { return new ol.layer.Tile({ minResolution: options.minResolution, maxResolution: options.maxResolution, + preload: ConfigUtils.getConfigProp("tilePreloadLevels", null, 0), source: createWMTSSource(options), ...(options.layerConfig || {}) }); diff --git a/components/map/layers/XYZLayer.js b/components/map/layers/XYZLayer.js index 9379c85d7..2035ec395 100644 --- a/components/map/layers/XYZLayer.js +++ b/components/map/layers/XYZLayer.js @@ -8,11 +8,14 @@ import ol from 'openlayers'; +import ConfigUtils from '../../../utils/ConfigUtils'; + export default { create: (options) => { return new ol.layer.Tile({ minResolution: options.minResolution, maxResolution: options.maxResolution, + preload: ConfigUtils.getConfigProp("tilePreloadLevels", null, 0), source: new ol.source.XYZ({ url: options.url, projection: options.projection,