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) => {