示例#1
0
 /**
  * Return coordinate as point in Google Maps.
  *
  * @return   object Google_Maps_Point
  */
 public function toPoint()
 {
     $lat = $this->getLat();
     $lon = $this->getLon();
     $x = Google_Maps_Mercator::LonToX($lon);
     $y = Google_Maps_Mercator::LatToY($lat);
     return new Google_Maps_Point($x, $y);
 }
示例#2
0
 /**
  * Return point as coordinate.
  *
  * @return   object Google_Maps_Coordinate
  */
 public function toCoordinate()
 {
     $x = $this->getX();
     $y = $this->gety();
     $lat = Google_Maps_Mercator::YToLat($y);
     $lon = Google_Maps_Mercator::XToLon($x);
     return new Google_Maps_Coordinate($lat, $lon);
 }