Google maps → fitBounds manually

I am currently stuck with google maps v3. I am trying to add borders manually this way, but this will not work !?

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

0
source share
1 answer

fitBounds expects an object of type LatLngBounds , which, in turn, initializes 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); 

Link:

+5
source

Source: https://habr.com/ru/post/1205030/


All Articles