/** * Adds the marker icon stored in mMarkerIconCache, to the {@link com.google.android.gms.maps.model.Marker} * * @param iconUrl icon url of icon to add to markers * @param placemarks */ private void addIconToMarkers(String iconUrl, HashMap<KmlPlacemark, Object> placemarks) { for (Feature placemark : placemarks.keySet()) { KmlStyle urlStyle = getStylesRenderer().get(placemark.getId()); KmlStyle inlineStyle = ((KmlPlacemark) placemark).getInlineStyle(); if ("Point".equals(placemark.getGeometry().getGeometryType())) { boolean isInlineStyleIcon = inlineStyle != null && iconUrl .equals(inlineStyle.getIconUrl()); boolean isPlacemarkStyleIcon = urlStyle != null && iconUrl .equals(urlStyle.getIconUrl()); if (isInlineStyleIcon) { scaleBitmap(inlineStyle, placemarks, (KmlPlacemark) placemark); } else if (isPlacemarkStyleIcon) { scaleBitmap(urlStyle, placemarks, (KmlPlacemark) placemark); } } } }
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); } } }