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

Option to not publish WMS layers #67

Open
JakobMiksch opened this issue Aug 5, 2024 · 0 comments
Open

Option to not publish WMS layers #67

JakobMiksch opened this issue Aug 5, 2024 · 0 comments

Comments

@JakobMiksch
Copy link
Contributor

  • related to Publish added vector layers as WFS in QGIS Server #64
  • layers are automatically published by QGIS Server
  • sometimes it is wished to not publish a layer (for example when one uses a basemap layer just orientation during project setup)
  • it would be great to have an endpoint to chose which layers shall not be published via WMS

some hopefully useful Python snippets:

hidden_wms_layers, ok = QgsProject.instance().readListEntry('WMSRestrictedLayers', '/')
print('hidden_wms_layers', hidden_wms_layers)

# do not show any WMS layers
QgsProject.instance().writeEntry( "WMSRestrictedLayers" , "/", [])
QgsProject.instance().write()

# publish only one WMS layer

# NOTE: the provided layer is the human readable name not the long autogenerated name
QgsProject.instance().writeEntry( "WMSRestrictedLayers" , "/", ['layer-name'])
QgsProject.instance().write()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant