Example #1
0
def SetDefaultPolygonStyle(layer):
    ''' Polygon Symbol '''
    style = S.getDrawingPolygon()
    fill_sym = QgsFillSymbol.createSimple({'color': style['COLOR'],
                                           'outline_color': style['OUTLINE_COLOR'],
                                           'outline_style': style['OUTLINE_STYLE'],
                                           'outline_width': style['OUTLINE_WIDTH']})
    renderer = QgsSingleSymbolRenderer(fill_sym)
    layer.setRenderer(renderer)
    return
Example #2
0
def SetDefaultPolygonStyle(layer):
    """ Polygon Symbol """
    style = S.getDrawingPolygon()
    fill_sym = QgsFillSymbol.createSimple({
        "color":
        style["COLOR"],
        "outline_color":
        style["OUTLINE_COLOR"],
        "outline_style":
        style["OUTLINE_STYLE"],
        "outline_width":
        style["OUTLINE_WIDTH"],
    })
    renderer = QgsSingleSymbolRenderer(fill_sym)
    layer.setRenderer(renderer)