[QGIS-Developer] Apply a preset (Layer Combination with style) in QGIS API
mathieu.rajerison at gmail.com
Mon Dec 11 07:23:58 PST 2017
I'm developing a plugin that, amongst other things, generates maps
I have two presets :
- one which is relative to the current map visualization, the standard one,
- and another one, which is relative to the atlas generation, embedding the
styles of masks, named "atlas"
Each preset checks a different combination of layers.
The problem is that I don't really know which class to use : I noticed the
QgsVisibilityPresetCollection class and used the method
applyPresetCheckedLegendNodesToLayer(presetName, layerId), but it doesn't
affect the layer panel, nor the layer styles.
Here, I want to apply the "main" preset to a layer named Cities
layerName = 'Cities'
layer = QgsMapLayerRegistry.instance().mapLayersByName(layerName)
Could you tell me how to achieve the preset selection ?
Any help would be appreciated,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the QGIS-Developer