I know with the native Google Map API we can do something like:
const bounds = new google.maps.LatLngBounds();
const marker = new google.maps.Marker({ // wrap that into a loop to add multiple points
position: new google.maps.LatLng(lat, lng),
map: map
});
bounds.extend(marker.position);
map.fitBounds(bounds);
But with react-google-maps, markers are components, so i guess there is another way. Creating the markers (as components) works fine, is there an option or something to center the viewport from it?
I hope we don't have to create it as components and re-create it as we would do with the native library.