I want to addd a Layer and give the layer a color for the border and for the filling. With the code below i am possible to achieve a color for the border, but a did not found a solution to give a color for the filling. In addition, is it possible to change the width of the border line?
uri.setDataSource("shema_name", "layer_name", "geom","","layer_name_id")
lyr = QgsVectorLayer(uri.uri(), "layer_name_you_like", "postgres")
props = { 'color_border' : '255,165,0,125', 'style' : 'no', 'style_border' : 'solid' }
s = QgsFillSymbolV2.createSimple(props)
lyr.setRendererV2( QgsSingleSymbolRendererV2( s ) )
QgsMapLayerRegistry.instance().addMapLayer(lyr)
No comments:
Post a Comment