I am using google map api v3 and got this error while using the
map.fitBounds(bounds); function
Here is the error snapshot on console
And Here is the Code:
var arr = [{lat: -25.363, lng: 131.044}, {lat: 12.97, lng: 77.59}];
for (i = 0; i < arr.length; i++) {
bounds.extend(new google.maps.LatLng(arr[i]));
}
map.fitBounds(bounds); //If I comment this line in m code, the error is gone but map does not load.
what is the problem? Also how can I solve it?