Skip to content

Instantly share code, notes, and snippets.

@sidharrth2002
Created December 19, 2021 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sidharrth2002/1e0767c93cc7ed5df709f6804559f807 to your computer and use it in GitHub Desktop.
Save sidharrth2002/1e0767c93cc7ed5df709f6804559f807 to your computer and use it in GitHub Desktop.
const { isLoaded } = useJsApiLoader({
id: "google-map-script",
googleMapsApiKey: process.env.REACT_APP_GOOGLE_MAPS_API_KEY,
libraries,
});
{loading || !isLoaded ? (
<Center
h="80vh"
flexDirection="column"
justifyContent="center"
alignItems="center"
>
<Spinner />
</Center>
) : (
<GoogleMap
mapContainerStyle={mapContainerStyle}
zoom={8}
center={center}
onLoad={onLoad}
onUnmount={onUnmount}
options={options}
onClick={() => {
setModalVisible(false);
setFoodbankModalVisible(false);
}}
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment