public void addLayerToMap() { setLayerVisibility(true); mGroundOverlays = getGroundOverlayMap(); mContainers = getContainerList(); putStyles(); assignStyleMap(getStyleMaps(), getStylesRenderer()); addGroundOverlays(mGroundOverlays, mContainers); addContainerGroupToMap(mContainers, true); addPlacemarksToMap(getAllFeatures()); if (!mGroundOverlayImagesDownloaded) { downloadGroundOverlays(); } if (!mMarkerIconsDownloaded) { downloadMarkerIcons(); } }
/** * 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); } } }