How to get Latitude and Longitude from google maps latLng Object

493 Views Asked by At

I integrated angular google maps with my application to get the latitude and longitude of a certain place by dragging a marker.I successfully returned an object which encapsulates the latitude and longitude fields but I am not knowing how to access them and assign them to local variables in my application.Any idea ? Here is a picture of my chrome console

enter image description here

1

There are 1 best solutions below

2
On BEST ANSWER

Well, you have a . at the end of lat() instead of a ; which is messing up your code. Try this:

this.latitude = $event.latLng.lat();
this.longitude = $event.latLng.lng();