Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Load layers as single WMS layer #3947

Merged
merged 6 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions assets/src/legacy/switcher-layers-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,24 +150,26 @@ var lizLayerActionButtons = function() {
html+= '</dd>';
}
}

// Opacity
html+= ' <dt>'+lizDict['layer.metadata.opacity.title']+'</dt>';
html+= '<dd>';
html+= '<input type="hidden" class="opacityLayer '+isBaselayer+'" value="'+aName+'">';

const currentOpacity = lizMap.mainLizmap.state.layersAndGroupsCollection.getLayerOrGroupByName(aName).opacity;
var opacities = lizMap.config.options.layersOpacities;
if(typeof opacities === 'undefined') {
opacities = [0.2, 0.4, 0.6, 0.8, 1];
}
for ( var i=0, len=opacities.length; i<len; i++ ) {
var oactive = '';
if(currentOpacity == opacities[i])
oactive = 'active';
html+= '<a href="#" class="btn btn-mini btn-opacity-layer '+ oactive+' '+ opacities[i]*100+'">'+opacities[i]*100+'</a>';
const currentLayerState = lizMap.mainLizmap.state.rootMapGroup.getMapLayerByName(aName);
if (!currentLayerState.singleWMSLayer) {
html+= ' <dt>'+lizDict['layer.metadata.opacity.title']+'</dt>';
html+= '<dd>';
html+= '<input type="hidden" class="opacityLayer '+isBaselayer+'" value="'+aName+'">';

const currentOpacity = lizMap.mainLizmap.state.layersAndGroupsCollection.getLayerOrGroupByName(aName).opacity;
var opacities = lizMap.config.options.layersOpacities;
if (typeof opacities === 'undefined') {
opacities = [0.2, 0.4, 0.6, 0.8, 1];
}
for ( var i=0, len=opacities.length; i<len; i++ ) {
var oactive = '';
if(currentOpacity == opacities[i])
oactive = 'active';
html+= '<a href="#" class="btn btn-mini btn-opacity-layer '+ oactive+' '+ opacities[i]*100+'">'+opacities[i]*100+'</a>';
}
html+= '</dd>';
}
html+= '</dd>';

// Export
if ( 'exportLayers' in lizMap.config.options
Expand Down
1 change: 0 additions & 1 deletion assets/src/modules/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ export class Config {
throw new ValidationError('No `' + prop + '` in the WMS Capabilities!');
}
}

this._theConfig = theConfig;
this._theWmsCapabilities = theWmsCapabilities;

Expand Down
Loading
Loading