本文整理汇总了Java中com.google.android.gms.maps.model.Marker.showInfoWindow方法的典型用法代码示例。如果您正苦于以下问题:Java Marker.showInfoWindow方法的具体用法?Java Marker.showInfoWindow怎么用?Java Marker.showInfoWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.maps.model.Marker
的用法示例。
在下文中一共展示了Marker.showInfoWindow方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onClusterItemClick
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
@Override
public boolean onClusterItemClick(Station station) {
Location stationLocation = new Location("");
stationLocation.setLatitude(Double.parseDouble(station.getLatitude()));
stationLocation.setLongitude(Double.parseDouble(station.getLongitude()));
Object[] markers = clusterManager.getMarkerCollection().getMarkers().toArray();
for (Object m : markers) {
if (m instanceof Marker) {
Marker mark = (Marker) m;
Location location = new Location("");
location.setLatitude(mark.getPosition().latitude);
location.setLongitude(mark.getPosition().longitude);
if (location.distanceTo(stationLocation) == 0) {
map.animateCamera(CameraUpdateFactory.newLatLng(station.getPosition()));
mark.setTitle(gson.toJson(station));
mark.showInfoWindow();
return true;
}
}
}
return false;
}
示例2: moveCameraToPosition
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
private void moveCameraToPosition(LatLng position) {
if (position == null)
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(SSN_COLLEGE.getCenter(), 17));
else {
Marker marker = googleMap.addMarker(new MarkerOptions()
.position(position)
.title(location));
marker.showInfoWindow();
googleMap.moveCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition.Builder()
.target(position).zoom(18).build()));
}
}
示例3: onMarkerDragEnd
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
@Override
public void onMarkerDragEnd(Marker marker) {
LatLng latLng = marker.getPosition();
marker.setSnippet(ProjFuncs.latLng2DString(latLng, false));
marker.showInfoWindow();
mMaps.get(MAP_CODE_MAIN).animateCamera(CameraUpdateFactory.newLatLng(latLng));
}
示例4: onMapReady
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
@Override
public void onMapReady(GoogleMap googleMap) {
Marker marker = googleMap.addMarker(new MarkerOptions().position(location)
.title(descriptionString));
marker.showInfoWindow();
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(location, 20));
}
示例5: collectLocationsAndPutOnMap
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
private void collectLocationsAndPutOnMap(Map<String, Object> servings) {
//iterate through each user, ignoring their UID
for (Map.Entry<String, Object> entry : servings.entrySet()) {
//Get user map
singleUser = (Map) entry.getValue();
//Get phone field and append to list
latitudes.add((Double) singleUser.get("latitude"));
longitudes.add((Double) singleUser.get("longitude"));
keys.add((String) singleUser.get("key"));
userIds.add((String) singleUser.get("userId"));
//amount.add((Double) singleUser.get("price"));
titles.add((String) singleUser.get("title"));
}
for (int i = 0; i < latitudes.size(); i++) {
LatLng aLocation = new LatLng(
latitudes.get(i), longitudes.get(i)
);
BitmapDrawable bitmapdraw=(BitmapDrawable)getResources().getDrawable(R.drawable.wii);
Bitmap b=bitmapdraw.getBitmap();
Bitmap smallMarker = Bitmap.createScaledBitmap(b, 150, 150, false);
Marker marker = googleMap.addMarker(new MarkerOptions()
.position(aLocation)
.title(titles.get(i))
.icon(BitmapDescriptorFactory.
fromBitmap(smallMarker))
);
marker.setTag(keys.get(i));
marker.showInfoWindow();
/*googleMap.addMarker(new MarkerOptions()
.position(new LatLng(
20, -25))
.title("fake location"));*/
}
}