diff --git a/single.php b/single.php index 41d70b2..c8c94ed 100644 --- a/single.php +++ b/single.php @@ -106,13 +106,18 @@ center: map_center, zoom: 15 }); + var bounds = new google.maps.LatLngBounds(); for(var i = 0; i < places.length; i++){ var marker = new google.maps.Marker({ position: {lat: parseFloat(places[i]['lat']), lng: parseFloat(places[i]['lng']) }, map: map }); marker.setVisible(true); + bounds.extend(marker.getPosition()); } + this.map.fitBounds(bounds); + if(map.getZoom() > 15) + map.setZoom(15); }