/** * Sets a marker info window if no <text> tag was found in the KML document. This method sets * the marker title as the text found in the <name> start tag and the snippet as <description> * * @param style Style to apply */ private void setMarkerInfoWindow(KmlStyle style, Marker marker, final KmlPlacemark placemark) { boolean hasName = placemark.hasProperty("name"); boolean hasDescription = placemark.hasProperty("description"); boolean hasBalloonOptions = style.hasBalloonStyle(); boolean hasBalloonText = style.getBalloonOptions().containsKey("text"); if (hasBalloonOptions && hasBalloonText) { marker.setTitle(style.getBalloonOptions().get("text")); createInfoWindow(); } else if (hasBalloonOptions && hasName) { marker.setTitle(placemark.getProperty("name")); createInfoWindow(); } else if (hasName && hasDescription) { marker.setTitle(placemark.getProperty("name")); marker.setSnippet(placemark.getProperty("description")); createInfoWindow(); } else if (hasDescription) { marker.setTitle(placemark.getProperty("description")); createInfoWindow(); } else if (hasName) { marker.setTitle(placemark.getProperty("name")); createInfoWindow(); } }
public void setSnippet(String snippet) { if (marker != null) { marker.setSnippet(snippet); } else { markerOptions.snippet(snippet); } }
for (Map.Entry<Marker, BikeRentalStationInfo> entry : mBikeRentalStations.entrySet()) { if (entry.getKey().getTitle().equals(bikeRentalStation.name)) { entry.getKey().setSnippet(getResources() .getString(R.string.map_markers_bike_rental_available_bikes) + " " + bikeRentalStation.bikesAvailable + " | " + getResources()
/** * Sets a marker info window if no <text> tag was found in the KML document. This method sets * the marker title as the text found in the <name> start tag and the snippet as <description> * * @param style Style to apply */ private void setMarkerInfoWindow(KmlStyle style, Marker marker, final KmlPlacemark placemark) { boolean hasName = placemark.hasProperty("name"); boolean hasDescription = placemark.hasProperty("description"); boolean hasBalloonOptions = style.hasBalloonStyle(); boolean hasBalloonText = style.getBalloonOptions().containsKey("text"); if (hasBalloonOptions && hasBalloonText) { marker.setTitle(style.getBalloonOptions().get("text")); createInfoWindow(); } else if (hasBalloonOptions && hasName) { marker.setTitle(placemark.getProperty("name")); createInfoWindow(); } else if (hasName && hasDescription) { marker.setTitle(placemark.getProperty("name")); marker.setSnippet(placemark.getProperty("description")); createInfoWindow(); } else if (hasDescription) { marker.setTitle(placemark.getProperty("description")); createInfoWindow(); } }