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)); }
public function toPoint() { return new Point(Mercator::longitudeToX($this->longitude), Mercator::latitudeToY($this->latitude)); }
/** * @return Coordinate */ public function toCoordinate() { return new Coordinate(Mercator::yToLatitude($this->y), Mercator::xToLongitude($this->x)); }