1

I am currently stuck with google maps v3. I try to add bounds manually in this way, but it doesn't work!?

map.fitBounds((53.399999, 9.73215099999993), (53.717145, 10.123491999999942));

Lupo
  • 2,884
  • 5
  • 24
  • 30

1 Answers1

5

fitBounds expects an object of the type LatLngBounds, which in turn is initialized with two LatLng objects.

This should work:

sw = new LatLng(53.399999, 9.73215099999993);
ne = new LatLng(53.717145, 10.123491999999942);
bounds = new LatLngBounds(sw, ne)

map.fitBounds(bounds);

Reference:

Pekka
  • 442,112
  • 142
  • 972
  • 1,088