ReferenceError: google is not defined
See original GitHub issueimport { Link } from 'react-router-dom'
import {
GoogleMap,
useLoadScript,
useJsApiLoader,
Marker,
InfoWindow,
} from '@react-google-maps/api'
import * as ROUTES from '../../NavigationComponent/constants'
import { globalConfig } from '../../../config'
const FindEhxHealthCareFacility = ({
facilities,
loading,
search,
filteredEhxFacilities,
}) => {
const [entityType, setEntityType] = useState('HealthFacility')
console.log('Location search:', search)
console.log('Filtered Results:', filteredEhxFacilities)
const mapStyles = {
width: '100%',
height: '70vh',
}
const defaultPosition = {
lat: 5.57978,
lng: -0.11112,
}
const customMapStyles = [
{
featureType: 'administrative.country',
elementType: 'geometry',
stylers: [
{
visibility: 'simplified',
},
{
hue: '#ff0000',
},
],
},
]
const { isLoaded, loadError } = useLoadScript({
googleMapsApiKey: globalConfig.googleMapsApi,
libraries: ['places'],
})
if (loadError) return 'Error loading Maps'
if (isLoaded) return 'Loading Maps'
return (
<GoogleMap
mapContainerStyle={mapStyles}
zoom={20}
center={defaultPosition}
options={customMapStyles}
></GoogleMap>
)
}
export default FindEhxHealthCareFacility
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
ReferenceError: google is not defined - Stack Overflow
I just noticed that in Google Chrome's Javascript console: it gives the following error: [blocked] The page at mypage.com/GoogleMapPage.aspx ran insecure ...
Read more >Uncaught ReferenceError: google is not defined - MSDN
Usually this type of error is due to forgetting to reference a JavaScript library or trying to access a library object before the...
Read more >google is not defined - ionic v3.9.2, angular v5.2.11
Hello guys, i know this error is pretty common but i still have no idea which part did i do wrong. i already...
Read more >ReferenceError: google is not defined - Stork's Nest
My task is to create a Google Maps component without using any node module helper.
Read more >ReferenceError:'google' is undefined - Geopointe Help Center
If this error message appears while trying to access our map page, it means that Google is being blocked, either by the browser...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Can you try this,
new window.google
But wait for map to initialise, then use this