diff --git a/lizmap/modules/lizmap/lib/Project/QgisProject.php b/lizmap/modules/lizmap/lib/Project/QgisProject.php
index 52f42f60b5..6c754081e4 100644
--- a/lizmap/modules/lizmap/lib/Project/QgisProject.php
+++ b/lizmap/modules/lizmap/lib/Project/QgisProject.php
@@ -377,17 +377,31 @@ protected function setShortNames(ProjectConfig $cfg)
*/
protected function setLayerOpacity(ProjectConfig $cfg)
{
- $layerWithOpacities = $this->xpathQuery('//maplayer/layerOpacity[.!=1]/parent::* | //maplayer/pipe/rasterrenderer/@opacity[.!=1]/ancestor::maplayer');
- if ($layerWithOpacities) {
- foreach ($layerWithOpacities as $layerWithOpacity) {
- $name = (string) $layerWithOpacity->layername;
+ $layers = $this->layers;
+ // loop through project layers to get embedded ones as well
+ foreach ($layers as $layer) {
+ $xpath = "//maplayer[id='{$layer['id']}']/layerOpacity[.!=1]/parent::* | //maplayer[id='{$layer['id']}']/pipe/rasterrenderer/@opacity[.!=1]/ancestor::maplayer";
+ $layerWithOpacity = null;
+
+ // check if layer is embedded or not
+ $qgisProject = $this->getEmbeddedQgisProject($layer['id']);
+
+ if ($qgisProject) {
+ $layerWithOpacity = $qgisProject->xpathQuery($xpath);
+ } else {
+ $layerWithOpacity = $this->xpathQuery($xpath);
+ }
+
+ // layerWithOpacity should have length == 1, if any
+ if ($layerWithOpacity && count($layerWithOpacity) == 1) {
+ $name = (string) $layerWithOpacity[0]->layername;
$layerCfg = $cfg->getLayer($name);
$opacity = 1;
if ($layerCfg) {
- if (isset($layerWithOpacity->layerOpacity)) {
- $opacity = (float) $layerWithOpacity->layerOpacity;
- } elseif (isset($layerWithOpacity->pipe->rasterrenderer['opacity'])) {
- $opacity = (float) $layerWithOpacity->pipe->rasterrenderer['opacity'];
+ if (isset($layerWithOpacity[0]->layerOpacity)) {
+ $opacity = (float) $layerWithOpacity[0]->layerOpacity;
+ } elseif (isset($layerWithOpacity[0]->pipe->rasterrenderer['opacity'])) {
+ $opacity = (float) $layerWithOpacity[0]->pipe->rasterrenderer['opacity'];
}
$layerCfg->opacity = $opacity;
}
diff --git a/tests/units/classes/Project/QgisProjectTest.php b/tests/units/classes/Project/QgisProjectTest.php
index 354d4817b5..f5ee944bcb 100644
--- a/tests/units/classes/Project/QgisProjectTest.php
+++ b/tests/units/classes/Project/QgisProjectTest.php
@@ -397,8 +397,51 @@ public function testSetLayerOpacity()
$cfg = new Project\ProjectConfig((object) array('layers' => $json->layers));
$testProj = new qgisProjectForTests();
$testProj->setXmlForTest(simplexml_load_file(__DIR__.'/Ressources/opacity.qgs'));
+ $layers = array(
+ array (
+ 'id' => 'events_4c3b47b8_3939_4c8c_8e91_55bdb13a2101',
+ 'name' => 'montpellier_events',
+ ),
+ array (
+ 'id' => 'raster_78572dfa_41b3_42da_a9c6_933ead8bad8f',
+ 'name' => 'local_raster_layer',
+ ),
+ );
+ $testProj->setLayers($layers);
$testProj->setLayerOpacityForTest($cfg);
$this->assertEquals($expectedLayer, $cfg->getLayers());
+
+ // embedded layers
+ $file = __DIR__.'/Ressources/opacity_embed.qgs';
+ $data = array(
+ 'WMSInformation' => array(),
+ 'layers' => array(),
+ );
+ $file = __DIR__.'/Ressources/opacity_embed.qgs';
+ $testProjE = new ProjectForTests();
+
+ $testQgis = new QgisProjectForTests($data);
+ $rep = new Project\Repository('key', array(), null, null, null);
+ $testQgis->setPath($file);
+ $testQgis->readXMLProjectTest($file);
+
+ $cfg = json_decode(file_get_contents($file.'.cfg'));
+ $config = new Project\ProjectConfig($cfg);
+
+ $testProjE->setCfg($config);
+ $testProjE->setQgis($testQgis);
+ $testProjE->setRepo($rep);
+ $testProjE->setKey('test');
+
+ $testQgis->setLayerOpacityForTest($config);
+
+ $emLayer = $testQgis->getLayer('_a5a62408_edf3_4c07_a266_0e8ae6642517', $testProjE);
+ $this->assertNotNull($emLayer);
+ $this->assertEquals($emLayer->getName(), 'Fabbricati');
+
+ $eLayerName = $emLayer->getName();
+ $this->assertNotNull($config->getLayer($eLayerName));
+ $this->assertEquals(0.4,$config->getLayer($eLayerName)->opacity);
}
public static function getLayerData()
diff --git a/tests/units/classes/Project/Ressources/opacity.qgs b/tests/units/classes/Project/Ressources/opacity.qgs
index e220a0edd9..5a4a340167 100644
--- a/tests/units/classes/Project/Ressources/opacity.qgs
+++ b/tests/units/classes/Project/Ressources/opacity.qgs
@@ -15,6 +15,7 @@
0
montpellier_events
+ events_4c3b47b8_3939_4c8c_8e91_55bdb13a2101
0
0.85
diff --git a/tests/units/classes/Project/Ressources/opacity_embed.qgs b/tests/units/classes/Project/Ressources/opacity_embed.qgs
new file mode 100644
index 0000000000..a5379f9bd0
--- /dev/null
+++ b/tests/units/classes/Project/Ressources/opacity_embed.qgs
@@ -0,0 +1,768 @@
+
+
+
+
+
+
+
+
+ PROJCRS["RDN2008 / Zone 12 (E-N)",BASEGEOGCRS["RDN2008",DATUM["Rete Dinamica Nazionale 2008",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",6706]],CONVERSION["Italy zone 12",METHOD["Transverse Mercator",ID["EPSG",9807]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",12,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["Scale factor at natural origin",1,SCALEUNIT["unity",1],ID["EPSG",8805]],PARAMETER["False easting",3000000,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["GIS."],AREA["Italy - onshore and offshore."],BBOX[34.76,5.93,47.1,18.99]],ID["EPSG",7795]]
+ +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=3000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
+ 28983
+ 7795
+ EPSG:7795
+ RDN2008 / Zone 12 (E-N)
+ tmerc
+ EPSG:7019
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - _b77c4719_2bc1_4053_909c_22696cf6b36f
+ - _a5a62408_edf3_4c07_a266_0e8ae6642517
+ - polygons_230543b7_f804_47e5_b8de_d036f2c701af
+
+
+
+
+
+
+
+
+
+
+ meters
+
+ 2979568.46200513048097491
+ 5021635.56376456003636122
+ 3004395.00796651048585773
+ 5057667.48873566370457411
+
+ 0
+
+
+ PROJCRS["RDN2008 / Zone 12 (E-N)",BASEGEOGCRS["RDN2008",DATUM["Rete Dinamica Nazionale 2008",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",6706]],CONVERSION["Italy zone 12",METHOD["Transverse Mercator",ID["EPSG",9807]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",12,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["Scale factor at natural origin",1,SCALEUNIT["unity",1],ID["EPSG",8805]],PARAMETER["False easting",3000000,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["GIS."],AREA["Italy - onshore and offshore."],BBOX[34.76,5.93,47.1,18.99]],ID["EPSG",7795]]
+ +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=3000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
+ 28983
+ 7795
+ EPSG:7795
+ RDN2008 / Zone 12 (E-N)
+ tmerc
+ EPSG:7019
+ false
+
+
+ 0
+
+
+
+
+
+
+ degrees
+
+ 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
+ 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
+ -179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
+ -179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
+
+ 0
+
+
+ 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
+
+
+ 0
+
+
+
+ Annotations_24fde7a2_fc57_4f56_bc0e_dfe47acc7b8b
+
+
+
+
+ Annotations
+
+
+ PROJCRS["RDN2008 / Zone 12 (E-N)",BASEGEOGCRS["RDN2008",DATUM["Rete Dinamica Nazionale 2008",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",6706]],CONVERSION["Italy zone 12",METHOD["Transverse Mercator",ID["EPSG",9807]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",12,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["Scale factor at natural origin",1,SCALEUNIT["unity",1],ID["EPSG",8805]],PARAMETER["False easting",3000000,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["GIS."],AREA["Italy - onshore and offshore."],BBOX[34.76,5.93,47.1,18.99]],ID["EPSG",7795]]
+ +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=3000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
+ 28983
+ 7795
+ EPSG:7795
+ RDN2008 / Zone 12 (E-N)
+ tmerc
+ EPSG:7019
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+
+
+
+
+ false
+
+
+
+
+
+
+ 1
+ 1
+ 1
+ 0
+
+
+
+
+ 1
+ 0
+
+
+
+
+
+
+ -20037508.34278924390673637
+ -20037508.34278924763202667
+ 20037508.34278924390673637
+ 20037508.34278924763202667
+
+
+ -180
+ -85.05112877980660357
+ 179.99999999999997158
+ 85.05112877980660357
+
+ _b77c4719_2bc1_4053_909c_22696cf6b36f
+ type=xyz&url=https://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png&zmax=19&zmin=0
+ 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
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+ 0
+ 255
+ 255
+
+
+
+
+
+
+ EPSG:7019
+
+
+ m2
+ meters
+
+
+ 5
+ 2.5
+ false
+ false
+ false
+ 1
+ 0
+ false
+ false
+ true
+ 0
+ 255,0,0,255
+
+
+ false
+
+
+ true
+ 2
+
+ false
+
+ 1
+
+
+
+ lizmap_repository
+ lizmap_user
+ lizmap_user_groups
+
+
+ canazei
+
+
+
+
+
+
+
+
+
+
+
+
+
+ None
+ false
+ true
+
+
+
+
+
+ 1
+
+ 2991840.67219999991357327
+ 5039241.28689999971538782
+ 2993324.62399999983608723
+ 5039937.12959999963641167
+
+ false
+ conditions unknown
+ 90
+
+
+
+ 1
+
+ 8
+ opacity_embed
+ false
+
+ true
+ opacity_embed
+ 0
+
+ false
+
+
+
+
+
+
+
+ false
+
+
+
+
+ false
+
+ 5000
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Riccardo Beltrami
+ 2024-11-11T12:42:42
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PROJCRS["RDN2008 / Zone 12 (E-N)",BASEGEOGCRS["RDN2008",DATUM["Rete Dinamica Nazionale 2008",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",6706]],CONVERSION["Italy zone 12",METHOD["Transverse Mercator",ID["EPSG",9807]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",12,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["Scale factor at natural origin",1,SCALEUNIT["unity",1],ID["EPSG",8805]],PARAMETER["False easting",3000000,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["GIS."],AREA["Italy - onshore and offshore."],BBOX[34.76,5.93,47.1,18.99]],ID["EPSG",7795]]
+ +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=3000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
+ 28983
+ 7795
+ EPSG:7795
+ RDN2008 / Zone 12 (E-N)
+ tmerc
+ EPSG:7019
+ 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/units/classes/Project/Ressources/opacity_embed.qgs.cfg b/tests/units/classes/Project/Ressources/opacity_embed.qgs.cfg
new file mode 100644
index 0000000000..70e92bf518
--- /dev/null
+++ b/tests/units/classes/Project/Ressources/opacity_embed.qgs.cfg
@@ -0,0 +1,219 @@
+{
+ "metadata": {
+ "qgis_desktop_version": 33403,
+ "lizmap_plugin_version_str": "4.4.2",
+ "lizmap_plugin_version": 40402,
+ "lizmap_web_client_target_version": 30800,
+ "lizmap_web_client_target_status": "Stable",
+ "instance_target_url": "https://lizmapdemo.faunalia.eu/",
+ "instance_target_repository": "canazei"
+ },
+ "warnings": {},
+ "debug": {
+ "total_time": 0.10200000000000001
+ },
+ "options": {
+ "projection": {
+ "proj4": "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=3000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
+ "ref": "EPSG:7795"
+ },
+ "bbox": [
+ "2991840.67219999991357327",
+ "5039241.28689999971538782",
+ "2993324.62399999983608723",
+ "5039937.12959999963641167"
+ ],
+ "mapScales": [
+ 1,
+ 1000000000
+ ],
+ "minScale": 1,
+ "maxScale": 1000000000,
+ "use_native_zoom_levels": true,
+ "hide_numeric_scale_value": false,
+ "initialExtent": [
+ 2991840.6722,
+ 5039241.2869,
+ 2993324.624,
+ 5039937.1296
+ ],
+ "popupLocation": "dock",
+ "pointTolerance": 25,
+ "lineTolerance": 10,
+ "polygonTolerance": 5,
+ "automatic_permalink": true,
+ "tmTimeFrameSize": 10,
+ "tmTimeFrameType": "seconds",
+ "tmAnimationFrameLength": 1000,
+ "datavizLocation": "dock",
+ "theme": "dark",
+ "fixed_scale_overview_map": true,
+ "dataviz_drag_drop": []
+ },
+ "layers": {
+ "polygons": {
+ "id": "polygons_230543b7_f804_47e5_b8de_d036f2c701af",
+ "name": "polygons",
+ "type": "layer",
+ "geometryType": "polygon",
+ "extent": [
+ 1302946.5973175922,
+ 5668669.93486476,
+ 1326343.9171356568,
+ 5691646.433028096
+ ],
+ "crs": "EPSG:3857",
+ "title": "polygons",
+ "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
+ },
+ "Fabbricati": {
+ "id": "_a5a62408_edf3_4c07_a266_0e8ae6642517",
+ "name": "Fabbricati",
+ "type": "layer",
+ "extent": [
+ 2.0,
+ 33.0,
+ 19.0,
+ 48.0
+ ],
+ "crs": "EPSG:6706",
+ "title": "Fabbricati",
+ "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",
+ "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
+ },
+ "OpenStreetMap": {
+ "id": "_b77c4719_2bc1_4053_909c_22696cf6b36f",
+ "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": {},
+ "tooltipLayers": {},
+ "editionLayers": {},
+ "layouts": {
+ "config": {
+ "default_popup_print": false
+ },
+ "list": [
+ {
+ "layout": "testt",
+ "enabled": true,
+ "formats_available": [
+ "pdf"
+ ],
+ "default_format": "pdf",
+ "dpi_available": [
+ "100"
+ ],
+ "default_dpi": "100"
+ }
+ ]
+ },
+ "loginFilteredLayers": {},
+ "timemanagerLayers": {},
+ "datavizLayers": {},
+ "filter_by_polygon": {
+ "config": {
+ "polygon_layer_id": "polygons_230543b7_f804_47e5_b8de_d036f2c701af",
+ "group_field": "",
+ "filter_by_user": false
+ },
+ "layers": []
+ },
+ "formFilterLayers": {}
+}
diff --git a/tests/units/classes/Project/Ressources/opacity_source.qgs b/tests/units/classes/Project/Ressources/opacity_source.qgs
new file mode 100644
index 0000000000..b59bf5594d
--- /dev/null
+++ b/tests/units/classes/Project/Ressources/opacity_source.qgs
@@ -0,0 +1,1466 @@
+
+
+
+
+
+
+
+
+ PROJCRS["RDN2008 / Zone 12 (E-N)",BASEGEOGCRS["RDN2008",DATUM["Rete Dinamica Nazionale 2008",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",6706]],CONVERSION["Italy zone 12",METHOD["Transverse Mercator",ID["EPSG",9807]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",12,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["Scale factor at natural origin",1,SCALEUNIT["unity",1],ID["EPSG",8805]],PARAMETER["False easting",3000000,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["GIS."],AREA["Italy - onshore and offshore."],BBOX[34.76,5.93,47.1,18.99]],ID["EPSG",7795]]
+ +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=3000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
+ 28983
+ 7795
+ EPSG:7795
+ RDN2008 / Zone 12 (E-N)
+ tmerc
+ EPSG:7019
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - _a2444ae9_f82b_4d70_a2d4_51005e60aa23
+ - _a5a62408_edf3_4c07_a266_0e8ae6642517
+ - polygons_230543b7_f804_47e5_b8de_d036f2c701af
+
+
+
+
+
+
+
+
+
+
+ meters
+
+ 2970487.40046632988378406
+ 5021644.22223270405083895
+ 3006102.24341750843450427
+ 5038318.42819864023476839
+
+ 0
+
+
+ PROJCRS["RDN2008 / Zone 12 (E-N)",BASEGEOGCRS["RDN2008",DATUM["Rete Dinamica Nazionale 2008",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",6706]],CONVERSION["Italy zone 12",METHOD["Transverse Mercator",ID["EPSG",9807]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",12,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["Scale factor at natural origin",1,SCALEUNIT["unity",1],ID["EPSG",8805]],PARAMETER["False easting",3000000,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["GIS."],AREA["Italy - onshore and offshore."],BBOX[34.76,5.93,47.1,18.99]],ID["EPSG",7795]]
+ +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=3000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
+ 28983
+ 7795
+ EPSG:7795
+ RDN2008 / Zone 12 (E-N)
+ tmerc
+ EPSG:7019
+ false
+
+
+ 0
+
+
+
+
+
+
+ Annotations_56205d67_9b71_4def_bd44_21286e37fa24
+
+
+
+
+ Annotations
+
+
+ PROJCRS["RDN2008 / Zone 12 (E-N)",BASEGEOGCRS["RDN2008",DATUM["Rete Dinamica Nazionale 2008",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",6706]],CONVERSION["Italy zone 12",METHOD["Transverse Mercator",ID["EPSG",9807]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",12,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["Scale factor at natural origin",1,SCALEUNIT["unity",1],ID["EPSG",8805]],PARAMETER["False easting",3000000,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["GIS."],AREA["Italy - onshore and offshore."],BBOX[34.76,5.93,47.1,18.99]],ID["EPSG",7795]]
+ +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=3000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
+ 28983
+ 7795
+ EPSG:7795
+ RDN2008 / Zone 12 (E-N)
+ tmerc
+ EPSG:7019
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+
+
+
+
+ false
+
+
+
+
+
+
+ 1
+ 1
+ 1
+ 0
+
+
+
+
+ 1
+ 0
+
+
+
+
+
+ -20037508.34278924390673637
+ -20037508.34278924763202667
+ 20037508.34278924390673637
+ 20037508.34278924763202667
+
+
+ -180
+ -85.05112877980660357
+ 179.99999999999997158
+ 85.05112877980660357
+
+ _a2444ae9_f82b_4d70_a2d4_51005e60aa23
+ crs=EPSG:3857&format&type=xyz&url=https://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png&zmax=19&zmin=0
+ 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
+
+
+
+ 2
+ 33
+ 19
+ 48
+
+
+ 2
+ 33
+ 19.00000000000001066
+ 47.99999999999990763
+
+ _a5a62408_edf3_4c07_a266_0e8ae6642517
+ crs=EPSG:6706&dpiMode=7&format=image/png&layers=fabbricati&styles&tilePixelRatio=0&url=https://wms.cartografia.agenziaentrate.gov.it/inspire/wms/ows01.php
+ Fabbricati
+
+
+
+ Fabbricati
+
+
+ GEOGCRS["RDN2008",DATUM["Rete Dinamica Nazionale 2008",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],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["Italy - onshore and offshore; San Marino, Vatican City State."],BBOX[34.76,5.93,47.1,18.99]],ID["EPSG",6706]]
+ +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs
+ 28327
+ 6706
+ EPSG:6706
+ RDN2008
+ longlat
+ EPSG:7019
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+ wms
+
+
+
+
+
+
+
+
+ 1
+ 1
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ None
+ WholeRaster
+ Estimated
+ 0.02
+ 0.98
+ 2
+
+
+
+
+
+ resamplingFilter
+
+ 0
+
+
+
+ 1302946.59731759224087
+ 5668669.934864760376513
+ 1326343.91713565681129694
+ 5691646.4330280963331461
+
+
+ 11.70456842761916505
+ 45.29870650387783826
+ 11.91475012761919317
+ 45.44370559316338642
+
+ polygons_230543b7_f804_47e5_b8de_d036f2c701af
+ ./filter_layer_data_by_polygon_for_groups/polygons.shp
+ polygons
+
+
+
+ polygons
+
+
+ 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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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
+
+
+
+
+
+
+
+
+
+
+
+
+ ogr
+
+
+
+
+
+
+
+
+
+
+ 1
+ 1
+ 1
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+ 0
+ generatedlayout
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "name"
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+ 255
+ 255
+ 255
+ 255
+ 0
+ 255
+ 255
+
+
+
+
+
+
+ EPSG:7019
+
+
+ m2
+ meters
+
+
+ 5
+ 2.5
+ false
+ false
+ false
+ 1
+ 0
+ false
+ false
+ true
+ 0
+ 255,0,0,255
+
+
+ false
+
+
+ true
+ 2
+
+ false
+
+ 1
+
+
+
+ lizmap_repository
+ lizmap_user
+ lizmap_user_groups
+
+
+ canazei
+
+
+
+
+
+
+
+
+
+
+
+
+
+ None
+ false
+ true
+
+
+
+
+
+ 1
+
+ 2991840.67219999991357327
+ 5039241.28689999971538782
+ 2993324.62399999983608723
+ 5039937.12959999963641167
+
+ false
+ conditions unknown
+ 90
+
+
+
+ 1
+
+ 8
+ opacity_source
+ false
+
+ false
+ opacity_source
+ 0
+
+ false
+
+
+
+
+
+
+
+ false
+
+
+
+
+ false
+
+ 5000
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Riccardo Beltrami
+ 2024-11-11T12:22:05
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PROJCRS["RDN2008 / Zone 12 (E-N)",BASEGEOGCRS["RDN2008",DATUM["Rete Dinamica Nazionale 2008",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",6706]],CONVERSION["Italy zone 12",METHOD["Transverse Mercator",ID["EPSG",9807]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",12,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["Scale factor at natural origin",1,SCALEUNIT["unity",1],ID["EPSG",8805]],PARAMETER["False easting",3000000,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["GIS."],AREA["Italy - onshore and offshore."],BBOX[34.76,5.93,47.1,18.99]],ID["EPSG",7795]]
+ +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=3000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
+ 28983
+ 7795
+ EPSG:7795
+ RDN2008 / Zone 12 (E-N)
+ tmerc
+ EPSG:7019
+ 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/units/classes/Project/Ressources/opacity_source.qgs.cfg b/tests/units/classes/Project/Ressources/opacity_source.qgs.cfg
new file mode 100644
index 0000000000..4327a31bf5
--- /dev/null
+++ b/tests/units/classes/Project/Ressources/opacity_source.qgs.cfg
@@ -0,0 +1,219 @@
+{
+ "metadata": {
+ "qgis_desktop_version": 33403,
+ "lizmap_plugin_version_str": "4.4.2",
+ "lizmap_plugin_version": 40402,
+ "lizmap_web_client_target_version": 30800,
+ "lizmap_web_client_target_status": "Stable",
+ "instance_target_url": "https://lizmapdemo.faunalia.eu/",
+ "instance_target_repository": "canazei"
+ },
+ "warnings": {},
+ "debug": {
+ "total_time": 0
+ },
+ "options": {
+ "projection": {
+ "proj4": "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=3000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
+ "ref": "EPSG:7795"
+ },
+ "bbox": [
+ "2991840.67219999991357327",
+ "5039241.28689999971538782",
+ "2993324.62399999983608723",
+ "5039937.12959999963641167"
+ ],
+ "mapScales": [
+ 1,
+ 1000000000
+ ],
+ "minScale": 1,
+ "maxScale": 1000000000,
+ "use_native_zoom_levels": true,
+ "hide_numeric_scale_value": false,
+ "initialExtent": [
+ 2991840.6722,
+ 5039241.2869,
+ 2993324.624,
+ 5039937.1296
+ ],
+ "popupLocation": "dock",
+ "pointTolerance": 25,
+ "lineTolerance": 10,
+ "polygonTolerance": 5,
+ "automatic_permalink": true,
+ "tmTimeFrameSize": 10,
+ "tmTimeFrameType": "seconds",
+ "tmAnimationFrameLength": 1000,
+ "datavizLocation": "dock",
+ "theme": "dark",
+ "fixed_scale_overview_map": true,
+ "dataviz_drag_drop": []
+ },
+ "layers": {
+ "polygons": {
+ "id": "polygons_230543b7_f804_47e5_b8de_d036f2c701af",
+ "name": "polygons",
+ "type": "layer",
+ "geometryType": "polygon",
+ "extent": [
+ 416354.4989291718,
+ 5394257.51030597,
+ 439751.8187472364,
+ 5417234.008469306
+ ],
+ "crs": "EPSG:3857",
+ "title": "polygons",
+ "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
+ },
+ "Fabbricati": {
+ "id": "_a5a62408_edf3_4c07_a266_0e8ae6642517",
+ "name": "Fabbricati",
+ "type": "layer",
+ "extent": [
+ 2.0,
+ 33.0,
+ 19.0,
+ 48.0
+ ],
+ "crs": "EPSG:6706",
+ "title": "Fabbricati",
+ "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",
+ "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
+ },
+ "OpenStreetMap": {
+ "id": "_a2444ae9_f82b_4d70_a2d4_51005e60aa23",
+ "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": {},
+ "tooltipLayers": {},
+ "editionLayers": {},
+ "layouts": {
+ "config": {
+ "default_popup_print": false
+ },
+ "list": [
+ {
+ "layout": "test",
+ "enabled": true,
+ "formats_available": [
+ "pdf"
+ ],
+ "default_format": "pdf",
+ "dpi_available": [
+ "100"
+ ],
+ "default_dpi": "100"
+ }
+ ]
+ },
+ "loginFilteredLayers": {},
+ "timemanagerLayers": {},
+ "datavizLayers": {},
+ "filter_by_polygon": {
+ "config": {
+ "polygon_layer_id": "polygons_230543b7_f804_47e5_b8de_d036f2c701af",
+ "group_field": "",
+ "filter_by_user": false
+ },
+ "layers": []
+ },
+ "formFilterLayers": {}
+}