Skip to content

Commit

Permalink
Introduce new global tilePreloadLevels config setting
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Dec 3, 2024
1 parent 78a6117 commit 994a8c7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/map/layers/BingLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import ol from 'openlayers';

import ConfigUtils from '../../../utils/ConfigUtils';

export default {
create: (options) => {
if (!options.apiKey) {
Expand All @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions components/map/layers/OSMLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions components/map/layers/WMSLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions components/map/layers/WMTSLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 || {})
});
Expand Down
3 changes: 3 additions & 0 deletions components/map/layers/XYZLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 994a8c7

Please sign in to comment.