ubilabs / google-maps-react-hooks

The JavaScript library to easily implement a Google Maps map into your react application. It comes with a collection of React hooks to access the map instance or different Maps JavaScript Services.
MIT License
77 stars 13 forks source link

Callback error #139

Open dgwyer opened 1 year ago

dgwyer commented 1 year ago

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 commented 1 year ago

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>