本文整理了Java中com.google.android.gms.maps.model.Marker.setSnippet()
方法的一些代码示例,展示了Marker.setSnippet()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Marker.setSnippet()
方法的具体详情如下:
包路径:com.google.android.gms.maps.model.Marker
类名称:Marker
方法名:setSnippet
暂无
代码示例来源:origin: googlemaps/android-maps-utils
/**
* 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();
}
}
代码示例来源:origin: mg6maciej/android-maps-extensions
public void setSnippet(String snippet) {
if (marker != null) {
marker.setSnippet(snippet);
} else {
markerOptions.snippet(snippet);
}
}
代码示例来源:origin: CUTR-at-USF/OpenTripPlanner-for-Android
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()
代码示例来源:origin: wiglenet/wigle-wifi-wardriving
/**
* 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();
}
}
内容来源于网络,如有侵权,请联系作者删除!