/** * Assigns icons to markers with a url if put in a placemark tag that is nested in a folder. * * @param iconUrl url to obtain marker image * @param kmlContainers kml container which contains the marker */ private void addContainerGroupIconsToMarkers(String iconUrl, Iterable<KmlContainer> kmlContainers) { for (KmlContainer container : kmlContainers) { addIconToMarkers(iconUrl, container.getPlacemarksHashMap()); if (container.hasContainers()) { addContainerGroupIconsToMarkers(iconUrl, container.getContainers()); } } }
/** * Adds ground overlays in containers from a given URL onto the map * * @param groundOverlayUrl url of ground overlay * @param kmlContainers containers containing ground overlays to add to the map */ private void addGroundOverlayInContainerGroups(String groundOverlayUrl, Iterable<KmlContainer> kmlContainers, boolean containerVisibility) { for (KmlContainer container : kmlContainers) { boolean isContainerVisible = getContainerVisibility(container, containerVisibility); addGroundOverlayToMap(groundOverlayUrl, container.getGroundOverlayHashMap(), isContainerVisible); if (container.hasContainers()) { addGroundOverlayInContainerGroups(groundOverlayUrl, container.getContainers(), isContainerVisible); } } }
public void testContainerHeirarchy() throws Exception { XmlPullParser parser = createParser(com.google.maps.android.test.R.raw.amu_document_nest); KmlParser mParser = new KmlParser(parser); mParser.parseKml(); assertEquals(mParser.getContainers().get(0).getContainerId(), "hasId"); assertEquals(mParser.getContainers().size(), 1); assertTrue(mParser.getContainers().get(0).hasContainers()); }
/** * Adds placemarks with their corresponding styles onto the map * * @param kmlContainers An arraylist of folders */ private void addContainerGroupToMap(Iterable<KmlContainer> kmlContainers, boolean containerVisibility) { for (KmlContainer container : kmlContainers) { boolean isContainerVisible = getContainerVisibility(container, containerVisibility); if (container.getStyles() != null) { // Stores all found styles from the container putStyles(container.getStyles()); } if (container.getStyleMap() != null) { // Stores all found style maps from the container super.assignStyleMap(container.getStyleMap(), getStylesRenderer()); } addContainerObjectToMap(container, isContainerVisible); if (container.hasContainers()) { addContainerGroupToMap(container.getContainers(), isContainerVisible); } } }