diff --git a/apps/map/BUCK b/apps/map/BUCK
index 83780d50c2..b904f516a9 100644
--- a/apps/map/BUCK
+++ b/apps/map/BUCK
@@ -37,6 +37,7 @@ filegroup(
name = "src",
srcs = glob([
"app/**",
+ "public/**",
"theme/**",
"services/**",
"components/**",
diff --git a/apps/map/app/page.tsx b/apps/map/app/page.tsx
index 0d819695f2..6c6c2f2da3 100644
--- a/apps/map/app/page.tsx
+++ b/apps/map/app/page.tsx
@@ -1,4 +1,5 @@
import MapComponent from "@/components/map"
+import { env } from "@/env"
import { businessMapMarkers } from "@/services/galoy/graphql/queries/business-map-marker"
import Image from "next/image"
@@ -8,12 +9,13 @@ export default async function Home() {
return {mapData.message}
}
+ const googleMapsApiKey = env.NEXT_PUBLIC_MAP_API_KEY
return (
-
+
)
}
diff --git a/apps/map/components/map/index.tsx b/apps/map/components/map/index.tsx
index 9e85f41aa2..8e740afc63 100644
--- a/apps/map/components/map/index.tsx
+++ b/apps/map/components/map/index.tsx
@@ -4,17 +4,17 @@ import { GoogleMap, MarkerF, InfoWindow, useLoadScript } from "@react-google-map
import { BusinessMapMarkersQuery } from "@/services/galoy/graphql/generated"
import Link from "next/link"
import { theme } from "./map-theme"
-import { env } from "@/env"
import LocationIcon from "../logo/location"
import { SuggestMapFormSheet } from "./suggest-form"
type MapComponentProps = {
mapData: BusinessMapMarkersQuery["businessMapMarkers"]
+ googleMapsApiKey: string
}
const DEFAULT_LAT = 13.7942
const DEFAULT_LNG = -88.8965
-export default function MapComponent({ mapData }: MapComponentProps) {
+export default function MapComponent({ mapData, googleMapsApiKey }: MapComponentProps) {
const mapRef = useRef()
const [selectedMarker, setSelectedMarker] = useState<
BusinessMapMarkersQuery["businessMapMarkers"][number] | null
@@ -73,7 +73,7 @@ export default function MapComponent({ mapData }: MapComponentProps) {
}, [])
const { isLoaded } = useLoadScript({
- googleMapsApiKey: env.NEXT_PUBLIC_MAP_API_KEY,
+ googleMapsApiKey,
libraries: libraries as any,
})