/** * Creates a new default Kml Style with a specified ID (given as an attribute value in the * start tag) and assigns specific elements read from the XmlPullParser to the Style. A new * style is not created if it does not have an ID. */ private static void setContainerStyle(XmlPullParser parser, HashMap<String, KmlStyle> containerStyles) throws XmlPullParserException, IOException { if (parser.getAttributeValue(null, "id") != null) { KmlStyle style = KmlStyleParser.createStyle(parser); String styleId = style.getStyleId(); containerStyles.put(styleId, style); } }
mStyles.put(style.getStyleId(), style);
public void testStyleId() throws Exception { KmlStyle kmlStyle = new KmlStyle(); kmlStyle.setStyleId("BlueLine"); assertEquals("BlueLine", kmlStyle.getStyleId()); }