예제 #1
0
파일: EGMapMarker.php 프로젝트: aleoy/egmap
 /**
  *
  * @param EGMapMarker[] $markers array of MArkers
  * @return EGMapCoord
  * @author fabriceb
  * @since 2009-05-02
  * @since 2011-01-25 modified by Antonio Ramirez
  * */
 public static function getCenterCoord($markers)
 {
     $bounds = EGMapBounds::getBoundsContainingMarkers($markers);
     return $bounds->getCenterCoord();
 }
예제 #2
0
 /**
  *
  * @param EGMapMarker[] $markers array of MArkers
  * @return EGMapCoord
  * @author fabriceb
  * @since 2009-05-02
  * @since 2011-01-25 modified by Antonio Ramirez
  * */
 public static function getCenterCoord($polygons)
 {
     $bounds = EGMapBounds::getBoundsContainingPolygons($polygons);
     return $bounds->getCenterCoord();
 }
예제 #3
0
 /**
  *
  * @param GMapPolygon[] $polygons array of Polygons
  * @param float $margin margin factor for the bounds
  * @return EGMapBounds
  * @author Matt Kay
  * @since 2011-03-10
  *  Added this function based on getBoundsContainingMarkers
  *
  * */
 public static function getBoundsContainingPolygons($polygons, $margin = 0)
 {
     $coords = array();
     foreach ($polygons as $polygon) {
         // merge LatLng arrays
         array_merge($coords, $polygon->getCoords());
     }
     return EGMapBounds::getBoundsContainingCoords($polygon->getCoords(), $margin);
 }
예제 #4
0
 /**
  *
  * @return EGMapBounds
  * @author fabriceb
  * @since Jun 2, 2009 fabriceb
  * @since 2010-12-22 modified for Yii Antonio Ramirez
  */
 public function getBoundsFromCenterAndZoom()
 {
     return EGMapBounds::getBoundsFromCenterAndZoom($this->getCenterCoord(), $this->zoom, $this->getWidth(), $this->getHeight());
 }
예제 #5
0
파일: EGMapCoord.php 프로젝트: romeo14/pow
 /**
  *
  * @param EGMapBounds $gmap_bounds
  * @return boolean $is_inside
  *
  * @author fabriceb
  * @since Jun 2, 2009 fabriceb
  */
 public function isInsideBounds(EGMapBounds $gmap_bounds)
 {
     return $gmap_bounds->containsGMapCoord($this);
 }
예제 #6
0
파일: EGMapBounds.php 프로젝트: romeo14/pow
 /**
  *
  * @param GMapMarker[] $markers array of Markers
  * @param float $margin margin factor for the bounds
  * @return EGMapBounds
  * @author fabriceb
  * @since 2009-05-02
  * @since 2011-01-25 modified by Antonio Ramirez
  *
  **/
 public static function getBoundsContainingMarkers($markers, $margin = 0)
 {
     $coords = array();
     foreach ($markers as $marker) {
         array_push($coords, $marker->position);
     }
     return EGMapBounds::getBoundsContainingCoords($coords, $margin);
 }