Files
web/components/Maps/StaticMap/index.tsx
2024-08-13 08:52:54 +02:00

16 lines
520 B
TypeScript

/* eslint-disable @next/next/no-img-element */
import { StaticMapProps } from "@/types/components/maps/staticMap/staticMap"
export default function StaticMap({
city,
width,
height,
zoomLevel,
mapType,
}: StaticMapProps) {
const apiKey = process.env.NEXT_PUBLIC_GOOGLE_STATIC_MAP_KEY
const mapUrl = `https://maps.googleapis.com/maps/api/staticmap?center=${city}&zoom=${zoomLevel}&size=${width}x${height}&maptype=${mapType}&key=${apiKey}`
return <img src={mapUrl} alt={`Map of ${city} city center`} />
}