fix(SW-1014): Fixed issue where google didn't found city.
This commit is contained in:
@@ -7,6 +7,7 @@ import { StaticMapProps } from "@/types/components/maps/staticMap"
|
||||
|
||||
export default function StaticMap({
|
||||
city,
|
||||
country,
|
||||
coordinates,
|
||||
width,
|
||||
height,
|
||||
@@ -18,7 +19,9 @@ export default function StaticMap({
|
||||
const key = env.GOOGLE_STATIC_MAP_KEY
|
||||
const secret = env.GOOGLE_STATIC_MAP_SIGNATURE_SECRET
|
||||
const baseUrl = "https://maps.googleapis.com/maps/api/staticmap"
|
||||
const center = coordinates ? `${coordinates.lat},${coordinates.lng}` : city
|
||||
const center = coordinates
|
||||
? `${coordinates.lat},${coordinates.lng}`
|
||||
: `${city}, ${country}`
|
||||
|
||||
if (!center) {
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user