Location\Formatter\Coordinate\GeoJSON::format PHP Method

format() public method

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