qwc2 2025.5.0-7.1 → 2025.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qwc2",
3
- "version": "2025.05.07.1",
3
+ "version": "2025.05.07",
4
4
  "description": "QGIS Web Client",
5
5
  "author": "Sourcepole AG",
6
6
  "license": "BSD-2-Clause",
@@ -54,4 +54,4 @@ params.LAYERS.push("wfs:".concat(layer.url,"#").concat(layer.name));params.OPACI
54
54
  var printBgLayerName=printBackgroundLayer;if(Array.isArray(printBackgroundLayer)){printBgLayerName=null;for(var i=0;i<printBackgroundLayer.length;++i){printBgLayerName=printBackgroundLayer[i].name;if(printScale<=printBackgroundLayer[i].maxScale){break}}}if(printBgLayerName){var match=null;if((match=printBgLayerName.match(/^(\w+):(.*)#([^#]+)$/))&&match[1]==="wms"){if(printExternalLayers){var _backgroundLayer$opac;var layer={type:"wms",params:{LAYERS:match[3],OPACITIES:String((_backgroundLayer$opac=backgroundLayer.opacity)!==null&&_backgroundLayer$opac!==void 0?_backgroundLayer$opac:255),STYLES:""},url:match[2]};LayerUtils.addExternalLayerPrintParams(layer,params,printCrs,counterRef)}}else{var _backgroundLayer$opac2;params.LAYERS.push(printBgLayerName);params.OPACITIES.push(String((_backgroundLayer$opac2=backgroundLayer.opacity)!==null&&_backgroundLayer$opac2!==void 0?_backgroundLayer$opac2:255));params.COLORS.push("");params.STYLES.push("")}}}else if(printExternalLayers){// Inject client-side wms as external layer for print
55
55
  var items=backgroundLayer.type==="group"?backgroundLayer.items:[backgroundLayer];items.slice(0).reverse().forEach(function(layer){if(LayerUtils.layerScaleInRange(layer,printScale)){LayerUtils.addExternalLayerPrintParams(layer,params,printCrs,counterRef)}})}}params.LAYERS=params.LAYERS.reverse().join(",");params.OPACITIES=params.OPACITIES.reverse().join(",");params.COLORS=params.COLORS.reverse().join(",");params.STYLES=params.STYLES.reverse().join(",");return params},getTimeDimensionValues:function getTimeDimensionValues(layer){var result={names:new Set,values:new Set,attributes:{}};if(layer.visibility){(layer.dimensions||[]).forEach(function(dimension){if(dimension.units==="ISO8601"&&dimension.value){result.names.add(dimension.name);dimension.value.split(/,\s+/).filter(function(x){return x}).forEach(function(x){return result.values.add(x)});result.attributes[layer.name]=[dimension.fieldName,dimension.endFieldName]}})}(layer.sublayers||[]).forEach(function(sublayer){var sublayerResult=LayerUtils.getTimeDimensionValues(sublayer);sublayerResult.names.forEach(function(x){return result.names.add(x)});sublayerResult.values.forEach(function(x){return result.values.add(x)});result.attributes=_objectSpread(_objectSpread({},result.attributes),sublayerResult.attributes)});return result},getAttribution:function getAttribution(layer,map){var showThemeAttributionOnly=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var transformedMapBBoxes=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};if(layer.visibility===false||showThemeAttributionOnly&&layer.role!==LayerRole.THEME){return{}}var mapScale=MapUtils.computeForZoom(map.scales,map.zoom);if(!LayerUtils.layerScaleInRange(layer,mapScale)){return{}}if(layer.bbox&&layer.bbox.bounds){var layerCrs=layer.bbox.crs||map.projection;if(!transformedMapBBoxes[layerCrs]){transformedMapBBoxes[layerCrs]=CoordinatesUtils.reprojectBbox(map.bbox.bounds,map.projection,layerCrs)}var mapbbox=transformedMapBBoxes[layerCrs];var laybbox=layer.bbox.bounds;if(mapbbox[0]>laybbox[2]||mapbbox[2]<laybbox[0]||mapbbox[1]>laybbox[3]||mapbbox[3]<laybbox[1]){// Extents don't overlap
56
56
  return{}}}var copyrights={};if(layer.sublayers){Object.assign(copyrights,layer.sublayers.reduce(function(res,sublayer){return _objectSpread(_objectSpread({},res),LayerUtils.getAttribution(sublayer,map,false,transformedMapBBoxes))},{}))}else if(layer.type==="group"&&layer.items){Object.assign(copyrights,layer.items.reduce(function(res,sublayer){return _objectSpread(_objectSpread({},res),LayerUtils.getAttribution(sublayer,map,false,transformedMapBBoxes))},{}))}if(layer.attribution&&layer.attribution.Title){var key=layer.attribution.OnlineResource||layer.attribution.Title;copyrights[key]={title:layer.attribution.OnlineResource?layer.attribution.Title:null,layers:[].concat(_toConsumableArray((copyrights[key]||{}).layers||[]),[layer])}}return copyrights},recomputeLayerBBox:function recomputeLayerBBox(layer){if(isEmpty(layer.sublayers)){return layer}var bounds=null;var newlayer=_objectSpread({},layer);newlayer.sublayers=newlayer.sublayers.map(function(sublayer){sublayer=LayerUtils.recomputeLayerBBox(sublayer);if(!bounds&&sublayer.bbox&&sublayer.bbox.bounds){bounds=CoordinatesUtils.reprojectBbox(sublayer.bbox.bounds,sublayer.bbox.crs,"EPSG:4326")}else if(bounds&&sublayer.bbox&&sublayer.bbox.bounds){var sublayerbounds=CoordinatesUtils.reprojectBbox(sublayer.bbox.bounds,sublayer.bbox.crs,"EPSG:4326");bounds=[Math.min(bounds[0],sublayerbounds[0]),Math.min(bounds[1],sublayerbounds[1]),Math.max(bounds[2],sublayerbounds[2]),Math.max(bounds[3],sublayerbounds[3])]}return sublayer});if(bounds){newlayer.bbox={bounds:bounds,crs:"EPSG:4326"}}return newlayer},propagateLayerProperty:function propagateLayerProperty(newlayer,property,value){var path=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;Object.assign(newlayer,_defineProperty({},property,value));// Don't propagate visibility for mutually exclusive groups
57
- if(newlayer.sublayers&&!(property==="visibility"&&newlayer.mutuallyExclusive)){newlayer.sublayers=newlayer.sublayers.map(function(sublayer,idx){if(path===null||!isEmpty(path)&&path[0]===idx){var newsublayer=_objectSpread({},sublayer);LayerUtils.propagateLayerProperty(newsublayer,property,value,path?path.slice(1):null);return newsublayer}else{return sublayer}})}},getLayerRefreshInterval:function getLayerRefreshInterval(layer){var _layer$refreshInterva;var refreshInterval=(_layer$refreshInterva=layer.refreshInterval)!==null&&_layer$refreshInterva!==void 0?_layer$refreshInterva:0;(layer.sublayers||[]).forEach(function(sublayer){var sublayerRefreshInterval=LayerUtils.getLayerRefreshInterval(sublayer);if(sublayerRefreshInterval>0){refreshInterval=refreshInterval>0?Math.min(refreshInterval,sublayerRefreshInterval):sublayerRefreshInterval}});return refreshInterval}};export default LayerUtils;
57
+ if(newlayer.sublayers&&!(property==="visibility"&&newlayer.mutuallyExclusive)){newlayer.sublayers=newlayer.sublayers.map(function(sublayer,idx){if(path===null||!isEmpty(path)&&path[0]===idx){var newsublayer=_objectSpread({},sublayer);LayerUtils.propagateLayerProperty(newsublayer,property,value,path?path.slice(1):null);return newsublayer}else{return sublayer}})}}};export default LayerUtils;