Example on event onClick implementation #101
-
I have a mini app where a user click the map and a pin is replaced. I recently move off another library to this one but can't figure out how to get the coordinates from the click event. ` <GoogleMap |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi @Michael-fore. You have the coordinates on the Marker child, not the map. |
Beta Was this translation helpful? Give feedback.
I ended up just doing this as a work around
const onGoogleApiLoaded = ({ map, maps }) => { mapRef.current = map setMapReady(true) window.google.maps.event.addDomListener(mapRef.current, "click", (e) => { console.log(e.latLng.lat(),e.latLng.lng()) }) }