Android 移动相机时获取坐标

Android 移动相机时获取坐标,android,google-maps,Android,Google Maps,我正在使用android应用程序谷歌地图,我需要在移动地图时捕获纬度和经度。目前,当我点击它是工作,但我需要坐标时,我移动地图。我的代码如下: private void setUpMap() { gMap.setOnMapClickListener(this);// add the listener for click for amap object gMap.setOnMapClickListener(new GoogleMap.OnMapClickLis

我正在使用android应用程序谷歌地图,我需要在移动地图时捕获纬度和经度。目前,当我点击它是工作,但我需要坐标时,我移动地图。我的代码如下:

private void setUpMap() {
        gMap.setOnMapClickListener(this);// add the listener for click for amap object



        gMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {

            @Override
            public void onMapClick(LatLng latlng) {
                // TODO Auto-generated method stub

                latitude = latlng.latitude;
                longitude = latlng.longitude;

                address=GooglePlacesAutocompleteAdapter.getAddress(PickLocation.this,longitude,latitude);
                edtAddressSearch.setFocusable(false);
                edtAddressSearch.setFocusableInTouchMode(false);
                edtAddressSearch.setText(address);

            }
        });


        gMap.setOnCameraMoveListener(new GoogleMap.OnCameraMoveListener() {
            @Override
            public void onCameraMove() {
//                Toast.makeText(getApplicationContext(),"map is moving",Toast.LENGTH_LONG).show();
            }
        });

    }

onCameraMove
内的变量中获取
LatLng
对象:

@Override
public void onCameraMove() {
    LatLng target = gMap.getCameraPosition().target;
}