When I change pointer on the map, I want to get name of a place. I'm able to get lat and lng of a place on the map, but I want to get name of that place. For exampl lat: 43.669992353311635, lng: -79.4108552 is TORONTO. What is mistake in my code?
library: react-google-maps
onDragEnd: ({ setDrag, setCenter, setUseMyLocation, onChangeMapCoords }) => () => {
const center = refs.map.getCenter();
const placeName = refs.map.getPlaces();
console.log("ACTION sp8 map center", placeName)
// console.log("ACTION sp8 map center", { lat: center.lat(), lng: center.lng()})
setUseMyLocation(false);
setDrag(false);
setCenter(({ lat: center.lat(), lng: center.lng() }));
resetSearchBox();
},