-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UX - Disable panel when the layer is excluded from WMS
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
__copyright__ = 'Copyright 2023, 3Liz' | ||
__license__ = 'GPL version 3' | ||
__email__ = '[email protected]' | ||
|
||
from qgis.core import QgsProject | ||
|
||
|
||
def is_layer_wms_excluded(project: QgsProject, name: str) -> bool: | ||
""" Is the layer excluded from WMS. | ||
Project properties → QGIS server → WMS → Exclude layers | ||
""" | ||
server_wms_excluded_list, server_exclude = project.readListEntry('WMSRestrictedLayers', '') | ||
return server_exclude and name in server_wms_excluded_list |