点击列表视图中的项目后如何关注谷歌标记?

时间:2016-03-15 18:35:25

标签: android google-maps listview google-maps-api-3

This is my marker which is set in -  MainAcitivity 

 googleMap.addMarker(new MarkerOptions()
            .position(new LatLng(26.89209, 75.82759))
            .title("Store"));

我想要做的是,在listview中,当用户点击txtplace字段时,谷歌标记将集中在我设置的那个标记上

 holder.txtPlace.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (holder.txtStore.getText().toString().equals("Store") ) {
                //mMap.animateCamera(CameraUpdateFactory.newCameraPosition(  what to do here ??? ));

            } 

        }
    });

1 个答案:

答案 0 :(得分:0)

尝试使用此功能,例如:

googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(26.89209, 75.82759)), 14));