Add imageUrl and markerUrl
This commit is contained in:
parent
ba403c5f59
commit
30fc4926c4
|
@ -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,
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue