Пример #1
0
 public function testLongitudeToX()
 {
     $this->assertEquals(355500011, Mercator::longitudeToX(58.3813335747));
     $this->assertEquals(268435456, Mercator::longitudeToX(0));
     $this->assertEquals(0, Mercator::longitudeToX(-180));
     $this->assertEquals(536870912, Mercator::longitudeToX(180));
 }
Пример #2
0
 public function toPoint()
 {
     return new Point(Mercator::longitudeToX($this->longitude), Mercator::latitudeToY($this->latitude));
 }
Пример #3
0
 /**
  * @return Coordinate
  */
 public function toCoordinate()
 {
     return new Coordinate(Mercator::yToLatitude($this->y), Mercator::xToLongitude($this->x));
 }