Open mfavetti opened 1 month ago
This prevents the warning:
<Map
id="map"
mapId={MAP_ID}
defaultBounds={{north: 45, south: 0, east: 0, west: 45}}
onCenterChanged={() => {console.log('center changed')}}
defaultCenter={{lat: 0, lng: 0}}
defaultZoom={1}
/>
I tried some other events and so far onCenterChanged is the only one I can reproduce with.
Thanks! The official documentation doesn't have any information on why the types for map.center
etc are specified as "might be undefined" and in about ten years with the maps API, I never encountered a situation where they were in fact undefined. That is why I added that error-message so I can finally learn in which situation that will happen :)
I'll figure out how we can prevent that from being a problem...
Description
Warning in console when initializing a map with defaultBounds and adding an event listener:
main.js:169 [createEvent] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new
Steps to Reproduce
Environment
Logs