I'm trying to make a wfs layer transparent, but it gives me a mistake, but I can't solve it until now.
thisThis is my code:
uri ='http://gstore.unm.edu/apps/rgis/datasets/6ca5428a-a78c-4c82-8120-da70dc92f2cc/services/ogc/wfs?SERVICE=wfs&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=tl_2010_35_state10'
wfslayer = QgsVectorLayer(uri, "MEXICO", "WFS")
QgsProject.instance().addMapLayer(wfslayer)
uri ='http://gstore.unm.edu/apps/rgis/datasets/6ca5428a-a78c-4c82-8120-da70dc92f2cc/services/ogc/wfs?SERVICE=wfs&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=tl_2010_35_state10'
wfslayer = QgsVectorLayer(uri, "MEXICO", "WFS")
QgsProject.instance().addMapLayer(wfslayer)
So far everything is correct
renderer = wfslayer.rendererV2()
renderer = wfslayer.rendererV2()
In this function it gives me the mistake I
I don't know if it's a problem with the version (QGisQGIS 3.16.2) of the program or with the code.
itIt no longer lets me put the rest of the code
symbol = renderer.symbol() symbol.setAlpha(0.5)
Thank you and best regards.
Oscar
symbol = renderer.symbol()
symbol.setAlpha(0.5)