Geolocation and google maps

Hi everyone.
I am new to using natives, and I am encountering a problem with google map. In my app, the user press on any location in the google map and a marker will be added in the map, my problem is that I don’t know how to get the longitude and the latitude when the marker is added. I followed a tutorial to get the map displayed with my current location but I want to get the info of the position(longitude and latitude) when the user add a marker to save them in firebase and display them then to other users.

the add marker location function is: (the geolocation native is added but I have no idea how to make them work together)

addMarker() {

let marker = new google.maps.Marker({
  animation: google.maps.Animation.DROP,

let content = "<p>This is your current position !</p>";
this.addInfoWindow(marker, content);

addInfoWindow(marker, content){

let infoWindow = new google.maps.InfoWindow({
  content: content

google.maps.event.addListener(marker, 'click', () => {, marker);


Read this blog

Use the marker object that is returned to get the location e.g map.addMarker().then((marker: Marker) => {
marker.getPosition().then(res => {