import axipy
from axipy import IndividualThematicLayer, Style

from LoadMiWor.ui.processTool.parserWor.ParserMiCommand.addInParsers import getSyleObjects

mi_str_style='Global Pen (2,2,255) Brush (3,0,65280) Symbol (35,0,12) Line (1,5,16711680) Font ("Tahoma",0,9,0)'
collet_style=getSyleObjects(mi_str_style)
map_view= axipy.gui.view_manager.active
layers=map_view.map.layers
layer_for_overStyle=layers[0]
brush=None
line=None
if collet_style['brush'] is not None or collet_style['pen'] is not None:
    brush=Style.from_mapinfo(collet_style['brush']+' '+collet_style['pen'])
if collet_style['line'] is not None:
    line=Style.from_mapinfo(collet_style['line'])
overStyle=axipy.da.CollectionStyle()
if brush is not None:

    overStyle.for_polygon(brush)
if line is not None:
    overStyle.for_line(line)
layer_for_overStyle.overrideStyle=overStyle
jkl=0
