public function getMarkersFittingZoom($margin = 0, $default = 14) { $markers = $this->getMarkers(); $bounds = LatLngBounds::getBoundsOfMarkers($markers, $margin); return $bounds->getZoom(min($this->width, $this->height), $default); }
public function flushMap() { if ($this->autoCenter) { if ($LatLonCenter = $this->map->getMarkersCenterCoordinates()) { $this->map->setCenter($LatLonCenter); $this->map->zoom = $this->map->getMarkersFittingZoom(); } } }