diff --git a/assets/src/legacy/switcher-layers-actions.js b/assets/src/legacy/switcher-layers-actions.js index aabd707707..a52d0699d4 100644 --- a/assets/src/legacy/switcher-layers-actions.js +++ b/assets/src/legacy/switcher-layers-actions.js @@ -150,24 +150,26 @@ var lizLayerActionButtons = function() { html+= ''; } } - // Opacity - html+= '
'+lizDict['layer.metadata.opacity.title']+'
'; - html+= '
'; - html+= ''; - - const currentOpacity = lizMap.mainLizmap.state.layersAndGroupsCollection.getLayerOrGroupByName(aName).opacity; - var opacities = lizMap.config.options.layersOpacities; - if(typeof opacities === 'undefined') { - opacities = [0.2, 0.4, 0.6, 0.8, 1]; - } - for ( var i=0, len=opacities.length; i'+opacities[i]*100+''; + const currentLayerState = lizMap.mainLizmap.state.rootMapGroup.getMapLayerByName(aName); + if (!currentLayerState.singleWMSLayer) { + html+= '
'+lizDict['layer.metadata.opacity.title']+'
'; + html+= '
'; + html+= ''; + + const currentOpacity = lizMap.mainLizmap.state.layersAndGroupsCollection.getLayerOrGroupByName(aName).opacity; + var opacities = lizMap.config.options.layersOpacities; + if (typeof opacities === 'undefined') { + opacities = [0.2, 0.4, 0.6, 0.8, 1]; + } + for ( var i=0, len=opacities.length; i'+opacities[i]*100+''; + } + html+= '
'; } - html+= ''; // Export if ( 'exportLayers' in lizMap.config.options diff --git a/assets/src/modules/Config.js b/assets/src/modules/Config.js index 95e84b6a4a..27a949fdee 100644 --- a/assets/src/modules/Config.js +++ b/assets/src/modules/Config.js @@ -94,7 +94,6 @@ export class Config { throw new ValidationError('No `' + prop + '` in the WMS Capabilities!'); } } - this._theConfig = theConfig; this._theWmsCapabilities = theWmsCapabilities; diff --git a/assets/src/modules/SingleWMSLayer.js b/assets/src/modules/SingleWMSLayer.js new file mode 100644 index 0000000000..38d9dc0473 --- /dev/null +++ b/assets/src/modules/SingleWMSLayer.js @@ -0,0 +1,367 @@ +import { mainLizmap } from './Globals.js' +import map from './map.js' +import { MapLayerLoadStatus, MapLayerState } from '../modules/state/MapLayer.js'; +import Utils from './Utils.js'; +import ImageWMS from 'ol/source/ImageWMS.js'; +import {Image as ImageLayer, Tile as TileLayer} from 'ol/layer.js'; +import TileWMS from 'ol/source/TileWMS.js'; +import { BaseLayerState } from './state/BaseLayer.js'; +import { ValidationError } from './Errors.js'; + +/** + * Class for manage the load/display selected layers as a single OpenLayers ImageWMS layer + * @class + */ +export default class SingleWMSLayer { + /** + * Initialize the ImageWMS layer + * @param {map} mainMapInstance the main map instance + */ + //constructor(singleWMSLayerList) { + constructor(mainMapInstance) { + if (!mainLizmap.state.map.singleWMSLayer || !mainMapInstance || !(mainMapInstance instanceof map) || mainMapInstance.statesSingleWMSLayers.size == 0) { + throw new ValidationError('The Configuration is not valid, could not load the map as single WMS Layer'); + } + + /** + * the map instance + * @type {map} + */ + this._mainMapInstance = mainMapInstance; + + /** + * all the layers that should be inluded in the single ImageWMS. Contains layers names with their states sorted by layerOrder (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) + * @type {Map} + */ + this._singleWMSLayerList = mainMapInstance.statesSingleWMSLayers; + + /** + * list of base layers names + * @type {String[]} + */ + this._baseLayers = []; + + /** + * list of all map layers names + * @type {String[]} + */ + this._mapLayers = []; + + /** + * list of layers names on the current single layer displayed on map + * @type {String[]} + */ + this._layersName = []; + /** + * list of layers wms names on the current single layer displayed on map + * @type {String[]} + */ + this._layersWmsName = []; + + /** + * list of layers styles on the current single layer displayed on map + * @type {String[]} + */ + this._layerStyles = []; + + /** + * list of selection token parameter on the current single layer displayed on map + * @type {String[]} + */ + this._selectionTokens = []; + + /** + * list of filter token parameter on the current single layer displayed on map + * @type {String[]} + */ + this._filterTokens = []; + + /** + * list of legendOn parameter on the current single layer displayed on map + * @type {String[]} + */ + this._legendOn = []; + + /** + * list of legendOff parameter on the current single layer displayed on map + * @type {String[]} + */ + this._legendOff = []; + + /** + * the single WMS layer instance + * @type {?ImageLayer} + */ + this._layer = null; + + /** + * timeout function to manage the image layer reload + * @type {?function} + */ + this._timeout = null + + /** + * the WMS Ratio. + * @type {number} + */ + this._WMSRatio = mainMapInstance._WMSRatio; + + /** + * the image format + * @type {string} + * @todo could the format be readed from project config too? + */ + this._format = "image/png"; + + /** + * minimun map scale + * @type {number} + */ + this._minScale = 1; + + /** + * maximum map scale + * @type {number} + */ + this._maxScale = 1000000000000; + + /** + * meters per units + * @type {number} + */ + this._metersPerUnit = mainMapInstance.getView().getProjection().getMetersPerUnit(); + + /** + * ordered layers + * @type {String[]} + */ + this._orderedLayers = []; + + // construct base and map layers array + this._singleWMSLayerList.forEach((m,k) => { + if (m instanceof BaseLayerState) { + this._baseLayers.push(k); + } else if (m instanceof MapLayerState){ + this._mapLayers.push(k); + } + }); + + this._orderedLayers = this._baseLayers.concat(this._mapLayers); + // initialize single Image layer + this.initializeLayer(); + + // register listener for map layers + mainLizmap.state.rootMapGroup.addListener( + evt => { + if (this._mapLayers.includes(evt.name)) { + // the laeyr is included in the single WMS request + + // wait a bit in order to reduce the amount of requests + // e.g. when user turn on/off layers quickly + clearTimeout(this._timeout); + this._timeout = setTimeout(()=>{ + this.updateMap(); + },600) + } + }, + ['layer.visibility.changed','group.visibility.changed','layer.symbol.checked.changed', 'layer.style.changed', 'layer.selection.token.changed', 'layer.filter.token.changed'] + ); + + // register listener for base layers + mainLizmap.state.baseLayers.addListener( + evt => { + this.updateMap(); + }, + ['baselayers.selection.changed'] + ); + + } + /** + * @type {ImageLayer} + * + */ + get layer(){ + return this._layer; + } + /** + * creates the layer instance and get the startup single image + * @memberof SingleWMSLayer + */ + initializeLayer(){ + let minResolution = undefined; //Utils.getResolutionFromScale(this._minScale, this._metersPerUnit); + let maxResolution = undefined; //Utils.getResolutionFromScale(this._maxScale, this._metersPerUnit); + + if(this._mainMapInstance.useTileWms){ + this._layer = new TileLayer({ + // extent: extent, + minResolution: minResolution, + maxResolution: maxResolution, + source: new TileWMS({ + url: mainLizmap.serviceURL, + serverType: 'qgis', + tileGrid: this._mainMapInstance.customTileGrid, + params: { + LAYERS: null, + FORMAT: this._format, + STYLES: null, + DPI: 96, + TILED: 'true' + }, + wrapX: false, // do not reused across the 180° meridian. + hidpi: this._mainMapInstance.hidpi, // pixelRatio is used in useTileWms and customTileGrid definition + }) + }); + } else { + this._layer = new ImageLayer({ + minResolution: minResolution, + maxResolution: maxResolution, + source: new ImageWMS({ + url: mainLizmap.serviceURL, + serverType: 'qgis', + ratio: this._WMSRatio, + hidpi: this._mainMapInstance.hidpi, + params: { + LAYERS: null, + FORMAT: this._format, + STYLES: null, + DPI: 96 + } + }) + }); + // Force no cache w/ Firefox + if(navigator.userAgent.includes("Firefox")){ + this._layer.getSource().setImageLoadFunction((image, src) => { + (image.getImage()).src = src + '&ts=' + Date.now(); + }); + } + } + + this._layer.setVisible(false); + + this._layer.setProperties({ + name: "singleWMSLayer" + }); + + // put the layer on top of the base layers + this._layer.setZIndex(0); + + // manage the spinners + this._layer.getSource().on('imageloadstart', event => { + for (const name of this._layersName) { + //add spinners on visible layers + const mapLayer = mainLizmap.state.rootMapGroup.getMapLayerByName(name); + mapLayer.loadStatus = MapLayerLoadStatus.Loading; + } + + }); + this._layer.getSource().on('imageloadend', event => { + //remove spinners + for (const name of this._mapLayers) { + const mapLayer = mainLizmap.state.rootMapGroup.getMapLayerByName(name); + mapLayer.loadStatus = MapLayerLoadStatus.Ready; + } + }); + + this._layer.getSource().on('imageloaderror', event => { + for (const name of this._mapLayers) { + const mapLayer = mainLizmap.state.rootMapGroup.getMapLayerByName(name); + mapLayer.loadStatus = MapLayerLoadStatus.Error; + } + }); + + // get the first image to display + this.updateMap(); + } + + /** + * update layer content + * @memberof SingleWMSLayer + */ + updateMap(){ + + this.prepareWMSParams() + + const wmsParams = this._layer.getSource().getParams(); + let param = { + LAYERS: this._layersWmsName.join(","), + FORMAT: this._format, + STYLES: this._layerStyles.join(","), + DPI: 96 + } + if (this._selectionTokens.join("").split("").length > 0) + param["SELECTIONTOKEN"] = this._selectionTokens.join(";"); + if (this._filterTokens.join("").split("").length > 0) + param["FILTERTOKEN"] = this._filterTokens.join(";"); + if (this._legendOn.join("").split("").length > 0) + param["LEGEND_ON"] = this._legendOn.join(";"); + if (this._legendOff.join("").split("").length > 0) + param["LEGEND_OFF"] = this._legendOff.join(";"); + + // updateParams merges the object, need to manually remove object keys + // that aren't in the current param object + for (const key of Object.keys(wmsParams)) { + if(!Object.hasOwn(param, key)){ + delete wmsParams[key]; + } + } + Object.assign(wmsParams, param); + + // update the map + if (this._layersWmsName.length == 0) { + // don't want to perform WMS request if the layer list is empty + this._layer.setVisible(false) + } else { + this._layer.getSource().updateParams(wmsParams); + this._layer.setVisible(true) + } + } + /** + * update class properties to construct the wms parameters used to get the single image + * + * @memberof SingleWMSLayer + */ + prepareWMSParams(){ + + const baseLayersState = mainLizmap.state.baseLayers; + this._layersName = []; + this._layersWmsName = []; + this._layerStyles = []; + this._selectionTokens =[]; + this._filterTokens = []; + this._legendOn = []; + this._legendOff = []; + + this._orderedLayers.forEach((layerName) => { + //since _orderedLayers property respect the layerOrder, if there is a baselayer in the list, then it will be put + //at the bottom of the image + const currentLayerState = this._singleWMSLayerList.get(layerName); + // detect baseLayer, if any + if (currentLayerState instanceof BaseLayerState) { + if(this._baseLayers.includes(baseLayersState.selectedBaseLayerName)){ + // get item state + const selectedBaseLayerState = baseLayersState.selectedBaseLayer.itemState; + this._layersWmsName.push(selectedBaseLayerState.wmsName); + this._layerStyles.push(selectedBaseLayerState.wmsSelectedStyleName || ""); + } + } else if (currentLayerState instanceof MapLayerState){ + // get item visibility + if(currentLayerState.visibility) { + this._layersName.push(currentLayerState.name); + this._layersWmsName.push(currentLayerState.wmsName); + this._layerStyles.push(currentLayerState.wmsSelectedStyleName || ""); + const wmsParam = currentLayerState.wmsParameters; + if (wmsParam){ + if(wmsParam.SELECTIONTOKEN) + this._selectionTokens.push(wmsParam.SELECTIONTOKEN); + if(wmsParam.FILTERTOKEN) + this._filterTokens.push(wmsParam.FILTERTOKEN); + if(wmsParam.LEGEND_ON) + this._legendOn.push(wmsParam.LEGEND_ON); + if(wmsParam.LEGEND_OFF) + this._legendOff.push(wmsParam.LEGEND_OFF); + } + } + } + }) + } +} diff --git a/assets/src/modules/State.js b/assets/src/modules/State.js index 9590dc062b..f83281422b 100644 --- a/assets/src/modules/State.js +++ b/assets/src/modules/State.js @@ -25,7 +25,7 @@ export class State extends EventDispatcher { constructor(initialCfg, startupFeatures) { super() this._initialConfig = initialCfg; - this._map = new MapState(startupFeatures); + this._map = new MapState(initialCfg.options, startupFeatures); this._map.addListener(this.dispatch.bind(this), 'map.state.changed'); this._baseLayers = null; this._collection = null; diff --git a/assets/src/modules/config/Options.js b/assets/src/modules/config/Options.js index 944de0db19..246cd247b8 100644 --- a/assets/src/modules/config/Options.js +++ b/assets/src/modules/config/Options.js @@ -32,6 +32,7 @@ const optionalProperties = { 'use_native_zoom_levels': {type: 'boolean', nullable: true, default: null}, 'hide_numeric_scale_value': {type: 'boolean', default: false}, 'hideGroupCheckbox': { type: 'boolean', default: false }, + 'wms_single_request_for_all_layers' : { type:'boolean', default: false } }; /** @@ -43,25 +44,26 @@ export class OptionsConfig extends BaseObjectConfig { /** * Create an options config instance based on a config object - * @param {object} cfg - the lizmap config object for options - * @param {number[]} cfg.bbox - the project and web services max extent - * @param {number[]} cfg.initialExtent - the map extent at the loading page - * @param {number[]} cfg.mapScales - the map scales - * @param {number} cfg.minScale - the map's min scale - * @param {number} cfg.maxScale - the map's max scale - * @param {object} cfg.projection - the web map projection - * @param {number} cfg.pointTolerance - the point tolerance for QGIS Server WMS GetFeatureInfo request - * @param {number} cfg.lineTolerance - the line tolerance for QGIS Server WMS GetFeatureInfo request - * @param {number} cfg.polygonTolerance - the polygon tolerance for QGIS Server WMS GetFeatureInfo request - * @param {string} cfg.popupLocation - the popup location in the User interface: dock, bottom-dock, right-dock, mini-dock, map - * @param {string} cfg.datavizLocation - the popup location in the User interface: dock, bottom-dock, right-dock - * @param {boolean} [cfg.hideProject] - is the project hidden in user interface ? Only services are available. - * @param {number} [cfg.wmsMaxHeight] - the image max height for WMS GetMap request - * @param {number} [cfg.wmsMaxWidth] - the image max width for WMS GetMap request - * @param {boolean} [cfg.fixed_scale_overview_map] - does the Overview map have fixed scale ? - * @param {boolean} [cfg.use_native_zoom_levels] - does the map use native zoom levels ? - * @param {boolean} [cfg.hide_numeric_scale_value] - does the scale line hide numeric scale value ? - * @param {boolean} [cfg.hideGroupCheckbox] - are groups checkbox hidden ? + * @param {object} cfg - the lizmap config object for options + * @param {number[]} cfg.bbox - the project and web services max extent + * @param {number[]} cfg.initialExtent - the map extent at the loading page + * @param {number[]} cfg.mapScales - the map scales + * @param {number} cfg.minScale - the map's min scale + * @param {number} cfg.maxScale - the map's max scale + * @param {object} cfg.projection - the web map projection + * @param {number} cfg.pointTolerance - the point tolerance for QGIS Server WMS GetFeatureInfo request + * @param {number} cfg.lineTolerance - the line tolerance for QGIS Server WMS GetFeatureInfo request + * @param {number} cfg.polygonTolerance - the polygon tolerance for QGIS Server WMS GetFeatureInfo request + * @param {string} cfg.popupLocation - the popup location in the User interface: dock, bottom-dock, right-dock, mini-dock, map + * @param {string} cfg.datavizLocation - the popup location in the User interface: dock, bottom-dock, right-dock + * @param {boolean} [cfg.hideProject] - is the project hidden in user interface ? Only services are available. + * @param {number} [cfg.wmsMaxHeight] - the image max height for WMS GetMap request + * @param {number} [cfg.wmsMaxWidth] - the image max width for WMS GetMap request + * @param {boolean} [cfg.fixed_scale_overview_map] - does the Overview map have fixed scale ? + * @param {boolean} [cfg.use_native_zoom_levels] - does the map use native zoom levels ? + * @param {boolean} [cfg.hide_numeric_scale_value] - does the scale line hide numeric scale value ? + * @param {boolean} [cfg.hideGroupCheckbox] - are groups checkbox hidden ? + * @param {boolean} [cfg.wms_single_request_for_all_layers] - are layers loaded as single WMS image ? */ constructor(cfg) { if (!cfg || typeof cfg !== "object") { @@ -234,4 +236,13 @@ export class OptionsConfig extends BaseObjectConfig { get hideGroupCheckbox() { return this._hideGroupCheckbox; } + + /** + * The layers are loaded as a single WMS image + * @type {boolean} + */ + get wms_single_request_for_all_layers() { + return this._wms_single_request_for_all_layers; + } + } diff --git a/assets/src/modules/map.js b/assets/src/modules/map.js index df44f1e4af..24b001156d 100644 --- a/assets/src/modules/map.js +++ b/assets/src/modules/map.js @@ -34,6 +34,8 @@ import DoubleClickZoom from 'ol/interaction/DoubleClickZoom.js'; import DragZoom from 'ol/interaction/DragZoom.js'; import { defaults as defaultInteractions } from 'ol/interaction.js'; import { always } from 'ol/events/condition.js'; +import SingleWMSLayer from './SingleWMSLayer.js'; +import { Tile } from 'ol'; /** * Class initializing Openlayers Map. @@ -135,12 +137,12 @@ export default class map extends olMap { // Get pixel ratio, if High DPI is disabled do not use device pixel ratio const pixelRatio = this._hidpi ? this.pixelRatio_ : 1; - const useTileWms = this.getSize().reduce( + this._useTileWms = this.getSize().reduce( (r /*accumulator*/, x /*currentValue*/, i /*currentIndex*/) => r || Math.ceil(x*this._WMSRatio*pixelRatio) > wmsMaxSize[i], false, ); - const customTileGrid = useTileWms ? new TileGrid({ + this._customTileGrid = this._useTileWms ? new TileGrid({ extent: mainLizmap.lizmap3.map.restrictedExtent.toArray(), resolutions: resolutions, tileSize: this.getSize().map((x, i) => { @@ -165,6 +167,8 @@ export default class map extends olMap { // Array of layers and groups in overlayLayerGroup this._overlayLayersAndGroups = []; + // Mapping between layers name and states used to construct the singleWMSLayer, if needed + this._statesSingleWMSLayers = new Map(); const layersCount = mainLizmap.state.rootMapGroup.countExplodedMapLayers(); @@ -177,7 +181,10 @@ export default class map extends olMap { if(node.type !== 'layer' && node.type !== 'group'){ continue; } - layers.push(createNode(layer, statesOlLayersandGroupsMap, overlayLayersAndGroups, metersPerUnit, WMSRatio)); + let newNode = createNode(layer, statesOlLayersandGroupsMap, overlayLayersAndGroups, metersPerUnit, WMSRatio) + if(newNode){ + layers.push(newNode); + } } const layerGroup = new LayerGroup({ layers: layers @@ -200,7 +207,6 @@ export default class map extends olMap { if(node.type !== 'layer'){ return; } - /* Sometimes throw an Error and extent is not used let extent = node.layerConfig.extent; if(node.layerConfig.crs !== "" && node.layerConfig.crs !== mainLizmap.projection){ @@ -236,84 +242,89 @@ export default class map extends olMap { source: new WMTS(options) }); } - } - - // The layer has not been yet build - if (!layer) { - layer = new ImageLayer({ - // extent: extent, - minResolution: minResolution, - maxResolution: maxResolution, - source: new ImageWMS({ - url: mainLizmap.serviceURL, - serverType: 'qgis', - ratio: WMSRatio, - hidpi: this._hidpi, - params: { - LAYERS: node.wmsName, - FORMAT: node.layerConfig.imageFormat, - STYLES: node.wmsSelectedStyleName, - DPI: 96 - }, - }) - }); - - // Force no cache w/ Firefox - if(navigator.userAgent.includes("Firefox")){ - layer.getSource().setImageLoadFunction((image, src) => { - (image.getImage()).src = src + '&ts=' + Date.now(); - }); - } - - if (useTileWms) { - layer = new TileLayer({ - // extent: extent, - minResolution: minResolution, - maxResolution: maxResolution, - source: new TileWMS({ - url: mainLizmap.serviceURL, - serverType: 'qgis', - tileGrid: customTileGrid, - params: { - LAYERS: node.wmsName, - FORMAT: node.layerConfig.imageFormat, - STYLES: node.wmsSelectedStyleName, - DPI: 96, - TILED: 'true' - }, - wrapX: false, // do not reused across the 180° meridian. - hidpi: this._hidpi, // pixelRatio is used in useTileWms and customTileGrid definition - }) - }); - - // Force no cache w/ Firefox - if(navigator.userAgent.includes("Firefox")){ - layer.getSource().setTileLoadFunction((image, src) => { - (image.getImage()).src = src + '&ts=' + Date.now(); + } else { + if(mainLizmap.state.map.singleWMSLayer){ + this._statesSingleWMSLayers.set(node.name,node); + node.singleWMSLayer = true; + return + } else { + if (this._useTileWms) { + layer = new TileLayer({ + // extent: extent, + minResolution: minResolution, + maxResolution: maxResolution, + source: new TileWMS({ + url: mainLizmap.serviceURL, + serverType: 'qgis', + tileGrid: this._customTileGrid, + params: { + LAYERS: node.wmsName, + FORMAT: node.layerConfig.imageFormat, + STYLES: node.wmsSelectedStyleName, + DPI: 96, + TILED: 'true' + }, + wrapX: false, // do not reused across the 180° meridian. + hidpi: this._hidpi, // pixelRatio is used in useTileWms and customTileGrid definition + }) }); - } - } + // Force no cache w/ Firefox + if(navigator.userAgent.includes("Firefox")){ + layer.getSource().setTileLoadFunction((image, src) => { + (image.getImage()).src = src + '&ts=' + Date.now(); + }); + } + } else { + layer = new ImageLayer({ + // extent: extent, + minResolution: minResolution, + maxResolution: maxResolution, + source: new ImageWMS({ + url: mainLizmap.serviceURL, + serverType: 'qgis', + ratio: WMSRatio, + hidpi: this._hidpi, + params: { + LAYERS: node.wmsName, + FORMAT: node.layerConfig.imageFormat, + STYLES: node.wmsSelectedStyleName, + DPI: 96 + }, + }) + }); + + // Force no cache w/ Firefox + if(navigator.userAgent.includes("Firefox")){ + layer.getSource().setImageLoadFunction((image, src) => { + (image.getImage()).src = src + '&ts=' + Date.now(); + }); + } + } + } } - layer.setVisible(node.visibility); - - layer.setOpacity(node.opacity); - - layer.setProperties({ - name: node.name - }); - - layer.getSource().setProperties({ - name: node.name - }); + if(layer){ + layer.setVisible(node.visibility); - // OL layers zIndex is the reverse of layer's order given by cfg - layer.setZIndex(layersCount - 1 - node.layerOrder); + layer.setOpacity(node.opacity); + + layer.setProperties({ + name: node.name + }); + + layer.getSource().setProperties({ + name: node.name + }); + + // OL layers zIndex is the reverse of layer's order given by cfg + layer.setZIndex(layersCount - 1 - node.layerOrder); + + overlayLayersAndGroups.push(layer); + statesOlLayersandGroupsMap.set(node.name, [node, layer]); + return layer; + } - overlayLayersAndGroups.push(layer); - statesOlLayersandGroupsMap.set(node.name, [node, layer]); - return layer; } } @@ -398,7 +409,6 @@ export default class map extends olMap { if (layerMinResolution === undefined || layerMinResolution < resolutions[resolutions.length-1]) { layerMinResolution = resolutions[resolutions.length-1]; } - const tileGrid = new WMTSTileGrid({ origin: [-20037508, 20037508], resolutions: resolutions, @@ -451,43 +461,49 @@ export default class map extends olMap { source: new WMTS(options) }); } else { - baseLayer = new ImageLayer({ - // extent: extent, - minResolution: layerMinResolution, - maxResolution: layerMaxResolution, - source: new ImageWMS({ - url: mainLizmap.serviceURL, - projection: qgisProjectProjection, - serverType: 'qgis', - ratio: this._WMSRatio, - hidpi: this._hidpi, - params: { - LAYERS: baseLayerState.itemState.wmsName, - FORMAT: baseLayerState.layerConfig.imageFormat, - DPI: 96 - }, - }) - }); - if (useTileWms) { - baseLayer = new TileLayer({ - // extent: extent, - minResolution: layerMinResolution, - maxResolution: layerMaxResolution, - source: new TileWMS({ - url: mainLizmap.serviceURL, - projection: qgisProjectProjection, - serverType: 'qgis', - tileGrid: customTileGrid, - params: { - LAYERS: baseLayerState.itemState.wmsName, - FORMAT: baseLayerState.layerConfig.imageFormat, - DPI: 96, - TILED: 'true' - }, - wrapX: false, // do not reused across the 180° meridian. - hidpi: this._hidpi, // pixelRatio is used in useTileWms and customTileGrid definition - }) - }); + if(mainLizmap.state.map.singleWMSLayer){ + baseLayerState.singleWMSLayer = true; + this._statesSingleWMSLayers.set(baseLayerState.name, baseLayerState); + } else { + if (this._useTileWms) { + baseLayer = new TileLayer({ + // extent: extent, + minResolution: minResolution, + maxResolution: maxResolution, + source: new TileWMS({ + url: mainLizmap.serviceURL, + projection: qgisProjectProjection, + serverType: 'qgis', + tileGrid: this._customTileGrid, + params: { + LAYERS: baseLayerState.itemState.wmsName, + FORMAT: baseLayerState.layerConfig.imageFormat, + DPI: 96, + TILED: 'true' + }, + wrapX: false, // do not reused across the 180° meridian. + hidpi: this._hidpi, // pixelRatio is used in useTileWms and customTileGrid definition + }) + }); + } else { + baseLayer = new ImageLayer({ + // extent: extent, + minResolution: layerMinResolution, + maxResolution: layerMaxResolution, + source: new ImageWMS({ + url: mainLizmap.serviceURL, + projection: qgisProjectProjection, + serverType: 'qgis', + ratio: this._WMSRatio, + hidpi: this._hidpi, + params: { + LAYERS: baseLayerState.itemState.wmsName, + FORMAT: baseLayerState.layerConfig.imageFormat, + DPI: 96 + }, + }) + }); + } } } } else if (baseLayerState.type === BaseLayerTypes.Empty) { @@ -538,9 +554,21 @@ export default class map extends olMap { this._baseLayersGroup = new LayerGroup(); } + this._singleImageWmsGroup = new LayerGroup(); + + if (this._statesSingleWMSLayers.size > 0) { + //create new Image layer and add it to the map + const singleWMSLayer = new SingleWMSLayer(this); + + // create a new group + this._singleImageWmsGroup = new LayerGroup({ + layers:[singleWMSLayer.layer] + }); + } + // Add base and overlay layers to the map's main LayerGroup this.setLayerGroup(new LayerGroup({ - layers: [this._baseLayersGroup, this._overlayLayersGroup] + layers: [this._baseLayersGroup, this._singleImageWmsGroup, this._overlayLayersGroup] })); // Sync new OL view with OL2 view @@ -604,6 +632,9 @@ export default class map extends olMap { mainLizmap.state.rootMapGroup.addListener( evt => { + // if the layer is loaded ad single WMS, the visibility events are managed by the dedicated class + if (this.isSingleWMSLayer(evt.name)) return; + const olLayerOrGroup = this.getLayerOrGroupByName(evt.name); if (olLayerOrGroup) { olLayerOrGroup.setVisible(evt.visibility); @@ -616,11 +647,14 @@ export default class map extends olMap { mainLizmap.state.layersAndGroupsCollection.addListener( evt => { + // conservative control since the opacity events should not be fired for single WMS layers + if (this.isSingleWMSLayer(evt.name)) return; + const activeBaseLayer = this.getActiveBaseLayer(); if (activeBaseLayer && activeBaseLayer.get("name") === evt.name) { activeBaseLayer.setOpacity(evt.opacity); } else { - this.getLayerOrGroupByName(evt.name).setOpacity(evt.opacity); + this.getLayerOrGroupByName(evt.name)?.setOpacity(evt.opacity); } }, ['layer.opacity.changed', 'group.opacity.changed'] @@ -628,7 +662,9 @@ export default class map extends olMap { mainLizmap.state.rootMapGroup.addListener( evt => { - const [state, olLayer] = this._statesOlLayersandGroupsMap.get(evt.name); + const stateOlLayerAndMap = this._statesOlLayersandGroupsMap.get(evt.name); + if (!stateOlLayerAndMap) return; + const [state, olLayer] = stateOlLayerAndMap; const wmsParams = olLayer.getSource().getParams(); // Delete entries in `wmsParams` not in `state.wmsParameters` @@ -719,7 +755,34 @@ export default class map extends olMap { get overlayLayersGroup(){ return this._overlayLayersGroup; } - + /** + * Key (name) / value (state) Map of layers loaded in a single WMS image + * @type {Map} + */ + get statesSingleWMSLayers(){ + return this._statesSingleWMSLayers; + } + /** + * Map and base Layers are loaded as TileWMS + * @type {Boolean} + */ + get useTileWms(){ + return this._useTileWms; + } + /** + * TileGrid configuration when layers is loaded as TileWMS + * @type {null|TileGrid} + */ + get customTileGrid(){ + return this._customTileGrid; + } + /** + * WMS/TileWMS high dpi support + * @type {Boolean} + */ + get hidpi(){ + return this._hidpi; + } /** * Add highlight features on top of all layer * @param {string} features features as GeoJSON or WKT @@ -844,4 +907,15 @@ export default class map extends olMap { layer => layer.get('name') === name ); } + + /** + * Return MapLayerState instance of WMS layer or group if the layer is loaded in the single WMS image, undefined if not. + * + * @param name + * @returns {MapLayerState|undefined} + */ + isSingleWMSLayer(name){ + + return this.statesSingleWMSLayers.get(name); + } } diff --git a/assets/src/modules/state/BaseLayer.js b/assets/src/modules/state/BaseLayer.js index ba07cc777b..c84a78ad64 100644 --- a/assets/src/modules/state/BaseLayer.js +++ b/assets/src/modules/state/BaseLayer.js @@ -31,6 +31,22 @@ export class BaseLayerState extends EventDispatcher { this._baseLayerConfig = baseLayerCfg; this._itemState = itemState; this._loadStatus = MapLayerLoadStatus.Undefined; + this._singleWMSLayer = false; + } + + /** + * Set if the base layer is loaded in a single WMS Layer or not + * @param {boolean} val + */ + set singleWMSLayer(val){ + this._singleWMSLayer = val; + } + /** + * The base layer is loaded in a single WMS Layer or not + * @type {boolean} + */ + get singleWMSLayer(){ + return this._singleWMSLayer; } /** diff --git a/assets/src/modules/state/LayerTree.js b/assets/src/modules/state/LayerTree.js index d3ef88795d..65a20e78eb 100644 --- a/assets/src/modules/state/LayerTree.js +++ b/assets/src/modules/state/LayerTree.js @@ -431,6 +431,15 @@ export class LayerTreeLayerState extends LayerTreeItemState { this._icon = getDefaultLayerIcon(this.layerConfig); } + /** + * vector layer is loaded in a single layer ImageLayer or not + * @type {boolean} + */ + get singleWMSLayer(){ + return this._mapItemState.singleWMSLayer; + } + + /** * Vector layer has selected features * The selected features is not empty diff --git a/assets/src/modules/state/Map.js b/assets/src/modules/state/Map.js index 9f0274ffd4..f3254e934a 100644 --- a/assets/src/modules/state/Map.js +++ b/assets/src/modules/state/Map.js @@ -54,9 +54,10 @@ export class MapState extends EventDispatcher { /** * Creating the map state + * @param {OptionConfig} [options] - main configuration options * @param {string|undefined} [startupFeatures] - The features to highlight at startup in GeoJSON */ - constructor(startupFeatures) { + constructor(options, startupFeatures) { super(); this._ready = false; // default values @@ -68,6 +69,13 @@ export class MapState extends EventDispatcher { this._scaleDenominator = -1; this._pointResolution = -1; this._pointScaleDenominator = -1; + + // Values from options + this._singleWMSLayer = false; + if (options) { + this._singleWMSLayer = options.wms_single_request_for_all_layers; // default value is defined as false + } + this._startupFeatures = startupFeatures; } @@ -234,4 +242,13 @@ export class MapState extends EventDispatcher { get startupFeatures() { return this._startupFeatures; } + + /** + * Config singleWMSLayer + * + * @type {Boolean} + */ + get singleWMSLayer(){ + return this._singleWMSLayer; + } } diff --git a/assets/src/modules/state/MapLayer.js b/assets/src/modules/state/MapLayer.js index 810e30b459..9907330e11 100644 --- a/assets/src/modules/state/MapLayer.js +++ b/assets/src/modules/state/MapLayer.js @@ -518,11 +518,29 @@ export class MapLayerState extends MapItemState { this.itemState.addListener(this.dispatch.bind(this), 'layer.filter.changed'); this.itemState.addListener(this.dispatch.bind(this), 'layer.filter.token.changed'); } + // load the layer in a single ImageWMS layer + this._singleWMSLayer = false; // set isLoading to false this._loading = false; this._loadStatus = MapLayerLoadStatus.Undefined; } + /** + * set if the map layer is loaded in a single ImageWMS layer or not + * @param {boolean} val + */ + set singleWMSLayer(val){ + this._singleWMSLayer = val; + } + + /** + * vector layer is loaded in a single layer ImageLayer or not + * @type {boolean} + */ + get singleWMSLayer(){ + return this._singleWMSLayer; + } + /** * Layer type * @type {string} diff --git a/tests/end2end/playwright/singleWMS.spec.ts b/tests/end2end/playwright/singleWMS.spec.ts new file mode 100644 index 0000000000..65de9ff6f9 --- /dev/null +++ b/tests/end2end/playwright/singleWMS.spec.ts @@ -0,0 +1,414 @@ +import { test, expect } from '@playwright/test'; + +test.describe('Single WMS layer', () => { + + test('Startup single image loading', async ({ page }) => { + const url = '/index.php/view/map/?repository=testsrepository&project=single_wms_image'; + + // 'single_wms_polygons', 'single_wms_tiled_baselayer' and OpenStreetmaps layers should be exluded from single wms layer + const getMapPromise = page.waitForRequest(request => + request.url().includes('GetMap') && + request.method() === 'GET' && + // check format + request.url().includes('FORMAT=image%2Fpng') && + // check service + request.url().includes('SERVICE=WMS') && + // check styles + request.url().includes('STYLES=default%2Cdefault%2Cdefault%2Cdefault%2Cdefault%2C') && + // check layers + request.url().includes('LAYERS=single_wms_baselayer%2Csingle_wms_lines%2Csingle_wms_points%2Csingle_wms_points_group%2Csingle_wms_lines_group%2CGroupAsLayer') + ); + + const getTiledSingleWMSPolygon = page.waitForRequest(request => + request.url().includes('GetTile') && + request.method() === 'GET' && + // check layer name + request.url().includes('layer=single_wms_polygons') && + // check styles + request.url().includes('style=default') && + // check service + request.url().includes('Service=WMTS') + + ) + + await page.goto(url); + // just check if the application fires these requests and their response code + const allResponses = await Promise.all([getMapPromise,getTiledSingleWMSPolygon]) + + let getMapRespInit = allResponses[0] + let getMapResp = await getMapRespInit.response() + let getTileRespInit = allResponses[1] + let getTileResp = await getTileRespInit.response() + + expect((getMapResp?.status())).toBe(200); + expect((getTileResp?.status())).toBe(200); + + }) + + test('Check opacity', async ({ page }) => { + const url = '/index.php/view/map/?repository=testsrepository&project=single_wms_image'; + + await page.goto(url, {waitUntil:'networkidle'}); + + // click on layer tree elements to check opacity + const lizmapTreeView = page.locator('lizmap-treeview > ul li'); + + const ids = ['GroupAsLayer', 'single_wms_lines_group','single_wms_points_group','single_wms_points', 'single_wms_lines','single_wms_polygons']; + + for (const info of await lizmapTreeView.all()) { + let className = await info.getAttribute("data-testid"); + if (ids.indexOf(className || '') > -1 ){ + await info.locator(".node").nth(0).hover(); + let icon = await info.locator(".icon-info-sign"); + await icon.hover(); + await icon.click(); + let subDock = page.locator("#sub-dock"); + if(className == 'single_wms_polygons') { + // opacity is enabled only in the tiled layer + await expect(subDock.locator(".opacityLayer")).toHaveCount(1); + } else { + await expect(subDock.locator(".opacityLayer")).toHaveCount(0); + } + + } + } + + }) + + test('Switch layers', async ({ page }) => { + const url = '/index.php/view/map/?repository=testsrepository&project=single_wms_image'; + + // turn off single_wms_lines layer + const getMapNoPointsPromise = page.waitForRequest(request => + request.url().includes('GetMap') && + request.method() === 'GET' && + // check format + request.url().includes('FORMAT=image%2Fpng') && + // check service + request.url().includes('SERVICE=WMS') && + // check styles + request.url().includes('STYLES=default%2Cdefault%2Cdefault%2Cdefault%2C') && + // check layers + request.url().includes('LAYERS=single_wms_baselayer%2Csingle_wms_points%2Csingle_wms_points_group%2Csingle_wms_lines_group%2CGroupAsLayer') + ); + + await page.goto(url,{waitUntil:'networkidle'}); + + await page.getByTestId('single_wms_lines').locator('> div input').click(); + const noPointsReq = await getMapNoPointsPromise; + + const getMapNoPointsPromiseResp = await noPointsReq.response(); + expect(getMapNoPointsPromiseResp?.status()).toBe(200) + + await page.waitForTimeout(400); + + // switch layer in a group + const getMapNoGroupLinesPromise = page.waitForRequest(request => + request.url().includes('GetMap') && + request.method() === 'GET' && + // check format + request.url().includes('FORMAT=image%2Fpng') && + // check service + request.url().includes('SERVICE=WMS') && + // check styles + request.url().includes('STYLES=default%2Cdefault%2Cdefault%2C') && + // check layers + request.url().includes('LAYERS=single_wms_baselayer%2Csingle_wms_points%2Csingle_wms_points_group%2CGroupAsLayer') + ); + + await page.getByTestId('single_wms_lines_group').locator('> div input').click(); + + const noGroupLinesReq = await getMapNoGroupLinesPromise; + + const getMapNoGroupLinesPromiseResp = await noGroupLinesReq.response(); + expect(getMapNoGroupLinesPromiseResp?.status()).toBe(200) + + await page.waitForTimeout(400); + + // switch Group as layer + const getMapNoGroupAsLayerPromise = page.waitForRequest(request => + request.url().includes('GetMap') && + request.method() === 'GET' && + // check format + request.url().includes('FORMAT=image%2Fpng') && + // check service + request.url().includes('SERVICE=WMS') && + // check styles + request.url().includes('STYLES=default%2Cdefault%2Cdefault') && + // check layers + request.url().includes('LAYERS=single_wms_baselayer%2Csingle_wms_points%2Csingle_wms_points_group') + ); + + await page.getByTestId('GroupAsLayer').locator('> div input').click(); + + const noGroupasLayersReq = await getMapNoGroupAsLayerPromise; + + const getMapNoGroupAsLayerPromiseResp = await noGroupasLayersReq.response(); + expect(getMapNoGroupAsLayerPromiseResp?.status()).toBe(200) + + //enable all switched off layer + // it sholud do only one request, due to the setTimeout on the singleWMSLayer logic + let reqCount = 0; + page.on('request', request=>{ + const url = request.url(); + if(url.includes('GetMap')){ + + expect(reqCount).toBe(0) + reqCount++; + + const searchParam = new URLSearchParams(url); + expect(searchParam.get('FORMAT') == 'image%2Fpng').toBeTruthy(); + expect(searchParam.get('SERVICE') == 'WMS').toBeTruthy(); + expect(searchParam.get('STYLES') == 'default%2Cdefault%2Cdefault%2Cdefault%2Cdefault%2C').toBeTruthy(); + expect(searchParam.get('LAYERS') == 'single_wms_baselayer%2Csingle_wms_lines%2Csingle_wms_points%2Csingle_wms_points_group%2Csingle_wms_lines_group%2CGroupAsLayer').toBeTruthy(); + + } + }) + + await page.getByTestId('single_wms_lines').locator('> div input').click(); + await page.waitForTimeout(50); + await page.getByTestId('single_wms_lines_group').locator('> div input').click(); + await page.waitForTimeout(50); + await page.getByTestId('GroupAsLayer').locator('> div input').click(); + + }) + + test('Change layer style', async ({ page }) => { + const url = '/index.php/view/map/?repository=testsrepository&project=single_wms_image'; + + const getMapChangeStylePromise = page.waitForRequest(request => + request.url().includes('GetMap') && + request.method() === 'GET' && + // check format + request.url().includes('FORMAT=image%2Fpng') && + // check service + request.url().includes('SERVICE=WMS') && + // check styles + request.url().includes('STYLES=default%2Cdefault%2Cwhite_dots%2Cdefault%2Cdefault%2C') && + // check layers + request.url().includes('LAYERS=single_wms_baselayer%2Csingle_wms_lines%2Csingle_wms_points%2Csingle_wms_points_group%2Csingle_wms_lines_group%2CGroupAsLayer') + ); + + await page.goto(url,{waitUntil:'networkidle'}); + + // disable single_wms_lines + const points = page.getByTestId('single_wms_points') + + await points.locator(".node").nth(0).hover(); + let icon = points.locator(".icon-info-sign"); + + await icon.click(); + let styleLayer = page.locator("#sub-dock").locator("select.styleLayer"); + + await styleLayer.selectOption("white_dots"); + + const changeStyle = await getMapChangeStylePromise; + + const getMapChangeStylePromiseResp = await changeStyle.response(); + expect(getMapChangeStylePromiseResp?.status()).toBe(200) + + }) + + test('Apply filters on layer, then change layer style', async ({ page }) => { + const url = '/index.php/view/map/?repository=testsrepository&project=single_wms_image'; + await page.goto(url,{waitUntil:'networkidle'}); + + let getFeatureInfoRequestPromise = page.waitForRequest(request => request.method() === 'POST' && request.postData().includes('GetFeatureInfo')); + + await page.locator('#newOlMap').click({ + position: { + x: 379, + y: 288 + } + }); + await getFeatureInfoRequestPromise; + + // render popup + await page.waitForTimeout(500); + await expect(page.locator('.lizmapPopupContent > .lizmapPopupSingleFeature .lizmapPopupTitle').first()).toHaveText("Points"); + await expect(page.locator(".lizmapPopupContent .lizmapPopupDiv table tbody tr")).toHaveCount(2); + await expect(page.locator(".lizmapPopupContent .lizmapPopupDiv table tbody tr").nth(0).locator("td")).toHaveText("1"); + await expect(page.locator(".lizmapPopupContent .lizmapPopupDiv table tbody tr").nth(1).locator("td")).toHaveText("Point_1"); + + // click on filter button + await expect(page.locator(".lizmapPopupContent .lizmapPopupDiv lizmap-feature-toolbar button.feature-filter")).toBeVisible(); + + const getFilterTokenPromise = page.waitForRequest(request => request.method() === 'POST' && request.postData().includes('GETFILTERTOKEN')); + + await page.locator(".lizmapPopupContent .lizmapPopupDiv lizmap-feature-toolbar button.feature-filter").click(); + + const reqToken = await getFilterTokenPromise; + + const reqTokenResp = await reqToken.response(); + const reqJson = await reqTokenResp?.text() || '{}'; + + const token = JSON.parse(reqJson)?.token; + expect(token).not.toBeNull(); + + const getMFilteredMapPromise = page.waitForRequest(request => + request.url().includes('GetMap') && + request.method() === 'GET' && + // check format + request.url().includes('FORMAT=image%2Fpng') && + // check service + request.url().includes('SERVICE=WMS') && + // check for FILTERTOKEN PARAMETER + request.url().includes('FILTERTOKEN='+token) && + // check styles + request.url().includes('STYLES=default%2Cdefault%2Cdefault%2Cdefault%2Cdefault%2C') && + // check layers + request.url().includes('LAYERS=single_wms_baselayer%2Csingle_wms_lines%2Csingle_wms_points%2Csingle_wms_points_group%2Csingle_wms_lines_group%2CGroupAsLayer') + ); + + const filteredMap = await getMFilteredMapPromise; + const getMFilteredMapPromiseResp = await filteredMap.response(); + expect(getMFilteredMapPromiseResp?.status()).toBe(200) + + // change layer style while filtering + const getMapChangeStylePromise = page.waitForRequest(request => + request.url().includes('GetMap') && + request.method() === 'GET' && + // check format + request.url().includes('FORMAT=image%2Fpng') && + // check service + request.url().includes('SERVICE=WMS') && + // check for FILTERTOKEN PARAMETER + request.url().includes('FILTERTOKEN='+token) && + // check styles + request.url().includes('STYLES=default%2Cdefault%2Cwhite_dots%2Cdefault%2Cdefault%2C') && + // check layers + request.url().includes('LAYERS=single_wms_baselayer%2Csingle_wms_lines%2Csingle_wms_points%2Csingle_wms_points_group%2Csingle_wms_lines_group%2CGroupAsLayer') + ); + + // change the style + const points = page.getByTestId('single_wms_points') + await page.locator("#button-switcher").click(); + await points.locator(".node").nth(0).hover(); + let icon = await points.locator(".icon-info-sign"); + + await icon.click(); + let styleLayer = page.locator("#sub-dock").locator("select.styleLayer"); + + await styleLayer.selectOption("white_dots"); + + const changeStyle = await getMapChangeStylePromise; + + const getMapChangeStylePromiseResp = await changeStyle.response(); + expect(getMapChangeStylePromiseResp?.status()).toBe(200) + + }) + + test('Filter on legend, then apply filter', async ({ page }) => { + const url = '/index.php/view/map/?repository=testsrepository&project=single_wms_image'; + await page.goto(url,{waitUntil:'networkidle'}); + + const getLegendFilterPromise = page.waitForRequest(request => + request.url().includes('GetMap') && + request.method() === 'GET' && + // check format + request.url().includes('FORMAT=image%2Fpng') && + // check service + request.url().includes('SERVICE=WMS') && + // check styles + request.url().includes('STYLES=default%2Cdefault%2Cdefault%2Cdefault%2Cdefault%2C') && + //check LEGEND_ON parameter + request.url().includes('LEGEND_ON=single_wms_lines%3A1%2C2%2C3%2C4') && + //check LEGEND_ON parameter + request.url().includes('LEGEND_OFF=single_wms_lines%3A0') && + // check layers + request.url().includes('LAYERS=single_wms_baselayer%2Csingle_wms_lines%2Csingle_wms_points%2Csingle_wms_points_group%2Csingle_wms_lines_group%2CGroupAsLayer') + ); + + const lines = page.getByTestId('single_wms_lines') + await lines.locator(".expandable").click(); + + await lines.locator("ul.symbols > li").nth(0).locator("input").click(); + + const legendFilters = await getLegendFilterPromise; + const getLegendFilterPromiseResp = await legendFilters.response(); + expect(getLegendFilterPromiseResp?.status()).toBe(200) + + // filter + let getFeatureInfoRequestPromise = page.waitForRequest(request => request.method() === 'POST' && request.postData().includes('GetFeatureInfo')); + + await page.locator('#newOlMap').click({ + position: { + x: 460, + y: 352 + } + }); + + await getFeatureInfoRequestPromise; + await page.waitForTimeout(500); + + await expect(page.locator('.lizmapPopupContent > .lizmapPopupSingleFeature .lizmapPopupTitle').first()).toHaveText("Lines"); + await expect(page.locator(".lizmapPopupContent .lizmapPopupDiv table tbody tr")).toHaveCount(2); + await expect(page.locator(".lizmapPopupContent .lizmapPopupDiv table tbody tr").nth(0).locator("td")).toHaveText("3"); + await expect(page.locator(".lizmapPopupContent .lizmapPopupDiv table tbody tr").nth(1).locator("td")).toHaveText("Line_3"); + + const getFilterTokenPromise = page.waitForRequest(request => request.method() === 'POST' && request.postData().includes('GETFILTERTOKEN')); + + await expect(page.locator(".lizmapPopupContent .lizmapPopupDiv lizmap-feature-toolbar button.feature-filter")).toBeVisible(); + + await page.locator(".lizmapPopupContent .lizmapPopupDiv lizmap-feature-toolbar button.feature-filter").click(); + + const reqToken = await getFilterTokenPromise; + + const reqTokenResp = await reqToken.response(); + const reqJson = await reqTokenResp?.text() || '{}'; + + const token = JSON.parse(reqJson)?.token; + expect(token).not.toBeNull(); + + + const getLegendFilterAndFilterPromise = page.waitForRequest(request => + request.url().includes('GetMap') && + request.method() === 'GET' && + // check format + request.url().includes('FORMAT=image%2Fpng') && + // check service + request.url().includes('SERVICE=WMS') && + // check styles + request.url().includes('STYLES=default%2Cdefault%2Cdefault%2Cdefault%2Cdefault%2C') && + // check for FILTERTOKEN PARAMETER + request.url().includes('FILTERTOKEN='+token) && + //check LEGEND_ON parameter + request.url().includes('LEGEND_ON=single_wms_lines%3A1%2C2%2C3%2C4') && + //check LEGEND_ON parameter + request.url().includes('LEGEND_OFF=single_wms_lines%3A0') && + // check layers + request.url().includes('LAYERS=single_wms_baselayer%2Csingle_wms_lines%2Csingle_wms_points%2Csingle_wms_points_group%2Csingle_wms_lines_group%2CGroupAsLayer') + ); + + const filteredMap = await getLegendFilterAndFilterPromise; + + const getLegendFilterAndFilterPromiseResp = await filteredMap.response(); + expect(getLegendFilterAndFilterPromiseResp?.status()).toBe(200) + }) + + test('Switch baselayer', async ({ page }) => { + const url = '/index.php/view/map/?repository=testsrepository&project=single_wms_image'; + await page.goto(url,{waitUntil:'networkidle'}); + + const switchBaseLayersReqPromise = page.waitForRequest(request => + request.url().includes('GetMap') && + request.method() === 'GET' && + // check format + request.url().includes('FORMAT=image%2Fpng') && + // check service + request.url().includes('SERVICE=WMS') && + // check styles + request.url().includes('STYLES=default%2Cdefault%2Cdefault%2Cdefault%2C') && + // check layers + request.url().includes('LAYERS=single_wms_lines%2Csingle_wms_points%2Csingle_wms_points_group%2Csingle_wms_lines_group%2CGroupAsLayer') + ); + + await page.locator("lizmap-base-layers select").selectOption("single_wms_tiled_baselayer") + + const switchBaseLayer = await switchBaseLayersReqPromise; + + const switchBaseLayersReqPromiseresp = await switchBaseLayer.response(); + expect(switchBaseLayersReqPromiseresp?.status()).toBe(200) + + }) +}) diff --git a/tests/js-units/data/single_wms_image-capabilities.json b/tests/js-units/data/single_wms_image-capabilities.json new file mode 100644 index 0000000000..c8324bede8 --- /dev/null +++ b/tests/js-units/data/single_wms_image-capabilities.json @@ -0,0 +1,940 @@ +{ + "version": "1.3.0", + "Service": { + "Name": "WMS", + "Title": "single_wms_image", + "KeywordList": [ + "infoMapAccessService" + ], + "OnlineResource": "http://localhost:8130/index.php/lizmap/service?repository=testsrepository&project=single_wms_image", + "Fees": "conditions unknown", + "AccessConstraints": "None", + "MaxWidth": 3000, + "MaxHeight": 3000 + }, + "Capability": { + "Request": { + "GetCapabilities": { + "Format": [ + "text/xml" + ], + "DCPType": [ + { + "HTTP": { + "Get": { + "OnlineResource": "http://localhost:8130/index.php/lizmap/service?repository=testsrepository&project=single_wms_image&" + } + } + } + ] + }, + "GetMap": { + "Format": [ + "image/jpeg", + "image/png", + "image/png; mode=16bit", + "image/png; mode=8bit", + "image/png; mode=1bit", + "application/dxf" + ], + "DCPType": [ + { + "HTTP": { + "Get": { + "OnlineResource": "http://localhost:8130/index.php/lizmap/service?repository=testsrepository&project=single_wms_image&" + } + } + } + ] + }, + "GetFeatureInfo": { + "Format": [ + "text/plain", + "text/html", + "text/xml", + "application/vnd.ogc.gml", + "application/vnd.ogc.gml/3.1.1", + "application/json", + "application/geo+json" + ], + "DCPType": [ + { + "HTTP": { + "Get": { + "OnlineResource": "http://localhost:8130/index.php/lizmap/service?repository=testsrepository&project=single_wms_image&" + } + } + } + ] + } + }, + "Exception": [ + "XML" + ], + "Layer": { + "Name": "single_wms_image", + "Title": "single_wms_image", + "KeywordList": [ + "infoMapAccessService" + ], + "CRS": [ + "CRS:84", + "EPSG:4326", + "EPSG:3857" + ], + "EX_GeographicBoundingBox": [ + 3.723186, + 43.541386, + 4.068051, + 43.684066 + ], + "BoundingBox": [ + { + "crs": "EPSG:3857", + "extent": [ + 414463.279, + 5394742.823, + 452853.337, + 5416679.999 + ], + "res": [ + null, + null + ] + }, + { + "crs": "EPSG:4326", + "extent": [ + 43.541386, + 3.723186, + 43.684066, + 4.068051 + ], + "res": [ + null, + null + ] + } + ], + "Layer": [ + { + "Name": "GroupAsLayer", + "Title": "GroupAsLayer", + "CRS": [ + "CRS:84", + "EPSG:4326", + "EPSG:3857", + "CRS:84", + "EPSG:4326", + "EPSG:3857" + ], + "EX_GeographicBoundingBox": [ + 3.889605, + 43.624573, + 3.93494, + 43.641649 + ], + "BoundingBox": [ + { + "crs": "EPSG:3857", + "extent": [ + 432988.863, + 5407526.635, + 438035.444, + 5410152.917 + ], + "res": [ + null, + null + ] + }, + { + "crs": "EPSG:4326", + "extent": [ + 43.624573, + 3.889605, + 43.641649, + 3.93494 + ], + "res": [ + null, + null + ] + } + ], + "Layer": [ + { + "Name": "single_wms_lines_group_as_layer", + "Title": "single_wms_lines_group_as_layer", + "CRS": [ + "CRS:84", + "EPSG:4326", + "EPSG:3857", + "CRS:84", + "EPSG:4326", + "EPSG:3857" + ], + "EX_GeographicBoundingBox": [ + 3.897469, + 43.624573, + 3.918286, + 43.636293 + ], + "BoundingBox": [ + { + "crs": "EPSG:3857", + "extent": [ + 433864.29, + 5407526.635, + 436181.599, + 5409328.986 + ], + "res": [ + null, + null + ] + }, + { + "crs": "EPSG:4326", + "extent": [ + 43.624573, + 3.897469, + 43.636293, + 3.918286 + ], + "res": [ + null, + null + ] + } + ], + "Style": [ + { + "Name": "default", + "Title": "default", + "LegendURL": [ + { + "Format": "image/png", + "OnlineResource": "http://localhost:8130/index.php/lizmap/service?repository=testsrepository&project=single_wms_image&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=single_wms_lines_group_as_layer&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0", + "size": [ + null, + null + ] + } + ] + } + ], + "queryable": true, + "opaque": false, + "noSubsets": false + }, + { + "Name": "single_wms_polygons_group_as_layer", + "Title": "single_wms_polygons_group_as_layer", + "CRS": [ + "CRS:84", + "EPSG:4326", + "EPSG:3857", + "CRS:84", + "EPSG:4326", + "EPSG:3857" + ], + "EX_GeographicBoundingBox": [ + 3.889605, + 43.627251, + 3.93494, + 43.641649 + ], + "BoundingBox": [ + { + "crs": "EPSG:3857", + "extent": [ + 432988.863, + 5407938.6, + 438035.444, + 5410152.917 + ], + "res": [ + null, + null + ] + }, + { + "crs": "EPSG:4326", + "extent": [ + 43.627251, + 3.889605, + 43.641649, + 3.93494 + ], + "res": [ + null, + null + ] + } + ], + "Style": [ + { + "Name": "default", + "Title": "default", + "LegendURL": [ + { + "Format": "image/png", + "OnlineResource": "http://localhost:8130/index.php/lizmap/service?repository=testsrepository&project=single_wms_image&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=single_wms_polygons_group_as_layer&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0", + "size": [ + null, + null + ] + } + ] + } + ], + "queryable": true, + "opaque": false, + "noSubsets": false + } + ], + "queryable": true, + "opaque": false, + "noSubsets": false + }, + { + "Name": "Group_1", + "Title": "Group_1", + "CRS": [ + "CRS:84", + "EPSG:4326", + "EPSG:3857", + "CRS:84", + "EPSG:4326", + "EPSG:3857" + ], + "EX_GeographicBoundingBox": [ + 3.881741, + 43.620052, + 3.893769, + 43.629094 + ], + "BoundingBox": [ + { + "crs": "EPSG:3857", + "extent": [ + 432113.436, + 5406831.442, + 433452.326, + 5408221.828 + ], + "res": [ + null, + null + ] + }, + { + "crs": "EPSG:4326", + "extent": [ + 43.620052, + 3.881741, + 43.629094, + 3.893769 + ], + "res": [ + null, + null + ] + } + ], + "Layer": [ + { + "Name": "single_wms_lines_group", + "Title": "single_wms_lines_group", + "CRS": [ + "CRS:84", + "EPSG:4326", + "EPSG:3857", + "CRS:84", + "EPSG:4326", + "EPSG:3857" + ], + "EX_GeographicBoundingBox": [ + 3.881741, + 43.620052, + 3.893769, + 43.629094 + ], + "BoundingBox": [ + { + "crs": "EPSG:3857", + "extent": [ + 432113.436, + 5406831.442, + 433452.326, + 5408221.828 + ], + "res": [ + null, + null + ] + }, + { + "crs": "EPSG:4326", + "extent": [ + 43.620052, + 3.881741, + 43.629094, + 3.893769 + ], + "res": [ + null, + null + ] + } + ], + "Style": [ + { + "Name": "default", + "Title": "default", + "LegendURL": [ + { + "Format": "image/png", + "OnlineResource": "http://localhost:8130/index.php/lizmap/service?repository=testsrepository&project=single_wms_image&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=single_wms_lines_group&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0", + "size": [ + null, + null + ] + } + ] + } + ], + "queryable": true, + "opaque": false, + "noSubsets": false + }, + { + "Name": "single_wms_points_group", + "Title": "single_wms_points_group", + "CRS": [ + "CRS:84", + "EPSG:4326", + "EPSG:3857", + "CRS:84", + "EPSG:4326", + "EPSG:3857" + ], + "EX_GeographicBoundingBox": [ + 3.885673, + 43.622898, + 3.889837, + 43.625578 + ], + "BoundingBox": [ + { + "crs": "EPSG:3857", + "extent": [ + 432551.15, + 5407269.156, + 433014.612, + 5407681.123 + ], + "res": [ + null, + null + ] + }, + { + "crs": "EPSG:4326", + "extent": [ + 43.622898, + 3.885673, + 43.625578, + 3.889837 + ], + "res": [ + null, + null + ] + } + ], + "Style": [ + { + "Name": "default", + "Title": "default", + "LegendURL": [ + { + "Format": "image/png", + "OnlineResource": "http://localhost:8130/index.php/lizmap/service?repository=testsrepository&project=single_wms_image&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=single_wms_points_group&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0", + "size": [ + null, + null + ] + } + ] + } + ], + "queryable": true, + "opaque": false, + "noSubsets": false + } + ], + "queryable": true, + "opaque": false, + "noSubsets": false + }, + { + "Name": "single_wms_points", + "Title": "Points", + "CRS": [ + "CRS:84", + "EPSG:4326", + "EPSG:3857", + "CRS:84", + "EPSG:4326", + "EPSG:3857" + ], + "EX_GeographicBoundingBox": [ + 3.856645, + 43.571055, + 3.954022, + 43.622983 + ], + "BoundingBox": [ + { + "crs": "EPSG:3857", + "extent": [ + 429319.793, + 5399300.194, + 440159.643, + 5407282.031 + ], + "res": [ + null, + null + ] + }, + { + "crs": "EPSG:4326", + "extent": [ + 43.571055, + 3.856645, + 43.622983, + 3.954022 + ], + "res": [ + null, + null + ] + } + ], + "Style": [ + { + "Name": "default", + "Title": "default", + "LegendURL": [ + { + "Format": "image/png", + "OnlineResource": "http://localhost:8130/index.php/lizmap/service?repository=testsrepository&project=single_wms_image&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=single_wms_points&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0", + "size": [ + null, + null + ] + } + ] + }, + { + "Name": "white_dots", + "Title": "white_dots", + "LegendURL": [ + { + "Format": "image/png", + "OnlineResource": "http://localhost:8130/index.php/lizmap/service?repository=testsrepository&project=single_wms_image&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=single_wms_points&FORMAT=image/png&STYLE=white_dots&SLD_VERSION=1.1.0", + "size": [ + null, + null + ] + } + ] + } + ], + "queryable": true, + "opaque": false, + "noSubsets": false + }, + { + "Name": "single_wms_lines", + "Title": "Lines", + "CRS": [ + "CRS:84", + "EPSG:4326", + "EPSG:3857", + "CRS:84", + "EPSG:4326", + "EPSG:3857" + ], + "EX_GeographicBoundingBox": [ + 3.812698, + 43.564016, + 3.914007, + 43.627504 + ], + "BoundingBox": [ + { + "crs": "EPSG:3857", + "extent": [ + 424427.7, + 5398218.784, + 435705.263, + 5407977.223 + ], + "res": [ + null, + null + ] + }, + { + "crs": "EPSG:4326", + "extent": [ + 43.564016, + 3.812698, + 43.627504, + 3.914007 + ], + "res": [ + null, + null + ] + } + ], + "Style": [ + { + "Name": "default", + "Title": "default", + "LegendURL": [ + { + "Format": "image/png", + "OnlineResource": "http://localhost:8130/index.php/lizmap/service?repository=testsrepository&project=single_wms_image&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=single_wms_lines&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0", + "size": [ + null, + null + ] + } + ] + } + ], + "queryable": true, + "opaque": false, + "noSubsets": false + }, + { + "Name": "single_wms_polygons", + "Title": "Polygons", + "CRS": [ + "CRS:84", + "EPSG:4326", + "EPSG:3857", + "CRS:84", + "EPSG:4326", + "EPSG:3857" + ], + "EX_GeographicBoundingBox": [ + 3.839991, + 43.573568, + 3.936443, + 43.637548 + ], + "BoundingBox": [ + { + "crs": "EPSG:3857", + "extent": [ + 427465.947, + 5399686.412, + 438202.806, + 5409522.095 + ], + "res": [ + null, + null + ] + }, + { + "crs": "EPSG:4326", + "extent": [ + 43.573568, + 3.839991, + 43.637548, + 3.936443 + ], + "res": [ + null, + null + ] + } + ], + "Style": [ + { + "Name": "default", + "Title": "default", + "LegendURL": [ + { + "Format": "image/png", + "OnlineResource": "http://localhost:8130/index.php/lizmap/service?repository=testsrepository&project=single_wms_image&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=single_wms_polygons&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0", + "size": [ + null, + null + ] + } + ] + } + ], + "queryable": true, + "opaque": false, + "noSubsets": false + }, + { + "Name": "baselayers", + "Title": "baselayers", + "CRS": [ + "CRS:84", + "EPSG:4326", + "EPSG:3857", + "CRS:84", + "EPSG:4326", + "EPSG:3857" + ], + "EX_GeographicBoundingBox": [ + -180, + -85.051129, + 180, + 85.051129 + ], + "BoundingBox": [ + { + "crs": "EPSG:3857", + "extent": [ + -20037508.343, + -20037508.343, + 20037508.343, + 20037508.343 + ], + "res": [ + null, + null + ] + }, + { + "crs": "EPSG:4326", + "extent": [ + -85.051129, + -180, + 85.051129, + 180 + ], + "res": [ + null, + null + ] + } + ], + "Layer": [ + { + "Name": "single_wms_baselayer", + "Title": "single_wms_baselayer", + "CRS": [ + "CRS:84", + "EPSG:4326", + "EPSG:3857", + "CRS:84", + "EPSG:4326", + "EPSG:3857" + ], + "EX_GeographicBoundingBox": [ + 3.802984, + 43.5641, + 3.982009, + 43.657046 + ], + "BoundingBox": [ + { + "crs": "EPSG:3857", + "extent": [ + 423346.29, + 5398231.658, + 443275.134, + 5412521.72 + ], + "res": [ + null, + null + ] + }, + { + "crs": "EPSG:4326", + "extent": [ + 43.5641, + 3.802984, + 43.657046, + 3.982009 + ], + "res": [ + null, + null + ] + } + ], + "Style": [ + { + "Name": "default", + "Title": "default", + "LegendURL": [ + { + "Format": "image/png", + "OnlineResource": "http://localhost:8130/index.php/lizmap/service?repository=testsrepository&project=single_wms_image&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=single_wms_baselayer&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0", + "size": [ + null, + null + ] + } + ] + } + ], + "queryable": true, + "opaque": false, + "noSubsets": false + }, + { + "Name": "single_wms_tiled_baselayer", + "Title": "single_wms_tiled_baselayer", + "CRS": [ + "CRS:84", + "EPSG:4326", + "EPSG:3857", + "CRS:84", + "EPSG:4326", + "EPSG:3857" + ], + "EX_GeographicBoundingBox": [ + 3.802984, + 43.5641, + 3.982009, + 43.657046 + ], + "BoundingBox": [ + { + "crs": "EPSG:3857", + "extent": [ + 423346.29, + 5398231.658, + 443275.134, + 5412521.72 + ], + "res": [ + null, + null + ] + }, + { + "crs": "EPSG:4326", + "extent": [ + 43.5641, + 3.802984, + 43.657046, + 3.982009 + ], + "res": [ + null, + null + ] + } + ], + "Style": [ + { + "Name": "default", + "Title": "default", + "LegendURL": [ + { + "Format": "image/png", + "OnlineResource": "http://localhost:8130/index.php/lizmap/service?repository=testsrepository&project=single_wms_image&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=single_wms_tiled_baselayer&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0", + "size": [ + null, + null + ] + } + ] + } + ], + "queryable": true, + "opaque": false, + "noSubsets": false + }, + { + "Name": "OpenStreetMap", + "Title": "OpenStreetMap", + "CRS": [ + "CRS:84", + "EPSG:4326", + "EPSG:3857", + "CRS:84", + "EPSG:4326", + "EPSG:3857" + ], + "EX_GeographicBoundingBox": [ + -180, + -85.051129, + 180, + 85.051129 + ], + "BoundingBox": [ + { + "crs": "EPSG:3857", + "extent": [ + -20037508.343, + -20037508.343, + 20037508.343, + 20037508.343 + ], + "res": [ + null, + null + ] + }, + { + "crs": "EPSG:4326", + "extent": [ + -85.051129, + -180, + 85.051129, + 180 + ], + "res": [ + null, + null + ] + } + ], + "Style": [ + { + "Name": "default", + "Title": "default", + "LegendURL": [ + { + "Format": "image/png", + "OnlineResource": "http://localhost:8130/index.php/lizmap/service?repository=testsrepository&project=single_wms_image&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=OpenStreetMap&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0", + "size": [ + null, + null + ] + } + ] + } + ], + "queryable": true, + "opaque": false, + "noSubsets": false + } + ], + "queryable": true, + "opaque": false, + "noSubsets": false + } + ] + } + } + } \ No newline at end of file diff --git a/tests/js-units/data/single_wms_image-config.json b/tests/js-units/data/single_wms_image-config.json new file mode 100644 index 0000000000..ab194d7950 --- /dev/null +++ b/tests/js-units/data/single_wms_image-config.json @@ -0,0 +1,567 @@ +{ + "metadata": { + "qgis_desktop_version": 32815, + "lizmap_plugin_version_str": "4.2.2", + "lizmap_plugin_version": 40202, + "lizmap_web_client_target_version": 30800, + "lizmap_web_client_target_status": "Dev", + "instance_target_url": "http://localhost:8130/", + "instance_target_repository": "intranet" + }, + "warnings": {}, + "options": { + "projection": { + "proj4": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs", + "ref": "EPSG:3857" + }, + "bbox": [ + "414463.27939999999944121", + "5394742.82330000028014183", + "452853.33649999997578561", + "5416679.9988000001758337" + ], + "mapScales": [ + 1, + 1000000000 + ], + "minScale": 1, + "maxScale": 1000000000, + "use_native_zoom_levels": true, + "hide_numeric_scale_value": true, + "initialExtent": [ + 414463.2794, + 5394742.8233, + 452853.3365, + 5416679.9988 + ], + "popupLocation": "dock", + "draw": "True", + "measure": "True", + "zoomHistory": "True", + "pointTolerance": 25, + "lineTolerance": 10, + "polygonTolerance": 5, + "wms_single_request_for_all_layers": "True", + "tmTimeFrameSize": 10, + "tmTimeFrameType": "seconds", + "tmAnimationFrameLength": 1000, + "datavizLocation": "dock", + "theme": "dark", + "fixed_scale_overview_map": true, + "dataviz_drag_drop": [] + }, + "layers": { + "GroupAsLayer": { + "id": "GroupAsLayer", + "name": "GroupAsLayer", + "type": "layer", + "title": "GroupAsLayer", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "True", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_lines_group_as_layer": { + "id": "single_wms_lines_group_as_layer_3b2aea6c_f225_4840_9065_832910fd65ea", + "name": "single_wms_lines_group_as_layer", + "type": "layer", + "geometryType": "line", + "extent": [ + 3.897469236874102, + 43.624573112616645, + 3.918285962272082, + 43.636292092309574 + ], + "crs": "EPSG:4326", + "title": "single_wms_lines_group_as_layer", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_polygons_group_as_layer": { + "id": "single_wms_polygons_group_as_layer_cb8ca18b_9474_411f_9e56_3e2cf877ab58", + "name": "single_wms_polygons_group_as_layer", + "type": "layer", + "geometryType": "polygon", + "extent": [ + 3.889605140612645, + 43.62725193799943, + 3.934939342590464, + 43.64164857911855 + ], + "crs": "EPSG:4326", + "title": "single_wms_polygons_group_as_layer", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "Group_1": { + "id": "Group_1", + "name": "Group_1", + "type": "group", + "title": "Group_1", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "False", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_lines_group": { + "id": "single_wms_lines_group_83aee53e_4c30_43e8_afad_19b5c995dbd8", + "name": "single_wms_lines_group", + "type": "layer", + "geometryType": "line", + "extent": [ + 3.881741044351187, + 43.62005232408322, + 3.89376848569224, + 43.62909356120091 + ], + "crs": "EPSG:4326", + "title": "single_wms_lines_group", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_points_group": { + "id": "single_wms_points_group_37aa76b0_0d6a_4b8c_8692_976350b1581b", + "name": "single_wms_points_group", + "type": "layer", + "geometryType": "point", + "extent": [ + 3.885673092481915, + 43.622898786130435, + 3.889836437561511, + 43.6255776861249 + ], + "crs": "EPSG:4326", + "title": "single_wms_points_group", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_points": { + "id": "single_wms_points_7462146f_833e_4d7f_be4f_bccfc4ca1662", + "name": "single_wms_points", + "type": "layer", + "geometryType": "point", + "extent": [ + 3.85664532539918, + 43.57105532588823, + 3.954021340871944, + 43.62298250356228 + ], + "crs": "EPSG:4326", + "styles": [ + "default", + "white_dots" + ], + "title": "Points", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_lines": { + "id": "single_wms_lines_1e302878_563d_4cc7_9bed_145269e95d68", + "name": "single_wms_lines", + "type": "layer", + "geometryType": "line", + "extent": [ + 3.81269890511456, + 43.564016584018404, + 3.914006968718052, + 43.627503071758575 + ], + "crs": "EPSG:4326", + "title": "Lines", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_polygons": { + "id": "single_wms_polygons_40d5f3fb_38b4_4012_9771_4a1f984eadf4", + "name": "single_wms_polygons", + "type": "layer", + "geometryType": "polygon", + "extent": [ + 3.839991945080798, + 43.57356896293618, + 3.936442772758097, + 43.63754756174983 + ], + "crs": "EPSG:4326", + "title": "Polygons", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "False", + "imageFormat": "image/png", + "cached": "True", + "cacheExpiration": 0, + "clientCacheExpiration": 300 + }, + "baselayers": { + "id": "baselayers", + "name": "baselayers", + "type": "group", + "title": "baselayers", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "False", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_baselayer": { + "id": "single_wms_baselayer_cbae5bbf_e9ca_49e9_ab6b_59d321e98aa9", + "name": "single_wms_baselayer", + "type": "layer", + "geometryType": "polygon", + "extent": [ + 3.802984433262168, + 43.56410038340208, + 3.982008271684779, + 43.657045818700006 + ], + "crs": "EPSG:4326", + "title": "single_wms_baselayer", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "False", + "popup": "False", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_tiled_baselayer": { + "id": "single_wms_tiled_baselayer_18228037_1139_4478_ae3e_3161e331ba07", + "name": "single_wms_tiled_baselayer", + "type": "layer", + "geometryType": "polygon", + "extent": [ + 3.802984433262168, + 43.56410038340208, + 3.982008271684779, + 43.657045818700006 + ], + "crs": "EPSG:4326", + "title": "single_wms_tiled_baselayer", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "False", + "popup": "False", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "False", + "imageFormat": "image/png", + "cached": "True", + "cacheExpiration": 0, + "clientCacheExpiration": 300 + }, + "OpenStreetMap": { + "id": "OpenStreetMap_029bc838_ea58_43c9_a5b6_cd7db7376d62", + "name": "OpenStreetMap", + "type": "layer", + "extent": [ + -20037508.342789244, + -20037508.342789248, + 20037508.342789244, + 20037508.342789248 + ], + "crs": "EPSG:3857", + "title": "OpenStreetMap", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "False", + "popup": "False", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + } + }, + "atlas": { + "layers": [] + }, + "locateByLayer": {}, + "attributeLayers": { + "single_wms_lines": { + "layerId": "single_wms_lines_1e302878_563d_4cc7_9bed_145269e95d68", + "primaryKey": "id", + "pivot": "False", + "hideAsChild": "False", + "hideLayer": "False", + "custom_config": "False", + "order": 0 + }, + "single_wms_points": { + "layerId": "single_wms_points_7462146f_833e_4d7f_be4f_bccfc4ca1662", + "primaryKey": "id", + "pivot": "False", + "hideAsChild": "False", + "hideLayer": "False", + "custom_config": "False", + "order": 1 + }, + "single_wms_lines_group": { + "layerId": "single_wms_lines_group_83aee53e_4c30_43e8_afad_19b5c995dbd8", + "primaryKey": "id", + "pivot": "False", + "hideAsChild": "False", + "hideLayer": "False", + "custom_config": "False", + "order": 2 + }, + "single_wms_lines_group_as_layer": { + "layerId": "single_wms_lines_group_as_layer_3b2aea6c_f225_4840_9065_832910fd65ea", + "primaryKey": "id", + "pivot": "False", + "hideAsChild": "False", + "hideLayer": "False", + "custom_config": "False", + "order": 3 + }, + "single_wms_points_group": { + "layerId": "single_wms_points_group_37aa76b0_0d6a_4b8c_8692_976350b1581b", + "primaryKey": "id", + "pivot": "False", + "hideAsChild": "False", + "hideLayer": "False", + "custom_config": "False", + "order": 4 + }, + "single_wms_polygons": { + "layerId": "single_wms_polygons_40d5f3fb_38b4_4012_9771_4a1f984eadf4", + "primaryKey": "id", + "pivot": "False", + "hideAsChild": "False", + "hideLayer": "False", + "custom_config": "False", + "order": 5 + }, + "single_wms_polygons_group_as_layer": { + "layerId": "single_wms_polygons_group_as_layer_cb8ca18b_9474_411f_9e56_3e2cf877ab58", + "primaryKey": "id", + "pivot": "False", + "hideAsChild": "False", + "hideLayer": "False", + "custom_config": "False", + "order": 6 + } + }, + "tooltipLayers": {}, + "editionLayers": {}, + "layouts": { + "config": { + "default_popup_print": false + }, + "list": [] + }, + "loginFilteredLayers": {}, + "timemanagerLayers": {}, + "datavizLayers": {}, + "filter_by_polygon": { + "config": { + "polygon_layer_id": "single_wms_polygons_40d5f3fb_38b4_4012_9771_4a1f984eadf4", + "group_field": "", + "filter_by_user": false + }, + "layers": [] + }, + "formFilterLayers": {} +} diff --git a/tests/js-units/node/config.test.js b/tests/js-units/node/config.test.js index fbb2a2f1a1..a19d5f80a2 100644 --- a/tests/js-units/node/config.test.js +++ b/tests/js-units/node/config.test.js @@ -130,4 +130,17 @@ describe('Config', function () { expect(initialConfig.datavizOptions).to.be.instanceOf(DatavizOptionsConfig) }) + it('SingleWMS Layer Config', function () { + const capabilities = JSON.parse(readFileSync('./data/single_wms_image-capabilities.json', 'utf8')); + expect(capabilities).to.not.be.undefined + expect(capabilities.Capability).to.not.be.undefined + const config = JSON.parse(readFileSync('./data/single_wms_image-config.json', 'utf8')); + expect(config).to.not.be.undefined + + const initialConfig = new Config(config, capabilities); + + expect(initialConfig.options).to.be.instanceOf(OptionsConfig) + expect(initialConfig.options.wms_single_request_for_all_layers).to.be.eq(true) + }) + }) diff --git a/tests/js-units/node/config/options.test.js b/tests/js-units/node/config/options.test.js index 6042dfc724..604ab5460f 100644 --- a/tests/js-units/node/config/options.test.js +++ b/tests/js-units/node/config/options.test.js @@ -74,6 +74,8 @@ describe('OptionsConfig', function () { expect(opt.hideGroupCheckbox).to.be.eq(false) // Default value for multiple mapScales without use_native_zoom_levels defined expect(opt.use_native_zoom_levels).to.be.eq(false) + // Default value for singleWMS option is false (option wms_single_request_for_all_layers not defined) + expect(opt.wms_single_request_for_all_layers).to.be.eq(false) }) it('use_native_zoom_levels', function () { @@ -171,6 +173,53 @@ describe('OptionsConfig', function () { expect(opt.use_native_zoom_levels).to.be.eq(true) }) + it('wms_single_request_for_all_layers', function () { + let opt = new OptionsConfig({ + "projection": { + "proj4": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs", + "ref": "EPSG:3857" + }, + "bbox": [ + "414463.27939999999944121", + "5394742.82330000028014183", + "452853.33649999997578561", + "5416679.9988000001758337" + ], + "mapScales": [ + 1, + 1000000000 + ], + "minScale": 1, + "maxScale": 1000000000, + "use_native_zoom_levels": true, + "hide_numeric_scale_value": true, + "initialExtent": [ + 414463.2794, + 5394742.8233, + 452853.3365, + 5416679.9988 + ], + "popupLocation": "dock", + "draw": "True", + "measure": "True", + "zoomHistory": "True", + "pointTolerance": 25, + "lineTolerance": 10, + "polygonTolerance": 5, + "wms_single_request_for_all_layers": "True", + "tmTimeFrameSize": 10, + "tmTimeFrameType": "seconds", + "tmAnimationFrameLength": 1000, + "datavizLocation": "dock", + "theme": "dark", + "fixed_scale_overview_map": true, + "dataviz_drag_drop": [] + }) + + // Load layers as a single WMS image + expect(opt.wms_single_request_for_all_layers).to.be.eq(true) + }) + it('ValidationError', function () { try { new OptionsConfig() diff --git a/tests/qgis-projects/tests/single_wms_image.qgs b/tests/qgis-projects/tests/single_wms_image.qgs new file mode 100644 index 0000000000..776360bbc9 --- /dev/null +++ b/tests/qgis-projects/tests/single_wms_image.qgs @@ -0,0 +1,5215 @@ + + + + + + + + + PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] + +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs + 3857 + 3857 + EPSG:3857 + WGS 84 / Pseudo-Mercator + merc + EPSG:7030 + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OpenStreetMap_029bc838_ea58_43c9_a5b6_cd7db7376d62 + single_wms_lines_1e302878_563d_4cc7_9bed_145269e95d68 + single_wms_points_7462146f_833e_4d7f_be4f_bccfc4ca1662 + single_wms_polygons_40d5f3fb_38b4_4012_9771_4a1f984eadf4 + single_wms_lines_group_83aee53e_4c30_43e8_afad_19b5c995dbd8 + single_wms_points_group_37aa76b0_0d6a_4b8c_8692_976350b1581b + single_wms_lines_group_as_layer_3b2aea6c_f225_4840_9065_832910fd65ea + single_wms_polygons_group_as_layer_cb8ca18b_9474_411f_9e56_3e2cf877ab58 + single_wms_baselayer_cbae5bbf_e9ca_49e9_ab6b_59d321e98aa9 + single_wms_tiled_baselayer_18228037_1139_4478_ae3e_3161e331ba07 + + + + + + + + + + + + + + + + + + + meters + + 430224.52479840919841081 + 5395141.91507946606725454 + 439975.85128684353549033 + 5417079.09058097656816244 + + 0 + + + PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] + +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs + 3857 + 3857 + EPSG:3857 + WGS 84 / Pseudo-Mercator + merc + EPSG:7030 + false + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Annotations_c6664103_04b9_4abb_9927_30c878bca869 + + + + + Annotations + + + PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] + +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs + 3857 + 3857 + EPSG:3857 + WGS 84 / Pseudo-Mercator + merc + EPSG:7030 + false + + + + + + + + + + + + + + + + + 0 + 0 + + + + + false + + + + + + 1 + 0 + + + + + + -20037508.34278924390673637 + -20037508.34278924763202667 + 20037508.34278924390673637 + 20037508.34278924763202667 + + + -180 + -85.05112877980660357 + 179.99999999999997158 + 85.05112877980660357 + + OpenStreetMap_029bc838_ea58_43c9_a5b6_cd7db7376d62 + crs=EPSG:3857&format&type=xyz&url=https://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png&zmax=19&zmin=0&http-header:referer= + OpenStreetMap + + + + OpenStreetMap + + + PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] + +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs + 3857 + 3857 + EPSG:3857 + WGS 84 / Pseudo-Mercator + merc + EPSG:7030 + false + + + + OpenStreetMap tiles + + + dataset + OpenStreetMap tiles + OpenStreetMap is built by a community of mappers that contribute and maintain data about roads, trails, cafés, railway stations, and much more, all over the world. + + + + + Base map and data from OpenStreetMap and OpenStreetMap Foundation (CC-BY-SA). © https://www.openstreetmap.org and contributors. + Open Data Commons Open Database License (ODbL) + Creative Commons Attribution-ShareAlike (CC-BY-SA) + + + + PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] + +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs + 3857 + 3857 + EPSG:3857 + WGS 84 / Pseudo-Mercator + merc + EPSG:7030 + false + + + + + + + wms + + + + + + + + + 1 + 1 + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + WholeRaster + Estimated + 0.02 + 0.98 + 2 + + + + + + resamplingFilter + + 0 + + + + 3.80298443326216784 + 43.56410038340207791 + 3.98200827168477911 + 43.65704581870000567 + + + 3.80298443326216784 + 43.56410038340207791 + 3.98200827168477911 + 43.65704581870000567 + + single_wms_baselayer_cbae5bbf_e9ca_49e9_ab6b_59d321e98aa9 + service='lizmapdb' sslmode=disable key='id' estimatedmetadata=true srid=4326 type=Polygon checkPrimaryKeyUnicity='1' table="tests_projects"."single_wms_baselayer" (geom) + single_wms_baselayer + + + + single_wms_baselayer + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + dataset + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + postgres + + + + + + + + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + generatedlayout + + + + + + + + + + + + + + + "title" + + + + + 3.81269890511455989 + 43.56401658401840393 + 3.91400696871805209 + 43.627503071758575 + + + 3.81269890511455989 + 43.56401658401840393 + 3.91400696871805209 + 43.627503071758575 + + single_wms_lines_1e302878_563d_4cc7_9bed_145269e95d68 + service='lizmapdb' sslmode=disable key='id' estimatedmetadata=true srid=4326 type=LineString checkPrimaryKeyUnicity='1' table="tests_projects"."single_wms_lines" (geom) + single_wms_lines + Lines + + + + single_wms_lines + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + dataset + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + postgres + + + + + + + + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + generatedlayout + + + + + + + + + + + + + + + "title" + + + + + 3.88174104435118705 + 43.62005232408321831 + 3.89376848569223988 + 43.62909356120091076 + + + 3.88174104435118705 + 43.62005232408321831 + 3.89376848569223988 + 43.62909356120091076 + + single_wms_lines_group_83aee53e_4c30_43e8_afad_19b5c995dbd8 + service='lizmapdb' sslmode=disable key='id' estimatedmetadata=true srid=4326 type=LineString checkPrimaryKeyUnicity='1' table="tests_projects"."single_wms_lines_group" (geom) + single_wms_lines_group + + + + single_wms_lines_group + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + dataset + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + postgres + + + + + + + + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + generatedlayout + + + + + + + + + + + + + + + "title" + + + + + 3.89746923687410218 + 43.62457311261664472 + 3.91828596227208203 + 43.63629209230957429 + + + 3.89746923687410218 + 43.62457311261664472 + 3.91828596227208203 + 43.63629209230957429 + + single_wms_lines_group_as_layer_3b2aea6c_f225_4840_9065_832910fd65ea + service='lizmapdb' sslmode=disable key='id' estimatedmetadata=true srid=4326 type=LineString checkPrimaryKeyUnicity='1' table="tests_projects"."single_wms_lines_group_as_layer" (geom) + single_wms_lines_group_as_layer + + + + single_wms_lines_group_as_layer + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + dataset + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + postgres + + + + + + + + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + generatedlayout + + + + + + + + + + + + + + + "title" + + + + + 3.85664532539917992 + 43.57105532588823138 + 3.95402134087194401 + 43.62298250356227669 + + + 3.85664532539917992 + 43.57105532588823138 + 3.95402134087194401 + 43.62298250356227669 + + single_wms_points_7462146f_833e_4d7f_be4f_bccfc4ca1662 + service='lizmapdb' sslmode=disable key='id' estimatedmetadata=true srid=4326 type=Point checkPrimaryKeyUnicity='1' table="tests_projects"."single_wms_points" (geom) + single_wms_points + Points + + + + single_wms_points + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + dataset + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + postgres + + + + + + + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + generatedlayout + + + + + + + + + + + + + + + "title" + + 0 + + + + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + generatedlayout + + + + + + + + + + + + + + + "title" + + + + + 3.88567309248191517 + 43.6228987861304347 + 3.88983643756151087 + 43.62557768612489895 + + + 3.88567309248191517 + 43.6228987861304347 + 3.88983643756151087 + 43.62557768612489895 + + single_wms_points_group_37aa76b0_0d6a_4b8c_8692_976350b1581b + service='lizmapdb' sslmode=disable key='id' estimatedmetadata=true srid=4326 type=Point checkPrimaryKeyUnicity='1' table="tests_projects"."single_wms_points_group" (geom) + single_wms_points_group + + + + single_wms_points_group + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + dataset + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + postgres + + + + + + + + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + generatedlayout + + + + + + + + + + + + + + + "title" + + + + + 3.839991945080798 + 43.57356896293617865 + 3.93644277275809706 + 43.63754756174982674 + + + 3.839991945080798 + 43.57356896293617865 + 3.93644277275809706 + 43.63754756174982674 + + single_wms_polygons_40d5f3fb_38b4_4012_9771_4a1f984eadf4 + service='lizmapdb' sslmode=disable key='id' estimatedmetadata=true srid=4326 type=Polygon checkPrimaryKeyUnicity='1' table="tests_projects"."single_wms_polygons" (geom) + single_wms_polygons + Polygons + + + + single_wms_polygons + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + dataset + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + postgres + + + + + + + + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + generatedlayout + + + + + + + + + + + + + + + "title" + + + + + 3.88960514061264506 + 43.62725193799943213 + 3.93493934259046396 + 43.64164857911855222 + + + 3.88960514061264506 + 43.62725193799943213 + 3.93493934259046396 + 43.64164857911855222 + + single_wms_polygons_group_as_layer_cb8ca18b_9474_411f_9e56_3e2cf877ab58 + service='lizmapdb' sslmode=disable key='id' estimatedmetadata=true srid=4326 type=Polygon checkPrimaryKeyUnicity='1' table="tests_projects"."single_wms_polygons_group_as_layer" (geom) + single_wms_polygons_group_as_layer + + + + single_wms_polygons_group_as_layer + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + dataset + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + postgres + + + + + + + + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + generatedlayout + + + + + + + + + + + 3.80298443326216784 + 43.56410038340207791 + 3.98200827168477911 + 43.65704581870000567 + + + 3.80298443326216784 + 43.56410038340207791 + 3.98200827168477911 + 43.65704581870000567 + + single_wms_tiled_baselayer_18228037_1139_4478_ae3e_3161e331ba07 + service='lizmapdb' sslmode=disable key='id' estimatedmetadata=true srid=4326 type=Polygon checkPrimaryKeyUnicity='1' table="tests_projects"."single_wms_tiled_baselayer" (geom) + single_wms_tiled_baselayer + + + + single_wms_tiled_baselayer + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + dataset + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + postgres + + + + + + + + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + generatedlayout + + + + + + + + + + + + + + + "title" + + + + + + + + + + + + + + + + + + 0 + + + 255 + 255 + 255 + 255 + 0 + 255 + 255 + + + false + + + + + + EPSG:7030 + + + m2 + meters + + + 5 + 2.5 + false + false + 1 + 0 + false + false + true + 0 + 255,0,0,255 + + + false + + + true + 2 + + false + + 1 + + + + lizmap_repository + lizmap_user + lizmap_user_groups + + + intranet + + + + + + + + single_wms_baselayer_cbae5bbf_e9ca_49e9_ab6b_59d321e98aa9 + single_wms_lines_1e302878_563d_4cc7_9bed_145269e95d68 + single_wms_lines_group_83aee53e_4c30_43e8_afad_19b5c995dbd8 + single_wms_lines_group_as_layer_3b2aea6c_f225_4840_9065_832910fd65ea + single_wms_points_7462146f_833e_4d7f_be4f_bccfc4ca1662 + single_wms_points_group_37aa76b0_0d6a_4b8c_8692_976350b1581b + single_wms_polygons_40d5f3fb_38b4_4012_9771_4a1f984eadf4 + single_wms_polygons_group_as_layer_cb8ca18b_9474_411f_9e56_3e2cf877ab58 + single_wms_tiled_baselayer_18228037_1139_4478_ae3e_3161e331ba07 + + + 8 + 8 + 8 + 8 + 8 + 8 + 8 + 8 + 8 + 8 + + + + + + + + None + false + + + + + + + EPSG:4326 + EPSG:3857 + + 1 + + 414463.27939999999944121 + 5394742.82330000028014183 + 452853.33649999997578561 + 5416679.9988000001758337 + + false + conditions unknown + 90 + + + + 1 + + 8 + single_wms_image + false + + true + single_wms_image + 0 + + false + + + + + + + + false + + + + + false + + 5000 + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + riccardo + 2023-10-30T14:10:42 + + + + + + + + + + PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] + +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs + 3857 + 3857 + EPSG:3857 + WGS 84 / Pseudo-Mercator + merc + EPSG:7030 + false + + + + + + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + diff --git a/tests/qgis-projects/tests/single_wms_image.qgs.cfg b/tests/qgis-projects/tests/single_wms_image.qgs.cfg new file mode 100644 index 0000000000..ab194d7950 --- /dev/null +++ b/tests/qgis-projects/tests/single_wms_image.qgs.cfg @@ -0,0 +1,567 @@ +{ + "metadata": { + "qgis_desktop_version": 32815, + "lizmap_plugin_version_str": "4.2.2", + "lizmap_plugin_version": 40202, + "lizmap_web_client_target_version": 30800, + "lizmap_web_client_target_status": "Dev", + "instance_target_url": "http://localhost:8130/", + "instance_target_repository": "intranet" + }, + "warnings": {}, + "options": { + "projection": { + "proj4": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs", + "ref": "EPSG:3857" + }, + "bbox": [ + "414463.27939999999944121", + "5394742.82330000028014183", + "452853.33649999997578561", + "5416679.9988000001758337" + ], + "mapScales": [ + 1, + 1000000000 + ], + "minScale": 1, + "maxScale": 1000000000, + "use_native_zoom_levels": true, + "hide_numeric_scale_value": true, + "initialExtent": [ + 414463.2794, + 5394742.8233, + 452853.3365, + 5416679.9988 + ], + "popupLocation": "dock", + "draw": "True", + "measure": "True", + "zoomHistory": "True", + "pointTolerance": 25, + "lineTolerance": 10, + "polygonTolerance": 5, + "wms_single_request_for_all_layers": "True", + "tmTimeFrameSize": 10, + "tmTimeFrameType": "seconds", + "tmAnimationFrameLength": 1000, + "datavizLocation": "dock", + "theme": "dark", + "fixed_scale_overview_map": true, + "dataviz_drag_drop": [] + }, + "layers": { + "GroupAsLayer": { + "id": "GroupAsLayer", + "name": "GroupAsLayer", + "type": "layer", + "title": "GroupAsLayer", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "True", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_lines_group_as_layer": { + "id": "single_wms_lines_group_as_layer_3b2aea6c_f225_4840_9065_832910fd65ea", + "name": "single_wms_lines_group_as_layer", + "type": "layer", + "geometryType": "line", + "extent": [ + 3.897469236874102, + 43.624573112616645, + 3.918285962272082, + 43.636292092309574 + ], + "crs": "EPSG:4326", + "title": "single_wms_lines_group_as_layer", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_polygons_group_as_layer": { + "id": "single_wms_polygons_group_as_layer_cb8ca18b_9474_411f_9e56_3e2cf877ab58", + "name": "single_wms_polygons_group_as_layer", + "type": "layer", + "geometryType": "polygon", + "extent": [ + 3.889605140612645, + 43.62725193799943, + 3.934939342590464, + 43.64164857911855 + ], + "crs": "EPSG:4326", + "title": "single_wms_polygons_group_as_layer", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "Group_1": { + "id": "Group_1", + "name": "Group_1", + "type": "group", + "title": "Group_1", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "False", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_lines_group": { + "id": "single_wms_lines_group_83aee53e_4c30_43e8_afad_19b5c995dbd8", + "name": "single_wms_lines_group", + "type": "layer", + "geometryType": "line", + "extent": [ + 3.881741044351187, + 43.62005232408322, + 3.89376848569224, + 43.62909356120091 + ], + "crs": "EPSG:4326", + "title": "single_wms_lines_group", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_points_group": { + "id": "single_wms_points_group_37aa76b0_0d6a_4b8c_8692_976350b1581b", + "name": "single_wms_points_group", + "type": "layer", + "geometryType": "point", + "extent": [ + 3.885673092481915, + 43.622898786130435, + 3.889836437561511, + 43.6255776861249 + ], + "crs": "EPSG:4326", + "title": "single_wms_points_group", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_points": { + "id": "single_wms_points_7462146f_833e_4d7f_be4f_bccfc4ca1662", + "name": "single_wms_points", + "type": "layer", + "geometryType": "point", + "extent": [ + 3.85664532539918, + 43.57105532588823, + 3.954021340871944, + 43.62298250356228 + ], + "crs": "EPSG:4326", + "styles": [ + "default", + "white_dots" + ], + "title": "Points", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_lines": { + "id": "single_wms_lines_1e302878_563d_4cc7_9bed_145269e95d68", + "name": "single_wms_lines", + "type": "layer", + "geometryType": "line", + "extent": [ + 3.81269890511456, + 43.564016584018404, + 3.914006968718052, + 43.627503071758575 + ], + "crs": "EPSG:4326", + "title": "Lines", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_polygons": { + "id": "single_wms_polygons_40d5f3fb_38b4_4012_9771_4a1f984eadf4", + "name": "single_wms_polygons", + "type": "layer", + "geometryType": "polygon", + "extent": [ + 3.839991945080798, + 43.57356896293618, + 3.936442772758097, + 43.63754756174983 + ], + "crs": "EPSG:4326", + "title": "Polygons", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "False", + "imageFormat": "image/png", + "cached": "True", + "cacheExpiration": 0, + "clientCacheExpiration": 300 + }, + "baselayers": { + "id": "baselayers", + "name": "baselayers", + "type": "group", + "title": "baselayers", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "False", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_baselayer": { + "id": "single_wms_baselayer_cbae5bbf_e9ca_49e9_ab6b_59d321e98aa9", + "name": "single_wms_baselayer", + "type": "layer", + "geometryType": "polygon", + "extent": [ + 3.802984433262168, + 43.56410038340208, + 3.982008271684779, + 43.657045818700006 + ], + "crs": "EPSG:4326", + "title": "single_wms_baselayer", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "False", + "popup": "False", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "single_wms_tiled_baselayer": { + "id": "single_wms_tiled_baselayer_18228037_1139_4478_ae3e_3161e331ba07", + "name": "single_wms_tiled_baselayer", + "type": "layer", + "geometryType": "polygon", + "extent": [ + 3.802984433262168, + 43.56410038340208, + 3.982008271684779, + 43.657045818700006 + ], + "crs": "EPSG:4326", + "title": "single_wms_tiled_baselayer", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "False", + "popup": "False", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "False", + "imageFormat": "image/png", + "cached": "True", + "cacheExpiration": 0, + "clientCacheExpiration": 300 + }, + "OpenStreetMap": { + "id": "OpenStreetMap_029bc838_ea58_43c9_a5b6_cd7db7376d62", + "name": "OpenStreetMap", + "type": "layer", + "extent": [ + -20037508.342789244, + -20037508.342789248, + 20037508.342789244, + 20037508.342789248 + ], + "crs": "EPSG:3857", + "title": "OpenStreetMap", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "False", + "popup": "False", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + } + }, + "atlas": { + "layers": [] + }, + "locateByLayer": {}, + "attributeLayers": { + "single_wms_lines": { + "layerId": "single_wms_lines_1e302878_563d_4cc7_9bed_145269e95d68", + "primaryKey": "id", + "pivot": "False", + "hideAsChild": "False", + "hideLayer": "False", + "custom_config": "False", + "order": 0 + }, + "single_wms_points": { + "layerId": "single_wms_points_7462146f_833e_4d7f_be4f_bccfc4ca1662", + "primaryKey": "id", + "pivot": "False", + "hideAsChild": "False", + "hideLayer": "False", + "custom_config": "False", + "order": 1 + }, + "single_wms_lines_group": { + "layerId": "single_wms_lines_group_83aee53e_4c30_43e8_afad_19b5c995dbd8", + "primaryKey": "id", + "pivot": "False", + "hideAsChild": "False", + "hideLayer": "False", + "custom_config": "False", + "order": 2 + }, + "single_wms_lines_group_as_layer": { + "layerId": "single_wms_lines_group_as_layer_3b2aea6c_f225_4840_9065_832910fd65ea", + "primaryKey": "id", + "pivot": "False", + "hideAsChild": "False", + "hideLayer": "False", + "custom_config": "False", + "order": 3 + }, + "single_wms_points_group": { + "layerId": "single_wms_points_group_37aa76b0_0d6a_4b8c_8692_976350b1581b", + "primaryKey": "id", + "pivot": "False", + "hideAsChild": "False", + "hideLayer": "False", + "custom_config": "False", + "order": 4 + }, + "single_wms_polygons": { + "layerId": "single_wms_polygons_40d5f3fb_38b4_4012_9771_4a1f984eadf4", + "primaryKey": "id", + "pivot": "False", + "hideAsChild": "False", + "hideLayer": "False", + "custom_config": "False", + "order": 5 + }, + "single_wms_polygons_group_as_layer": { + "layerId": "single_wms_polygons_group_as_layer_cb8ca18b_9474_411f_9e56_3e2cf877ab58", + "primaryKey": "id", + "pivot": "False", + "hideAsChild": "False", + "hideLayer": "False", + "custom_config": "False", + "order": 6 + } + }, + "tooltipLayers": {}, + "editionLayers": {}, + "layouts": { + "config": { + "default_popup_print": false + }, + "list": [] + }, + "loginFilteredLayers": {}, + "timemanagerLayers": {}, + "datavizLayers": {}, + "filter_by_polygon": { + "config": { + "polygon_layer_id": "single_wms_polygons_40d5f3fb_38b4_4012_9771_4a1f984eadf4", + "group_field": "", + "filter_by_user": false + }, + "layers": [] + }, + "formFilterLayers": {} +} diff --git a/tests/qgis-projects/tests/tests_dataset.sql b/tests/qgis-projects/tests/tests_dataset.sql index cc63fba72b..fac445be69 100644 --- a/tests/qgis-projects/tests/tests_dataset.sql +++ b/tests/qgis-projects/tests/tests_dataset.sql @@ -1685,6 +1685,94 @@ CREATE TABLE tests_projects.birds_areas ( + +-- +-- Name: single_wms_points; Type: Table; Schema: tests_projects; Owner: - +-- +CREATE TABLE tests_projects.single_wms_points ( + id SERIAL PRIMARY KEY, + title text, + geom public.geometry(Point,4326) +); + + +-- +-- Name: single_wms_lines; Type: Table; Schema: tests_projects; Owner: - +-- +CREATE TABLE tests_projects.single_wms_lines ( + id SERIAL PRIMARY KEY, + title text, + geom public.geometry(LineString,4326) +); + + +-- +-- Name: single_wms_lines; Type: Table; Schema: tests_projects; Owner: - +-- +CREATE TABLE tests_projects.single_wms_polygons ( + id SERIAL PRIMARY KEY, + title text, + geom public.geometry(Polygon,4326) +); + + +-- +-- Name: single_wms_points_group; Type: Table; Schema: tests_projects; Owner: - +-- +CREATE TABLE tests_projects.single_wms_points_group ( + id SERIAL PRIMARY KEY, + title text, + geom public.geometry(Point,4326) +); + + +-- +-- Name: single_wms_lines_group; Type: Table; Schema: tests_projects; Owner: - +-- +CREATE TABLE tests_projects.single_wms_lines_group ( + id SERIAL PRIMARY KEY, + title text, + geom public.geometry(LineString,4326) +); + + +-- +-- Name: single_wms_lines_group_as_layer; Type: Table; Schema: tests_projects; Owner: - +-- +CREATE TABLE tests_projects.single_wms_lines_group_as_layer ( + id SERIAL PRIMARY KEY, + title text, + geom public.geometry(LineString,4326) +); + + +-- +-- Name: single_wms_polygons_group_as_layer; Type: Table; Schema: tests_projects; Owner: - +-- +CREATE TABLE tests_projects.single_wms_polygons_group_as_layer ( + id SERIAL PRIMARY KEY, + title text, + geom public.geometry(Polygon,4326) +); + +-- +-- Name: single_wms_baselayer; Type: Table; Schema: tests_projects; Owner: - +-- +CREATE TABLE tests_projects.single_wms_baselayer ( + id SERIAL PRIMARY KEY, + title text, + geom public.geometry(Polygon,4326) +); + +-- +-- Name: single_wms_tiled_baselayer; Type: Table; Schema: tests_projects; Owner: - +-- +CREATE TABLE tests_projects.single_wms_tiled_baselayer ( + id SERIAL PRIMARY KEY, + title text, + geom public.geometry(Polygon,4326) +); + -- -- Name: tramway_stops_id_stop_seq; Type: SEQUENCE OWNED BY; Schema: tests_projects; Owner: - -- @@ -2480,6 +2568,99 @@ COPY tests_projects.parent_layer (id, geom) FROM stdin; \. +-- +-- Data for Name: single_wms_points; Type: TABLE DATA; Schema: tests_projects; Owner: - +-- + +COPY tests_projects.single_wms_points ("title", geom) FROM stdin; +Point_1 0101000000D4E246DD68DA0E40F6FE852F6FCE4540 +Point_2 01010000009F4B2640BA2E0F40BC7596500ECF4540 +Point_3 010100000086E099F00A170F404BD17ACF65CC4540 +Point_4 01010000000FC4C44FC7EE0E404BD17ACF65CC4540 +Point_5 01010000005E67816DC7000F40DD6303E4BDCF4540 +Point_6 01010000003BD9D5F0D5A10F40C372465718C94540 +\. + + +-- +-- Data for Name: single_wms_lines; Type: TABLE DATA; Schema: tests_projects; Owner: - +-- + +COPY tests_projects.single_wms_lines ("title", geom) FROM stdin; +Line_1 010200000003000000F9B211BC9ED60E408E3A65F50FCD4540540A8151ACE70E40CE34022A99CD4540959FB13B18FB0E408E3A65F50FCD4540 +Line_2 010200000003000000D834E225840E0F40D9FC65426DCD454033359F5F9F390F408A58458ECACD4540E7426E59180D0F40EA80A308B1CE4540 +Line_3 0102000000030000004DFF1B7EAC020F404E56A30FE0CA4540832F0ED991310F406B3AC4F516CB454059AEB7E2E24F0F40D560CC5F30CA4540 +Line_4 01020000000400000050B8E50891B30E40DBAB490552D0454043B2974868800E40FF555E11C5CD4540BACE6CE9ABA80E40EE7C290001CB4540DF96F95476D90E405E6107B231C84540 +\. + + +-- +-- Data for Name: single_wms_polygons; Type: TABLE DATA; Schema: tests_projects; Owner: - +-- + +COPY tests_projects.single_wms_polygons ("title", geom) FROM stdin; +Polygon_1 01030000000100000005000000B4C30716ACC30E40483F48BDBFD04540DF96F95476D90E408FC7AF52D9CF4540353DDDD20A050F401952B198F6D0454072CFE65CE2FE0E4016AE93289BD14540B4C30716ACC30E40483F48BDBFD04540 +Polygon_2 0103000000010000000500000084D85B7D9F4B0F4016605975F6CD454091E6E7B0334A0F4093FE883C2FCF45409B925CB5D57D0F407B4B94215BCF454058FD2BCB696A0F4019537694BFCD454084D85B7D9F4B0F4016605975F6CD4540 +Polygon_3 01030000000100000006000000ECA485880AD80E404588118DE5CA4540FC5B5F60ACF00E40C7E5AC6425CA4540ADB8A242ACDE0E40E0E730B56AC94540233468B24DB80E40739AD9C084CB4540FE639DD317BC0E40EA2CE38FE7CB4540ECA485880AD80E404588118DE5CA4540 +\. + + +-- +-- Data for Name: single_wms_points_group; Type: TABLE DATA; Schema: tests_projects; Owner: - +-- + +COPY tests_projects.single_wms_points_group ("title", geom) FROM stdin; +Gr_Point_1 01010000008E4139C6DB150F40C481FBED12D04540 +Gr_Point_2 01010000003CEDF090621E0F40FC92BD25BBCF4540 +\. + + +-- +-- Data for Name: single_wms_lines_group; Type: TABLE DATA; Schema: tests_projects; Owner: - +-- + +COPY tests_projects.single_wms_lines_group ("title", geom) FROM stdin; +Gr_Line_1 010200000003000000ECF2811770260F40C0783E418FCF4540560909F88A1B0F40B5BD472386D04540D487F5C7C00E0F402B69E0A680D04540 +Gr_Line_2 010200000003000000DE3BA83FCE0D0F4090257F710DD04540A95D512D04130F40C0783E418FCF4540F7A6348F7D250F4084DFE2DF5DCF4540 +\. + + +-- +-- Data for Name: single_wms_lines_group_as_layer; Type: TABLE DATA; Schema: tests_projects; Owner: - +-- + +COPY tests_projects.single_wms_lines_group_as_layer ("title", geom) FROM stdin; +GrL_Line_1 0102000000050000005C0C30581F350F40AE3AB89756D14540368BD96170530F402696EF0472D1454004AD824FA6580F40DA545E06B2D04540A0A160428B480F40B407A0CA49D0454075CE6E03C1320F40F8F619FFBCD04540 +GrL_Line_1 010200000003000000A152EC59042E0F40D13CCBCB09D1454094446026702F0F4020530203F2CF4540858548DB624B0F4023B1837FF7CF4540 +\. + + +-- +-- Data for Name: single_wms_polygons_group_as_layer; Type: TABLE DATA; Schema: tests_projects; Owner: - +-- + +COPY tests_projects.single_wms_polygons_group_as_layer ("title", geom) FROM stdin; +GrL_Polygon_1 010300000001000000050000004047CA4CE91D0F407A324B0E1CD24540369317D5DB1E0F4095FB91B52AD145408736D4F2DB300F402472445BAED14540721DE3EB474D0F40666B678A21D245404047CA4CE91D0F407A324B0E1CD24540 +GrL_Polygon_2 01030000000100000005000000DDDCB770705C0F40B407A0CA49D04540C71A79C5CE5E0F408F1E65FD7CD145401B180F9F55700F4034D366C414D14540B75B617AC17A0F40B407A0CA49D04540DDDCB770705C0F40B407A0CA49D04540 +\. + + +-- +-- Data for Name: single_wms_baselayer; Type: TABLE DATA; Schema: tests_projects; Owner: - +-- + +COPY tests_projects.single_wms_baselayer ("title", geom) FROM stdin; +BaseLayer 010300000001000000050000000077401A836C0E406218402DF9D34540F368B4E6EE6D0E40BE2FFD7034C84540064D1A2727DB0F40E97A89E64FC845403177BEC1E3D60F4021A5CF131AD445400077401A836C0E406218402DF9D34540 +\. + +-- +-- Data for Name: single_wms_tiled_baselayer; Type: TABLE DATA; Schema: tests_projects; Owner: - +-- + +COPY tests_projects.single_wms_tiled_baselayer ("title", geom) FROM stdin; +TiledBaseLayer 010300000001000000050000000077401A836C0E406218402DF9D34540F368B4E6EE6D0E40BE2FFD7034C84540064D1A2727DB0F40E97A89E64FC845403177BEC1E3D60F4021A5CF131AD445400077401A836C0E406218402DF9D34540 +\. + -- -- Data for Name: quartiers; Type: TABLE DATA; Schema: tests_projects; Owner: - --