feat(SW-325): added mapId as environment variables

This commit is contained in:
Erik Tiekstra
2024-09-18 15:21:58 +02:00
parent e79f413003
commit 730f66d79a
17 changed files with 42 additions and 14 deletions

View File

@@ -3,7 +3,7 @@ import { getIconByIconName } from "@/components/Icons/get-icon-by-icon-name"
import { getCategoryIconName } from "../utils"
import { poiVariants } from "./variants"
import { PoiMarkerProps } from "@/types/components/maps/poiMarker"
import type { PoiMarkerProps } from "@/types/components/maps/poiMarker"
export default function PoiMarker({
category,

View File

@@ -1,5 +1,5 @@
import { IconName } from "@/types/components/icon"
import { PointOfInterestCategory } from "@/types/hotel"
import type { PointOfInterestCategory } from "@/types/hotel"
/* 2024-09-18: At the moment, the icons for the different categories is unknown.
This will be handled later. */

View File

@@ -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} />