单击标记时,摄像机的默认行为是将其置于屏幕中心,但由于我通常在信息窗口中有长文本描述,因此实际更改摄像机位置以使标记位于底部时更方便屏幕(使信息窗口位于屏幕中央).我想我应该能够通过覆盖onMarkerClick函数来做到这一点(当此函数返回true时,默认行为被取消)
@Override
public boolean onMarkerClick(final Marker marker) {
// Google sample code comment : We return false to indicate that we have not
// consumed the event and that we wish
// for the default behavior to occur (which is for the camera to move
// such that the
// marker is centered and for the marker's info window to open, if it
// has one).
marker.showInfoWindow();
CameraUpdate center=
CameraUpdateFactory.newLatLng(new LatLng(XXXX,
XXXX));
mMap.moveCamera(center);//my question is how to get this center …Run Code Online (Sandbox Code Playgroud) 我有一个带谷歌地图的屏幕,屏幕上方有一个自动文本查看搜索位置,并制作一个自定义信息窗口以显示更多细节,问题是用户点击任何标记自定义窗口弹出窗口作为其默认行为(屏幕中心) ),所以它混合了autotextview,我可以改变屏幕上的信息窗口位置,即底部或类似的东西.