示例#1
0
 /**
  * Does a homthety transformtion on the bounds, centered on the center of the bounds
  *
  * @param float $factor
  * @return GMapBounds $bounds
  * @author fabriceb
  * @since Feb 17, 2009 fabriceb
  */
 public function getHomothety($factor)
 {
   $bounds = new GMapBounds();
   $lat = $this->getCenterLat();
   $lng = $this->getCenterLng();
   $bounds->getNorthEast()->setLatitude($factor*$this->getNorthEast()->getLatitude()+$lat*(1-$factor));
   $bounds->getSouthWest()->setLatitude($factor*$this->getSouthWest()->getLatitude()+$lat*(1-$factor));
   $bounds->getNorthEast()->setLongitude($factor*$this->getNorthEast()->getLongitude()+$lng*(1-$factor));
   $bounds->getSouthWest()->setLongitude($factor*$this->getSouthWest()->getLongitude()+$lng*(1-$factor));
   
   return $bounds;
 }