1

How can show markers on specific zoom level using Google Maps Android API v2? I have more than 1000 Markers, so it's not good idea to show all on start.

Here is simple example:

#

// latitude and longitude

double latitude = 40.738933;

double longitude = -74.001366;

// create marker

MarkerOptions marker = new MarkerOptions().position(new LatLng(latitude, longitude)).title("Hello Maps ");

// adding marker

googleMap.addMarker(marker);
#

Thank you for help

keshav
  • 3,235
  • 1
  • 16
  • 22
Jefrey Piekny
  • 88
  • 4
  • 11

1 Answers1

9

put below code

googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(HAMBURG, 15));

here Move the camera instantly to marker with a zoom of 15. if you wanna change zoom level you can change.

sandeepmaaram
  • 4,191
  • 2
  • 37
  • 42