From 07ba0db9011a6815b7663e1a93b9edc01794b4aa Mon Sep 17 00:00:00 2001 From: Riccardo Beltrami Date: Tue, 19 Mar 2024 16:15:10 +0100 Subject: [PATCH 1/2] Add QMS Google Maps Tiles --- assets/src/modules/config/BaseLayer.js | 78 +- assets/src/modules/map.js | 11 + assets/src/modules/state/BaseLayer.js | 32 +- tests/qgis-projects/tests/google_basemap.qgs | 997 ++++++++++++++++++ .../tests/google_basemap.qgs.cfg | 208 ++++ 5 files changed, 1324 insertions(+), 2 deletions(-) create mode 100644 tests/qgis-projects/tests/google_basemap.qgs create mode 100644 tests/qgis-projects/tests/google_basemap.qgs.cfg diff --git a/assets/src/modules/config/BaseLayer.js b/assets/src/modules/config/BaseLayer.js index 5297f3ef3d..0809c21605 100644 --- a/assets/src/modules/config/BaseLayer.js +++ b/assets/src/modules/config/BaseLayer.js @@ -31,6 +31,7 @@ export const BaseLayerTypes = createEnum({ 'WMTS': 'wmts', 'WMS': 'wms', 'Lizmap': 'lizmap', + 'Google': 'google', }); /** @@ -309,6 +310,52 @@ export class BingBaseLayerConfig extends BaseLayerConfig { } +const googleProperties = { + 'title': { type: 'string' }, + 'mapType': { type: 'string' } +} + +const googleOptionalProperties = { + 'key': { type: 'string', nullable: true } +} + +/** + * Class representing a Google base layer config + * @class + * @augments BaseLayerConfig + */ +export class GoogleBaseLayerConfig extends BaseLayerConfig { + /** + * Create a GOOGLE base layer config based on a config object + * @param {string} name - the base layer name + * @param {object} cfg - the lizmap config object for GOOGLE base layer + * @param {string} cfg.title - the base layer title + * @param {string} cfg.mapType - the base layer mapType + * @param {string} [cfg.key] - the base layer key + */ + constructor(name, cfg) { + if (!cfg || typeof cfg !== "object") { + throw new ValidationError('The cfg parameter is not an Object!'); + } + + if (Object.getOwnPropertyNames(cfg).length == 0) { + throw new ValidationError('The cfg parameter is empty!'); + } + + super(name, cfg, googleProperties, googleOptionalProperties) + this._type = BaseLayerTypes.Google; + } + + /** + * The Google mapType + * @type {string} + */ + get mapType() { + return this._mapType; + } + +} + const wmtsProperties = { 'title': { type: 'string' }, 'url': { type: 'string' }, @@ -745,6 +792,18 @@ const QMSExternalLayer = { "imagerySet": "Aerial", "key": "", }, + "google-streets": { + "type" :"google", + "title": "Google Streets", + "mapType": "roadmap", + "key":"" + }, + "google-satellite": { + "type" :"google", + "title": "Google Satellite", + "mapType": "satellite", + "key":"" + } } /** @@ -839,7 +898,20 @@ export class BaseLayersConfig { } // add the apikey to the configuration Object.assign(extendedCfg[layerTreeItem.name],{key:options["bingKey"]}) - } else { + } else if (externalUrl && externalUrl.includes('google.com') && options["googleKey"]){ + if (externalUrl.includes('lyrs=m')) { + // roads + extendedCfg[layerTreeItem.name] = structuredClone(QMSExternalLayer["google-streets"]) + } else if (externalUrl.includes('lyrs=s')){ + // fallback on satellite map + extendedCfg[layerTreeItem.name] = structuredClone(QMSExternalLayer["google-satellite"]) + } else { + extendedCfg[layerTreeItem.name] = structuredClone(QMSExternalLayer["google-streets"]) + } + // add the apikey to the configuration + Object.assign(extendedCfg[layerTreeItem.name],{key:options["googleKey"]}) + } + else { // layer could be converted to XYZ or WMTS background layers extendedCfg[layerTreeItem.name] = structuredClone(layerTreeItem.layerConfig.externalAccess); } @@ -995,6 +1067,10 @@ export class BaseLayersConfig { this._configs.push(new BingBaseLayerConfig(key, blCfg)); this._names.push(key); break; + case BaseLayerTypes.Google: + this._configs.push(new GoogleBaseLayerConfig(key, blCfg)); + this._names.push(key); + break; case BaseLayerTypes.WMTS: this._configs.push(new WmtsBaseLayerConfig(key, blCfg)); this._names.push(key); diff --git a/assets/src/modules/map.js b/assets/src/modules/map.js index b942b13777..3239e942cb 100644 --- a/assets/src/modules/map.js +++ b/assets/src/modules/map.js @@ -24,6 +24,7 @@ import TileGrid from 'ol/tilegrid/TileGrid.js'; import TileWMS from 'ol/source/TileWMS.js'; import XYZ from 'ol/source/XYZ.js'; import BingMaps from 'ol/source/BingMaps.js'; +import Google from 'ol/source/Google.js'; import {BaseLayer as LayerBase} from 'ol/layer/Base.js'; import LayerGroup from 'ol/layer/Group.js'; import { Vector as VectorSource } from 'ol/source.js'; @@ -448,6 +449,16 @@ export default class map extends olMap { // maxZoom: 19 }), }); + } else if (baseLayerState.type === BaseLayerTypes.Google) { + baseLayer = new TileLayer({ + minResolution: layerMinResolution, + maxResolution: layerMaxResolution, + preload: Infinity, + source: new Google({ + key: baseLayerState.key, + mapType: baseLayerState.mapType, + }), + }); } else if (baseLayerState.type === BaseLayerTypes.Lizmap) { if (baseLayerState.layerConfig.cached) { const parser = new WMTSCapabilities(); diff --git a/assets/src/modules/state/BaseLayer.js b/assets/src/modules/state/BaseLayer.js index e384f5446e..77ed6c562c 100644 --- a/assets/src/modules/state/BaseLayer.js +++ b/assets/src/modules/state/BaseLayer.js @@ -9,7 +9,7 @@ import EventDispatcher from './../../utils/EventDispatcher.js'; import { LayerConfig } from './../config/Layer.js'; import { AttributionConfig } from './../config/Attribution.js' -import { BaseLayerTypes, BaseLayersConfig, BaseLayerConfig, EmptyBaseLayerConfig, XyzBaseLayerConfig, BingBaseLayerConfig, WmtsBaseLayerConfig, WmsBaseLayerConfig } from './../config/BaseLayer.js'; +import { BaseLayerTypes, BaseLayersConfig, BaseLayerConfig, EmptyBaseLayerConfig, XyzBaseLayerConfig, BingBaseLayerConfig, GoogleBaseLayerConfig, WmtsBaseLayerConfig, WmsBaseLayerConfig } from './../config/BaseLayer.js'; import { LayerVectorState, LayerRasterState, LayerGroupState, LayersAndGroupsCollection } from './Layer.js' import { MapLayerLoadStatus } from './MapLayer.js'; @@ -267,6 +267,33 @@ export class BingBaseLayerState extends BaseLayerState { } } +/** + * Class representing a Google base layer state + * @class + * @augments BaseLayerState + */ +export class GoogleBaseLayerState extends BaseLayerState { + /** + * Create a base layers google state based on the google base layer config + * @param {GoogleBaseLayerConfig} baseLayerCfg - the lizmap google base layer config object + * @param {LayerRasterState} [itemState] - the lizmap google layer layer state + */ + constructor(baseLayerCfg, itemState = null ) { + if (baseLayerCfg.type !== BaseLayerTypes.Google) { + throw new TypeError('Not an `' + BaseLayerTypes.Google + '` base layer config. Get `' + baseLayerCfg.type + '` type for `' + baseLayerCfg.name + '` base layer!'); + } + super(baseLayerCfg, itemState) + } + + /** + * The google mapType + * @type {string} + */ + get mapType() { + return this._baseLayerConfig.mapType; + } +} + /** * Class representing an WMTS base layer state * @class @@ -432,6 +459,9 @@ export class BaseLayersState extends EventDispatcher { case BaseLayerTypes.Bing: this._baseLayersMap.set(blConfig.name, new BingBaseLayerState(blConfig, itemState)); break; + case BaseLayerTypes.Google: + this._baseLayersMap.set(blConfig.name, new GoogleBaseLayerState(blConfig, itemState)); + break; case BaseLayerTypes.WMTS: this._baseLayersMap.set(blConfig.name, new WmtsBaseLayerState(blConfig, itemState)); break; diff --git a/tests/qgis-projects/tests/google_basemap.qgs b/tests/qgis-projects/tests/google_basemap.qgs new file mode 100644 index 0000000000..689e2abf55 --- /dev/null +++ b/tests/qgis-projects/tests/google_basemap.qgs @@ -0,0 +1,997 @@ + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + Google_Road_49e6a75d_a5e7_4282_ae64_3028e0fd079c + Google_Satellite_40dd8739_61ab_479e_96bc_fbffd25b892d + Google_Hybrid_9c968a8a_fc6f_4b04_bff9_f846fe46288a + + + + + + + + + meters + + 423390.48888013570103794 + 5384670.92241199966520071 + 442893.14185700437519699 + 5428545.27341502252966166 + + 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_7c69d62c_6496_43cd_9f6d_d30ea9b1db04 + + + + + 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 + + Google_Hybrid_9c968a8a_fc6f_4b04_bff9_f846fe46288a + crs=EPSG:3857&format&type=xyz&url=https://mt1.google.com/vt/lyrs%3Dy%26x%3D%7Bx%7D%26y%3D%7By%7D%26z%3D%7Bz%7D&zmax=20&zmin=0 + Google_Hybrid + + + + Map data ©2015 Google + Google Hybrid + + + 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 + + + + + + + dataset + + + + + + + + + + 0 + 0 + + + + + false + + + + + wms + + + + + + + + + 1 + 1 + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + WholeRaster + Estimated + 0.02 + 0.98 + 2 + + + + + + resamplingFilter + + 0 + + + + -20037508.34278924390673637 + -20037508.34278924763202667 + 20037508.34278924390673637 + 20037508.34278924763202667 + + + -180 + -85.05112877980660357 + 179.99999999999997158 + 85.05112877980660357 + + Google_Road_49e6a75d_a5e7_4282_ae64_3028e0fd079c + crs=EPSG:3857&format&type=xyz&url=https://mt1.google.com/vt/lyrs%3Dm%26x%3D%7Bx%7D%26y%3D%7By%7D%26z%3D%7Bz%7D&zmax=20&zmin=0 + Google_Road + Google Streets + + + + Map data ©2015 Google + Google Streets + + + 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 + + + + + + + dataset + + + + + + + + + + 0 + 0 + + + + + false + + + + + wms + + + + + + + + + 1 + 1 + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + WholeRaster + Estimated + 0.02 + 0.98 + 2 + + + + + + resamplingFilter + + 0 + + + + -20037508.34278924390673637 + -20037508.34278924763202667 + 20037508.34278924390673637 + 20037508.34278924763202667 + + + -180 + -85.05112877980660357 + 179.99999999999997158 + 85.05112877980660357 + + Google_Satellite_40dd8739_61ab_479e_96bc_fbffd25b892d + crs=EPSG:3857&format&type=xyz&url=https://mt1.google.com/vt/lyrs%3Ds%26x%3D%7Bx%7D%26y%3D%7By%7D%26z%3D%7Bz%7D&zmax=20&zmin=0 + Google_Satellite + + + + Map data ©2015 Google + Google Satellite + + + 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 + + + + + + + dataset + + + + + + + + + + 0 + 0 + + + + + false + + + + + wms + + + + + + + + + 1 + 1 + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + WholeRaster + Estimated + 0.02 + 0.98 + 2 + + + + + + resamplingFilter + + 0 + + + + + + + + + + 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 + + + + + + + + + + + + + + None + false + + + + + + 1 + + 364277.86839999997755513 + 5364746.33179999981075525 + 500999.46990000002551824 + 5452495.03380000032484531 + + false + conditions unknown + 90 + + + + 1 + + 8 + google_basemap + false + + true + google_basemap + 0 + + false + + + + + + + + false + + + + + false + + 5000 + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + riccardo + 2024-03-15T10:18:57 + + + + + + + + + + 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/google_basemap.qgs.cfg b/tests/qgis-projects/tests/google_basemap.qgs.cfg new file mode 100644 index 0000000000..77d6310062 --- /dev/null +++ b/tests/qgis-projects/tests/google_basemap.qgs.cfg @@ -0,0 +1,208 @@ +{ + "metadata": { + "qgis_desktop_version": 32815, + "lizmap_plugin_version_str": "4.2.7", + "lizmap_plugin_version": 40207, + "lizmap_web_client_target_version": 30800, + "lizmap_web_client_target_status": "Unknown", + "instance_target_url": "http://localhost:8130/", + "instance_target_repository": "intranet" + }, + "warnings": {}, + "debug": { + "total_time": 0.091 + }, + "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": [ + "364277.86839999997755513", + "5364746.33179999981075525", + "500999.46990000002551824", + "5452495.03380000032484531" + ], + "mapScales": [ + 10000, + 25000, + 50000, + 100000, + 250000, + 500000 + ], + "minScale": 1, + "maxScale": 1000000000, + "use_native_zoom_levels": false, + "hide_numeric_scale_value": false, + "initialExtent": [ + 364277.8684, + 5364746.3318, + 500999.4699, + 5452495.0338 + ], + "popupLocation": "dock", + "pointTolerance": 25, + "lineTolerance": 10, + "polygonTolerance": 5, + "tmTimeFrameSize": 10, + "tmTimeFrameType": "seconds", + "tmAnimationFrameLength": 1000, + "datavizLocation": "dock", + "theme": "dark", + "fixed_scale_overview_map": true, + "dataviz_drag_drop": [] + }, + "layers": { + "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 + }, + "Google Streets": { + "id": "Google_Road_49e6a75d_a5e7_4282_ae64_3028e0fd079c", + "name": "Google Streets", + "type": "layer", + "extent": [ + -20037508.342789244, + -20037508.342789248, + 20037508.342789244, + 20037508.342789248 + ], + "crs": "EPSG:3857", + "title": "Google Streets", + "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 + }, + "Google Satellite": { + "id": "Google_Satellite_40dd8739_61ab_479e_96bc_fbffd25b892d", + "name": "Google Satellite", + "type": "layer", + "extent": [ + -20037508.342789244, + -20037508.342789248, + 20037508.342789244, + 20037508.342789248 + ], + "crs": "EPSG:3857", + "title": "Google Satellite", + "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 + }, + "Google Hybrid": { + "id": "Google_Hybrid_9c968a8a_fc6f_4b04_bff9_f846fe46288a", + "name": "Google Hybrid", + "type": "layer", + "extent": [ + -20037508.342789244, + -20037508.342789248, + 20037508.342789244, + 20037508.342789248 + ], + "crs": "EPSG:3857", + "title": "Google Hybrid", + "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": {}, + "tooltipLayers": {}, + "editionLayers": {}, + "layouts": { + "config": { + "default_popup_print": false + }, + "list": [] + }, + "loginFilteredLayers": {}, + "timemanagerLayers": {}, + "datavizLayers": {}, + "filter_by_polygon": { + "config": { + "polygon_layer_id": null, + "group_field": "", + "filter_by_user": false + }, + "layers": [] + }, + "formFilterLayers": {} +} From e592f4d10fed399a8aab378d3698f44a5491d139 Mon Sep 17 00:00:00 2001 From: Riccardo Beltrami Date: Fri, 14 Jun 2024 12:09:04 +0200 Subject: [PATCH 2/2] prevent empty baselayers group error, add test --- assets/src/modules/config/LayerTree.js | 6 +- .../end2end/playwright/google-basemap.spec.js | 39 + .../tests/google_apikey_basemap.qgs | 1333 +++++++++++++++++ .../tests/google_apikey_basemap.qgs.cfg | 243 +++ tests/qgis-projects/tests/google_basemap.qgs | 808 +++++++--- .../tests/google_basemap.qgs.cfg | 70 +- 6 files changed, 2242 insertions(+), 257 deletions(-) create mode 100644 tests/end2end/playwright/google-basemap.spec.js create mode 100644 tests/qgis-projects/tests/google_apikey_basemap.qgs create mode 100644 tests/qgis-projects/tests/google_apikey_basemap.qgs.cfg diff --git a/assets/src/modules/config/LayerTree.js b/assets/src/modules/config/LayerTree.js index fc5605f91a..212e30da73 100644 --- a/assets/src/modules/config/LayerTree.js +++ b/assets/src/modules/config/LayerTree.js @@ -420,7 +420,11 @@ function buildLayerTreeGroupConfigItems(wmsCapaLayerGroup, layersCfg, level) { const groupItems = buildLayerTreeGroupConfigItems(wmsCapaLayer, layersCfg, level+1); items.push(new LayerTreeGroupConfig(cfg.name, level+1, groupItems, wmsCapaLayer, cfg)); } else { - items.push(new LayerTreeLayerConfig(cfg.name, level+1, wmsCapaLayer, cfg)); + // avoid to add the baseLayers group to the map if doesn't contains any layer. + if(wmsName.toLowerCase() != 'baselayers') { + items.push(new LayerTreeLayerConfig(cfg.name, level+1, wmsCapaLayer, cfg)); + } + } } return items; diff --git a/tests/end2end/playwright/google-basemap.spec.js b/tests/end2end/playwright/google-basemap.spec.js new file mode 100644 index 0000000000..436719ffcb --- /dev/null +++ b/tests/end2end/playwright/google-basemap.spec.js @@ -0,0 +1,39 @@ + +const { test, expect } = require('@playwright/test'); +const { gotoMap } = require('./globals'); + +test.describe('Google Maps Baselayers', () => { + test('Load map with no API Key', async ({ page }) => { + const url = '/index.php/view/map?repository=testsrepository&project=google_basemap'; + await gotoMap(url, page); + + // baselayers group should be hidden since it is empty due to the default STRICT_GOOGLE_TOS_CHECK env variable value = TRUE + await expect(page.locator('#switcher-baselayer.hide')).toHaveCount(1); + + }); + + test('Load map with dummy API Key', async ({ page }) => { + // listen to the requests to intercept failing ones + let initGoogleRequestsCount = 0; + page.on('response', response => { + if(response.url().includes('createSession?key=dummy') && response.status() != 200) { + initGoogleRequestsCount++; + } + }); + + const url = '/index.php/view/map?repository=testsrepository&project=google_apikey_basemap'; + await gotoMap(url, page); + + // there are three Google base layers in the project, so the expected number of failing requests is three + expect(initGoogleRequestsCount).toBe(3); + // baselayers group should be visible... + await expect(page.locator('#switcher-baselayer')).toBeVisible(); + + //.. and should contains the three Google base layers (not loaded) + let options = page.locator('#switcher-baselayer').getByRole('combobox').locator('option'); + await expect(options).toHaveCount(3); + expect(await options.nth(0).getAttribute('value')).toBe('Google Streets'); + expect(await options.nth(1).getAttribute('value')).toBe('Google Satellite'); + expect(await options.nth(2).getAttribute('value')).toBe('Google Hybrid'); + }); +}); \ No newline at end of file diff --git a/tests/qgis-projects/tests/google_apikey_basemap.qgs b/tests/qgis-projects/tests/google_apikey_basemap.qgs new file mode 100644 index 0000000000..981143dd31 --- /dev/null +++ b/tests/qgis-projects/tests/google_apikey_basemap.qgs @@ -0,0 +1,1333 @@ + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Google_Road_49e6a75d_a5e7_4282_ae64_3028e0fd079c + Google_Satellite_40dd8739_61ab_479e_96bc_fbffd25b892d + Google_Hybrid_9c968a8a_fc6f_4b04_bff9_f846fe46288a + natural_areas_e89a32a9_3a6e_4256_948f_ed8ca0ec687d + + + + + + + + + + + meters + + 393403.14453614846570417 + 5333526.6934811482205987 + 471413.75644362316234037 + 5509024.09749323967844248 + + 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_7c69d62c_6496_43cd_9f6d_d30ea9b1db04 + + + + + 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 + + Google_Hybrid_9c968a8a_fc6f_4b04_bff9_f846fe46288a + crs=EPSG:3857&format&type=xyz&url=https://mt1.google.com/vt/lyrs%3Dy%26x%3D%7Bx%7D%26y%3D%7By%7D%26z%3D%7Bz%7D&zmax=20&zmin=0 + Google_Hybrid + + + + Map data ©2015 Google + Google Hybrid + + + 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 + + + + + + + dataset + + + + + + + + + + 0 + 0 + + + + + false + + + + + wms + + + + + + + + + 1 + 1 + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + WholeRaster + Estimated + 0.02 + 0.98 + 2 + + + + + + resamplingFilter + + 0 + + + + -20037508.34278924390673637 + -20037508.34278924763202667 + 20037508.34278924390673637 + 20037508.34278924763202667 + + + -180 + -85.05112877980660357 + 179.99999999999997158 + 85.05112877980660357 + + Google_Road_49e6a75d_a5e7_4282_ae64_3028e0fd079c + crs=EPSG:3857&format&type=xyz&url=https://mt1.google.com/vt/lyrs%3Dm%26x%3D%7Bx%7D%26y%3D%7By%7D%26z%3D%7Bz%7D&zmax=20&zmin=0 + Google_Road + Google Streets + + + + Map data ©2015 Google + Google Streets + + + 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 + + + + + + + dataset + + + + + + + + + + 0 + 0 + + + + + false + + + + + wms + + + + + + + + + 1 + 1 + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + WholeRaster + Estimated + 0.02 + 0.98 + 2 + + + + + + resamplingFilter + + 0 + + + + -20037508.34278924390673637 + -20037508.34278924763202667 + 20037508.34278924390673637 + 20037508.34278924763202667 + + + -180 + -85.05112877980660357 + 179.99999999999997158 + 85.05112877980660357 + + Google_Satellite_40dd8739_61ab_479e_96bc_fbffd25b892d + crs=EPSG:3857&format&type=xyz&url=https://mt1.google.com/vt/lyrs%3Ds%26x%3D%7Bx%7D%26y%3D%7By%7D%26z%3D%7Bz%7D&zmax=20&zmin=0 + Google_Satellite + + + + Map data ©2015 Google + Google Satellite + + + 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 + + + + + + + dataset + + + + + + + + + + 0 + 0 + + + + + false + + + + + wms + + + + + + + + + 1 + 1 + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + WholeRaster + Estimated + 0.02 + 0.98 + 2 + + + + + + resamplingFilter + + 0 + + + + 4.58213930607160602 + 43.35054476032322412 + 4.64863080116274929 + 43.45587426605017356 + + + 4.58213930607160602 + 43.35054476032322412 + 4.64863080116274929 + 43.45587426605017356 + + natural_areas_e89a32a9_3a6e_4256_948f_ed8ca0ec687d + service='lizmapdb' user='lizmap' password='lizmap1234!' sslmode=disable key='id' estimatedmetadata=true srid=4326 type=Polygon checkPrimaryKeyUnicity='1' table="tests_projects"."natural_areas" (geom) + natural_areas + + + + natural_areas + + + 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 + + + + + + + + + + + + + + + + + + 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 + + + etra + + + + + + + + + + + + + + None + false + + + + + + 1 + + 364277.86839999997755513 + 5364746.33179999981075525 + 500999.46990000002551824 + 5452495.03380000032484531 + + false + conditions unknown + 90 + + + + 1 + + 8 + google_apikey_basemap + false + + true + google_apikey_basemap + 0 + + false + + + + + + + + false + + + + + false + + 5000 + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + riccardo + 2024-03-15T10:18:57 + + + + + + + + + + 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/google_apikey_basemap.qgs.cfg b/tests/qgis-projects/tests/google_apikey_basemap.qgs.cfg new file mode 100644 index 0000000000..1683a622d4 --- /dev/null +++ b/tests/qgis-projects/tests/google_apikey_basemap.qgs.cfg @@ -0,0 +1,243 @@ +{ + "metadata": { + "qgis_desktop_version": 32809, + "lizmap_plugin_version_str": "4.3.16", + "lizmap_plugin_version": 40316, + "lizmap_web_client_target_version": 30700, + "lizmap_web_client_target_status": "Stable", + "instance_target_url": "https://etra-test.faunalia.it/", + "instance_target_repository": "etra" + }, + "warnings": {}, + "debug": { + "total_time": 0.14600000000000002 + }, + "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": [ + "364277.86839999997755513", + "5364746.33179999981075525", + "500999.46990000002551824", + "5452495.03380000032484531" + ], + "mapScales": [ + 10000, + 25000, + 50000, + 100000, + 250000, + 500000 + ], + "minScale": 1, + "maxScale": 1000000000, + "use_native_zoom_levels": false, + "hide_numeric_scale_value": false, + "initialExtent": [ + 364277.8684, + 5364746.3318, + 500999.4699, + 5452495.0338 + ], + "googleKey": "dummy", + "popupLocation": "dock", + "pointTolerance": 25, + "lineTolerance": 10, + "polygonTolerance": 5, + "tmTimeFrameSize": 10, + "tmTimeFrameType": "seconds", + "tmAnimationFrameLength": 1000, + "datavizLocation": "dock", + "theme": "dark", + "fixed_scale_overview_map": true, + "dataviz_drag_drop": [] + }, + "layers": { + "natural_areas": { + "id": "natural_areas_e89a32a9_3a6e_4256_948f_ed8ca0ec687d", + "name": "natural_areas", + "type": "layer", + "geometryType": "polygon", + "extent": [ + 4.582139306071606, + 43.350544760323224, + 4.648630801162749, + 43.455874266050174 + ], + "crs": "EPSG:4326", + "title": "natural_areas", + "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 + }, + "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 + }, + "Google Streets": { + "id": "Google_Road_49e6a75d_a5e7_4282_ae64_3028e0fd079c", + "name": "Google Streets", + "type": "layer", + "extent": [ + -20037508.342789244, + -20037508.342789248, + 20037508.342789244, + 20037508.342789248 + ], + "crs": "EPSG:3857", + "title": "Google Streets", + "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 + }, + "Google Satellite": { + "id": "Google_Satellite_40dd8739_61ab_479e_96bc_fbffd25b892d", + "name": "Google Satellite", + "type": "layer", + "extent": [ + -20037508.342789244, + -20037508.342789248, + 20037508.342789244, + 20037508.342789248 + ], + "crs": "EPSG:3857", + "title": "Google Satellite", + "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 + }, + "Google Hybrid": { + "id": "Google_Hybrid_9c968a8a_fc6f_4b04_bff9_f846fe46288a", + "name": "Google Hybrid", + "type": "layer", + "extent": [ + -20037508.342789244, + -20037508.342789248, + 20037508.342789244, + 20037508.342789248 + ], + "crs": "EPSG:3857", + "title": "Google Hybrid", + "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": {}, + "tooltipLayers": {}, + "editionLayers": {}, + "layouts": { + "config": { + "default_popup_print": false + }, + "list": [] + }, + "loginFilteredLayers": {}, + "timemanagerLayers": {}, + "datavizLayers": {}, + "filter_by_polygon": { + "config": { + "polygon_layer_id": "natural_areas_e89a32a9_3a6e_4256_948f_ed8ca0ec687d", + "group_field": "id", + "filter_by_user": false + }, + "layers": [] + }, + "formFilterLayers": {} +} diff --git a/tests/qgis-projects/tests/google_basemap.qgs b/tests/qgis-projects/tests/google_basemap.qgs index 689e2abf55..48c495d436 100644 --- a/tests/qgis-projects/tests/google_basemap.qgs +++ b/tests/qgis-projects/tests/google_basemap.qgs @@ -1,5 +1,5 @@ - + @@ -21,23 +21,28 @@ - + + + + + - + - + - + @@ -47,20 +52,23 @@ Google_Road_49e6a75d_a5e7_4282_ae64_3028e0fd079c Google_Satellite_40dd8739_61ab_479e_96bc_fbffd25b892d Google_Hybrid_9c968a8a_fc6f_4b04_bff9_f846fe46288a + natural_areas_e89a32a9_3a6e_4256_948f_ed8ca0ec687d - - + + + + meters - 423390.48888013570103794 - 5384670.92241199966520071 - 442893.14185700437519699 - 5428545.27341502252966166 + 393403.14453614846570417 + 5333526.6934811482205987 + 471413.75644362316234037 + 5509024.09749323967844248 0 @@ -81,26 +89,31 @@ - - + + + + + - + - + - + Annotations_7c69d62c_6496_43cd_9f6d_d30ea9b1db04 @@ -151,7 +164,7 @@ - + -20037508.34278924390673637 -20037508.34278924763202667 @@ -212,7 +225,7 @@ wms - + @@ -224,97 +237,97 @@ 0 0 - + - + - + - + - + - + @@ -323,21 +336,21 @@ - + - + None @@ -348,14 +361,14 @@ 2 - - + + resamplingFilter 0 - + -20037508.34278924390673637 -20037508.34278924763202667 @@ -417,7 +430,7 @@ wms - + @@ -429,97 +442,97 @@ 0 0 - + - + - + - + - + - + @@ -528,21 +541,21 @@ - + - + None @@ -553,14 +566,14 @@ 2 - - + + resamplingFilter 0 - + -20037508.34278924390673637 -20037508.34278924763202667 @@ -621,7 +634,7 @@ wms - + @@ -633,97 +646,97 @@ 0 0 - + - + - + - + - + - + @@ -732,21 +745,21 @@ - + - + None @@ -757,18 +770,341 @@ 2 - - + + resamplingFilter 0 + + + 4.58213930607160602 + 43.35054476032322412 + 4.64863080116274929 + 43.45587426605017356 + + + 4.58213930607160602 + 43.35054476032322412 + 4.64863080116274929 + 43.45587426605017356 + + natural_areas_e89a32a9_3a6e_4256_948f_ed8ca0ec687d + service='lizmapdb' user='lizmap' password='lizmap1234!' sslmode=disable key='id' estimatedmetadata=true srid=4326 type=Polygon checkPrimaryKeyUnicity='1' table="tests_projects"."natural_areas" (geom) + natural_areas + + + + natural_areas + + + 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 + + + + + + + + + @@ -827,7 +1163,7 @@ lizmap_user_groups - intranet + etra @@ -896,9 +1232,9 @@ @@ -927,9 +1263,9 @@ - + - + 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 @@ -943,41 +1279,41 @@ - + - + - + diff --git a/tests/qgis-projects/tests/google_basemap.qgs.cfg b/tests/qgis-projects/tests/google_basemap.qgs.cfg index 77d6310062..d5d0db836e 100644 --- a/tests/qgis-projects/tests/google_basemap.qgs.cfg +++ b/tests/qgis-projects/tests/google_basemap.qgs.cfg @@ -1,16 +1,16 @@ { "metadata": { - "qgis_desktop_version": 32815, - "lizmap_plugin_version_str": "4.2.7", - "lizmap_plugin_version": 40207, - "lizmap_web_client_target_version": 30800, - "lizmap_web_client_target_status": "Unknown", - "instance_target_url": "http://localhost:8130/", - "instance_target_repository": "intranet" + "qgis_desktop_version": 32809, + "lizmap_plugin_version_str": "4.3.16", + "lizmap_plugin_version": 40316, + "lizmap_web_client_target_version": 30700, + "lizmap_web_client_target_status": "Stable", + "instance_target_url": "https://etra-test.faunalia.it/", + "instance_target_repository": "etra" }, "warnings": {}, "debug": { - "total_time": 0.091 + "total_time": 0.175 }, "options": { "projection": { @@ -24,16 +24,12 @@ "5452495.03380000032484531" ], "mapScales": [ - 10000, - 25000, - 50000, - 100000, - 250000, - 500000 + 1, + 1000000000 ], "minScale": 1, "maxScale": 1000000000, - "use_native_zoom_levels": false, + "use_native_zoom_levels": true, "hide_numeric_scale_value": false, "initialExtent": [ 364277.8684, @@ -54,11 +50,45 @@ "dataviz_drag_drop": [] }, "layers": { - "baselayers": { - "id": "baselayers", - "name": "baselayers", + "natural_areas": { + "id": "natural_areas_e89a32a9_3a6e_4256_948f_ed8ca0ec687d", + "name": "natural_areas", + "type": "layer", + "geometryType": "polygon", + "extent": [ + 4.582139306071606, + 43.350544760323224, + 4.648630801162749, + 43.455874266050174 + ], + "crs": "EPSG:4326", + "title": "natural_areas", + "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 + }, + "baseLayers": { + "id": "baseLayers", + "name": "baseLayers", "type": "group", - "title": "baselayers", + "title": "baseLayers", "abstract": "", "link": "", "minScale": 1, @@ -198,7 +228,7 @@ "datavizLayers": {}, "filter_by_polygon": { "config": { - "polygon_layer_id": null, + "polygon_layer_id": "natural_areas_e89a32a9_3a6e_4256_948f_ed8ca0ec687d", "group_field": "", "filter_by_user": false },