Beispiel #1
0
 public function testAutoZoomWithValidValue()
 {
     $this->map->setAutoZoom(true);
     $this->assertTrue($this->map->isAutoZoom());
 }
Beispiel #2
0
 /**
  * Computes the bounds of a map.
  *
  * @param \Ivory\GoogleMap\Map $map The map.
  *
  * @return array The computed bounds.
  */
 protected function computeBounds(Map $map)
 {
     $bounds = array();
     if ($map->isAutoZoom() && !in_array($map->getBound(), $bounds)) {
         $bounds[] = $map->getBound();
     }
     foreach ($map->getGroundOverlays() as $groundOverlay) {
         if (!in_array($groundOverlay->getBound(), $bounds)) {
             $bounds[] = $groundOverlay->getBound();
         }
     }
     foreach ($map->getRectangles() as $rectangle) {
         if (!in_array($rectangle->getBound(), $bounds)) {
             $bounds[] = $rectangle->getBound();
         }
     }
     return $bounds;
 }