我正在尝试将标记的信息窗口居中,因为它完全可见。有两个图像显示问题。在第一个信息窗口的标题是不可见的,在第二个图像上是它应该是什么样子。这是我的代码:
mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
@Override
public boolean onMarkerClick(final Marker marker) {
LatLng markerLocation = marker.getPosition();
Point mappoint = mMap.getProjection().toScreenLocation(new LatLng(markerLocation.latitude, markerLocation.longitude));
mappoint.set(mappoint.x, mappoint.y - 100);
CameraUpdate cu = CameraUpdateFactory.newLatLng(mMap.getProjection().fromScreenLocation(mappoint));
mMap.animateCamera(cu, new GoogleMap.CancelableCallback() {
@Override
public void onFinish() {
if (marker != null)
marker.showInfoWindow();
}
@Override
public void onCancel() {
}
});
return false;
}
});
答案 0 :(得分:0)
问题在于:
returning false;
应该是:
returning true;