From 1539dfef7f062569df53eacc53ef07beb8463199 Mon Sep 17 00:00:00 2001 From: suryac Date: Fri, 31 Jul 2026 12:33:24 +0530 Subject: [PATCH] added google map api --- src/components/forms/fields/GeolocationInput.tsx | 4 +--- src/components/maps/DailyLogMap.tsx | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/forms/fields/GeolocationInput.tsx b/src/components/forms/fields/GeolocationInput.tsx index 14e9316..ed24299 100644 --- a/src/components/forms/fields/GeolocationInput.tsx +++ b/src/components/forms/fields/GeolocationInput.tsx @@ -27,11 +27,9 @@ export function GeolocationInput({ const [isMapModalOpen, setIsMapModalOpen] = useState(false); const [mapMarkerPos, setMapMarkerPos] = useState<{ lat: number; lng: number } | null>(null); - const isLocalhost = typeof window !== 'undefined' && (window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1'); - const { isLoaded } = useJsApiLoader({ id: 'google-map-script', - googleMapsApiKey: isLocalhost ? '' : (import.meta.env.VITE_GOOGLE_MAPS_API_KEY || '') + googleMapsApiKey: import.meta.env.VITE_GOOGLE_MAPS_API_KEY || '' }); // Extract lat, lng & accuracy from value (supporting both latitude/longitude and lat/lng) diff --git a/src/components/maps/DailyLogMap.tsx b/src/components/maps/DailyLogMap.tsx index 34e324c..9323836 100644 --- a/src/components/maps/DailyLogMap.tsx +++ b/src/components/maps/DailyLogMap.tsx @@ -50,11 +50,9 @@ export function DailyLogMap({ const [error, setError] = useState(null); const mapRef = useRef(null); - const isLocalhost = typeof window !== 'undefined' && (window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1'); - const { isLoaded } = useJsApiLoader({ id: 'google-map-script', - googleMapsApiKey: isLocalhost ? '' : (import.meta.env.VITE_GOOGLE_MAPS_API_KEY || '') + googleMapsApiKey: import.meta.env.VITE_GOOGLE_MAPS_API_KEY || '' }); const fetchNearestStores = async (lat: number, lng: number) => {