在谷歌地图android的屏幕中央放置标记,就像在uber和ola应用程序中一样。当移动或滚动google地图标记时,不应移动,并且应给出延迟坐标
发布于 2017-02-22 15:53:12
您需要将frameLayout.That的中心放置在地图的中心,而不是地图的标记,当您单击该影像视图时,您需要获取地图的中心LatLng
下面是获取地图中心LatLng的代码:
LatLng = mgoogleMap.getCameraPosition().target;
发布于 2017-02-22 14:49:15
你需要使用框架布局来对齐你的标记,在这种情况下,像这样的图像居中。然后使用googleMap.getCameraPosition().target获取位置
有关更多信息,请参阅http://developer.android.com/reference/com/google/android/gms/maps/model/CameraPosition.html#target
发布于 2017-02-22 14:52:09
尝尝这个,
CameraPosition cameraPosition = new CameraPosition.Builder()
.target(new LatLng(currentLatitude, currentLongitude)).zoom(15).build();
googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));https://stackoverflow.com/questions/42384482
复制相似问题