Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
What i want :
I want to set focus on marker that is already placed in google map.
When i click on list view item , focus of camera should be transfer to that poistion marker on map

What I have tried:

I try this in ListView.java class

GoogleMap mMap;
LatLng coordinate = new LatLng(26.89553, 75.82842);
holder.txtStore.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(holder.txtStore.getText().toString().equals("MarkerName")) {

CameraUpdate location = CameraUpdateFactory.newLatLngZoom(
coordinate, 15);
mMap.animateCamera(location); // App crash n showing error here

}
}
});
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900