*/ final class Gpx extends AbstractDumper implements Dumper { /** * @param Location $location * * @return string */ public function dump(Location $location): string { $gpx = sprintf(<<<'GPX' GPX , Geocoder::VERSION); if (null !== $bounds = $location->getBounds()) { $gpx .= sprintf(<<<'GPX' GPX , $bounds->getWest(), $bounds->getSouth(), $bounds->getEast(), $bounds->getNorth()); } $lat = null; $lon = null; if (null !== $coordinates = $location->getCoordinates()) { $lat = $coordinates->getLatitude(); $lon = $coordinates->getLongitude(); } $gpx .= sprintf(<<<'GPX' GPX , $lat, $lon, $this->formatName($location)); $gpx .= <<<'GPX' GPX; return $gpx; } }