/** * * @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(); }
/** * * @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(); }
/** * * @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); }
/** * * @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()); }
/** * * @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); }
/** * * @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); }