Good afternoon! I use the library to react-google-maps. How can I get the coordinates of the center of the map?

Multi tool use
Multi tool use


Good afternoon! I use the library to react-google-maps. How can I get the coordinates of the center of the map?



I use the library react-google-maps. The coordinates can be obtained with getCenter(), but I can not. How to make a button in the component that will send the coordinates of the center to the parent function and how to get these coordinates from the center? Can you know? Thank you!


react-google-maps


getCenter()


const Map = compose(
withProps({
googleMapURL:
"https://maps.googleapis.com/maps/api/js?key=AIzaSyB8ECfIjkNyE2AVBlG4Fpd4rD2Y4q5Ytpk",
loadingElement:

,
containerElement:
,
mapElement:
,
}),
lifecycle({
componentDidMount() {
const refs = {}

this.setState({
onMapMounted: ref => {
refs.map = ref;
console.log(refs.map.getCenter())
},
})
},
}),
withScriptjs,
withGoogleMap
)((props) =>

{markers.map( function (obj, index) {
return (


{props.isOpen &&


{obj.title}

</InfoWindow>
}
</Marker>
</div>
);
})
}
<Polygon path={path} />
</GoogleMap>
)









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

nKMbo XE,9TOrYAhLOmbqIiRuTkCflR 9ZbZCYIpndG,KJBF
ZywBXm7qCVqek4ZSPC R1,Rn,XI,WUvDM 3,U tT91 FUI,18Hg R5e Ji 7nFMNvrWi,oMqYOKKX59CPru,eYbFDftdOHd

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications