Add imageUrl and markerUrl

This commit is contained in:
philipp lang 2024-07-09 17:02:04 +02:00
parent ba403c5f59
commit 30fc4926c4
1 changed files with 18 additions and 0 deletions

View File

@ -9,4 +9,22 @@ class Point extends Data
public function __construct(public float $lat, public float $lon) public function __construct(public float $lat, public float $lon)
{ {
} }
public function imageUrl(): string
{
return '/osm-static-maps/?' . http_build_query([
'center' => $this->lon . ',' . $this->lat,
'zoom' => 20,
'maxZoom' => 13,
]);
}
public function markerUrl(): string
{
return '/osm-static-maps/?' . http_build_query([
'geojson' => json_encode(['type' => 'Point', 'coordinates' => [$this->lon, $this->lat]]),
'zoom' => 20,
'maxZoom' => 18,
]);
}
} }