Skip to content

Commit

Permalink
Merge PR #362 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by yvaucher
  • Loading branch information
OCA-git-bot committed Aug 28, 2024
2 parents bdca5d0 + 05d3da4 commit 5714157
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,21 @@ export class GeoengineRenderer extends Component {
const source = [];
source.push(new ol.layer.Tile({source: new ol.source.OSM()}));
const backgroundLayers = backgrounds.map((background) => {
var urls = [];
switch (background.raster_type) {
case "osm":
var osmOptions = {};
if (background.url) {
urls = background.url.split(",");
if (urls.length > 0) {
osmOptions.url = urls[0];
}
}
return new ol.layer.Tile({
title: background.name,
visible: !background.overlay,
type: "base",
source: new ol.source.OSM(),
source: new ol.source.OSM(osmOptions),
});
case "wmts":
const {source_opt, tilegrid_opt, layer_opt} =
Expand Down Expand Up @@ -217,7 +225,7 @@ export class GeoengineRenderer extends Component {
params: JSON.parse(background.params_wms),
serverType: background.server_type,
};
const urls = background.url.split(",");
urls = background.url.split(",");
if (urls.length > 1) {
source_opt_wms.urls = urls;
} else {
Expand Down

0 comments on commit 5714157

Please sign in to comment.