+ with open('view/kml.styles.json') as kml_styles:
+ styles:Dict[str,Dict] = json.load(kml_styles)
+ for key, value in styles.items():
+ # add style
+ style = ET.Element("Style",{"id":key})
+ line_style = ET.SubElement(style, "LineStyle")
+ color = ET.SubElement(line_style, "color")
+ color.text = value['stroke']['color']
+ width = ET.SubElement(line_style, "width")
+ width.text = value['stroke']['width']
+ poly_style = ET.SubElement(style, "PolyStyle")
+ fill = ET.SubElement(poly_style, "color")
+ fill.text = value['fill']['color']
+ root.findall(".//Document")[0].append(style)
+