feat(SW-325): added mapId as environment variables
This commit is contained in:
@@ -13,6 +13,7 @@ export default function StaticMap({
|
||||
zoomLevel = 14,
|
||||
mapType = "roadmap",
|
||||
altText,
|
||||
mapId,
|
||||
}: StaticMapProps) {
|
||||
const key = env.GOOGLE_STATIC_MAP_KEY
|
||||
const secret = env.GOOGLE_STATIC_MAP_SIGNATURE_SECRET
|
||||
@@ -27,6 +28,11 @@ export default function StaticMap({
|
||||
const url = new URL(
|
||||
`${baseUrl}?center=${center}&zoom=${zoomLevel}&size=${width}x${height}&maptype=${mapType}&key=${key}`
|
||||
)
|
||||
|
||||
if (mapId) {
|
||||
url.searchParams.append("map_id", mapId)
|
||||
}
|
||||
|
||||
const src = getUrlWithSignature(url, secret)
|
||||
|
||||
return <img src={src} alt={altText} />
|
||||
|
||||
Reference in New Issue
Block a user