예제 #1
0
 /**
  * @param int $margin
  * @param int $default
  *
  * @return int
  */
 public function getMarkersFittingZoom($margin = 0, $default = 14)
 {
     $markers = $this->getMarkers();
     $bounds = LatLngBounds::getBoundsOfMarkers($markers, $margin);
     return $bounds->getZoom(min($this->width, $this->height), $default);
 }
예제 #2
0
 /**
  * Returns the center coordinates of the boundaries of an array of Markers
  *
  * @param Marker[] $markers
  *
  * @return LatLng
  */
 public static function getCenterCoordinates($markers)
 {
     $bounds = LatLngBounds::getBoundsOfMarkers($markers);
     return $bounds->getCenterCoordinates();
 }