google-maps-react-hooks icon indicating copy to clipboard operation
google-maps-react-hooks copied to clipboard

Callback error

Open dgwyer opened this issue 2 years ago • 1 comments

Just noticed this happening in the console.

More info here: https://stackoverflow.com/questions/75179573/how-to-fix-loading-the-google-maps-javascript-api-without-a-callback-is-not-supp

image

dgwyer avatar Feb 23 '23 14:02 dgwyer

I guess it would be useful to be able to define this callback in the provider.

Maybe something like:

<GoogleMapProvider
  googleMapsAPIKey="1234"
  options={mapOptions}
  mapContainer={mapContainer}
  callback={()  => console.log("map loaded")}>
      <div ref={(node) => setMapContainer(node)} style={{ height: "100vh" }} />
</GoogleMapProvider>

dgwyer avatar Feb 23 '23 14:02 dgwyer