google-map-react/google-map-react
GitHub で見るonClick event wrong location when map size change
Open
#914 opened on 2020年8月11日
help wanted
説明
Describe the bug 🐛
When getting the lat & lng from the onClick event on the map component, lat & lng are incorrect if the bounds of the map changes (for e.g. when switching to full screen using the built-in button).
To Reproduce 🔍
- Log the lat & lng that onClick give to the callback
onClick={console.log} - Unzoom as far as you can so the issue will be more visible
- Take a reference point (nothing special, just find a spot on the map that you will click twice in the next steps). I like to take the south spike of Greenland.
- Click on your reference point
- Switch the map to fullscreen mode
- Click on your reference point again
- Check the console and you'll see that both clicks didn't have the same position (Even if you did click twice at the EXACT same location)
And there you go, now you should see the issue.
Expected behavior 💭
The onClick even should give the same location in both cases described above (normal & fullscreen mode).
Additional context
I'm using the version 2.0.8.