I use the react-google-maps
StandaloneSearchBox
and query the locations of my points of interest. This works as far as it goes. However, I get back functions for the location and not the actual value. How do I actually get the lat and lng values similar to the viewport.
JavaScript
x
9
1
geometry:
2
location: _.bf
3
lat: ƒ ()
4
lng: ƒ ()
5
6
viewport: _.Wf
7
Bb: Vf {g: 41.4022605197085, h: 41.4049584802915}
8
Ra: Qf {g: 2.173047169708498, h: 2.175745130291502}
9
Advertisement
Answer
You can just call the lat
and lng
functions to get the values.
geometry.location.lat()
-> latitude valuegeometry.location.lng()
-> longitude value