Skip to content Skip to sidebar Skip to footer

Google Maps → FitBounds Manually

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.12349199999994

Solution 1:

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:


Post a Comment for "Google Maps → FitBounds Manually"