There are a lot of shapes on the map and they are all saved inside this array array_shapes_object[]
. How can I show all of them on the map by fitBounds method?
I can use something like:
map.fitBounds(circle.getBounds());
or
map.fitBounds(rectangle.getBounds());
or
var points = new google.maps.LatLng(arrayLatitude[aa], arrayLongitude[aa]);
bounds.extend(points);
map.fitBounds(bounds);
but they all work for just a shape and not more than one. Seems that there is just three type of shapes. (Circle, rectangle, polygon).
I want to fitBounds all shapes on the map when I click on a button that is run a function.