3

在谷歌地图上的屏幕中心放置标记android和uber和ola应用中的相同。当移动或滚动谷歌地图标记不应该移动,它应该给latlng坐标如何在谷歌地图上的屏幕中心放置一个标记

+0

你到目前为止尝试过什么? –

+0

看看http://stackoverflow.com/questions/36157242/pinch-to-zoom-google-map-with-out-moving-marker-in-framelayout/36287722#36287722 – antonio

回答

0

试试这个取位置,

CameraPosition cameraPosition = new CameraPosition.Builder() 
      .target(new LatLng(currentLatitude, currentLongitude)).zoom(15).build(); 

    googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); 
0
Check Out This 

    LatLng mapCoordinate = new LatLng(yourLatitude, yourLatitude); 
    CameraUpdate yourLocation = CameraUpdateFactory.newLatLngZoom(mapCoordinate, 11.0f); 
    yourMap.animateCamera(yourLocation); 

    Or In Other way 

    LatLng mapCoordinate = new LatLng(yourLatitude, yourLatitude); 
    CameraPosition cameraPosition = new CameraPosition.Builder() 
     .target(mapCoordinate) // set to Center 
     .zoom(12.0f)    // for the Zoom 
     .bearing(90)    // Orientation of the camera to east 
     .tilt(30)     // Tilt of the camera to 30 degrees 
     .build();     // Creates a CameraPosition 
    yourMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); 
1

你需要把frameLayout.That的ImageView的中心是不是你的地图标记,但它放置在中心,当你点击该图像视图时,你需要获得地图的中心LatLng

这里是获取中心LatLn g地图:

LatLng center = mgoogleMap.getCameraPosition()。target;

+0

我有一个你想要的演示。我可以与你分享。 –

相关问题