/** * Sets relevant styling properties to the KmlStyle object that are found in the PolyStyle tag * Supported tags include color, outline, fill * * @param style Style object to add properties to */ private static void createPolyStyle(XmlPullParser parser, KmlStyle style) throws XmlPullParserException, IOException { int eventType = parser.getEventType(); while (!(eventType == END_TAG && parser.getName().equals("PolyStyle"))) { if (eventType == START_TAG) { if (parser.getName().equals(COLOR_STYLE_COLOR)) { style.setFillColor(parser.nextText()); } else if (parser.getName().equals(POLY_STYLE_OUTLINE)) { style.setOutline(KmlBoolean.parseBoolean(parser.nextText())); } else if (parser.getName().equals(POLY_STYLE_FILL)) { style.setFill(KmlBoolean.parseBoolean(parser.nextText())); } else if (parser.getName().equals(COLOR_STYLE_MODE)) { style.setPolyColorMode(parser.nextText()); } } eventType = parser.next(); } }