Android onMarkerClick函数和设置相机动画
我正在使用MAPV2。我想在用户单击标记时用动画更改相机位置 但当我使用下面的功能并单击一个标记时,该标记的标题不会显示! (只要把相机换好就行了)Android onMarkerClick函数和设置相机动画,android,google-maps,android-maps-v2,Android,Google Maps,Android Maps V2,我正在使用MAPV2。我想在用户单击标记时用动画更改相机位置 但当我使用下面的功能并单击一个标记时,该标记的标题不会显示! (只要把相机换好就行了) 只需添加v.showInfoWindow()到该代码,请发布您的答案。 @Override public boolean onMarkerClick(Marker v) { // TODO Auto-generated method stub CameraPosition cameraPosition = new
只需添加
v.showInfoWindow()代码>到该代码,请发布您的答案。
@Override
public boolean onMarkerClick(Marker v) {
// TODO Auto-generated method stub
CameraPosition cameraPosition = new CameraPosition.Builder()
.target(v.getPosition()) // Sets the center of the map to Mountain View
.zoom(13) // Sets the zoom
.bearing(45) // Sets the orientation of the camera to east
.tilt(10) // Sets the tilt of the camera to 30 degrees
.build(); // Creates a CameraPosition from the builder
googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
return true;
}