{!loading ? (
<GoogleMapReact
defaultZoom={isEqual(latLong, USLatLong) ? 4 : 18}
defaultCenter={latLong.lat && latLong.lng ? latLong : USLatLong}
bootstrapURLKeys={{ key: process.env.REACT_APP_GMP_API_KEY }}
yesIWantToUseGoogleMapApiInternals
onGoogleApiLoaded={handleApiLoaded}
hoverDistance={20}
onTilesLoaded={() => setLoading(false)}
/>
) : (
<Loader />)}
I have one state variable loading. If it is true then I want to show Loader. If its false then I want to show Google map.
Now problem is that, In google-map-react how can I set the variable after map loading is completed.
const [loading, setLoading] = useState(false);