Location\Formatter\Coordinate\GeoJSON::format PHP Méthode

format() public méthode

public format ( Coordinate $coordinate ) : string
$coordinate Location\Coordinate
Résultat string
    public function format(Coordinate $coordinate)
    {
        return json_encode(['type' => 'Point', 'coordinates' => [$coordinate->getLng(), $coordinate->getLat()]]);
    }
GeoJSON