title: How can I get the new lat, lang of the user whenever the user drags the pin anywhere using google map api
body: <p>I'm building a web app that actually allow the user to see the marker for a selected a address. Also, I'm trying to build a feature that when a user drag the pin it should update the lat, lang value. Though I was able to get the current location of a user using the code below but the big question is <code>How can I get the new lat, lang of the user whenever the user drags the pin anywhere</code>? Any response is much appreciated, thank you. Btw, I am using this addon <a href="https://github.com/asennikov/ember-g-map" rel="nofollow noreferrer">https://github.com/asennikov/ember-g-map</a></p>
  
  <p><code>/component.js</code></p>
  
  <pre><code>    getCurrentLocation() {
        if (navigator.geolocation) {
          console.log(navigator.geolocation);
          navigator.geolocation.getCurrentPosition((position) =&gt; {
           this.set('selectedLatitude', position.coords.latitude);
           this.set('selectedLongitude', position.coords.longitude);
           this.set('hasSelectedFromAutoCompleteOrCurrentLocation', true);
  
           this.reverseGeoCode(position.coords.latitude, position.coords.longitude).then((resp) =&gt; {
             this.set('formattedAddress', resp);
           }).catch((error) =&gt; console.log(error));
  
         });
        } else {
          console.log("Your browser doesn't support geo location");
        }
      },
  </code></pre>
  
  <p><code>/template.hbs</code></p>
  
  <pre><code>    {{#g-map lat=cityLatitude lng=cityLongitude zoom=zoomValue options=mapOptions as |context|}}
        {{#if hasSelectedFromAutoCompleteOrCurrentLocation}}
          {{g-map-marker context lat=selectedLatitude lng=selectedLongitude onDrag=(action "getCurrentLocation") draggable=true zoom=zoomValue icon=myIcon}}
        {{/if}}
      {{/g-map}}
  </code></pre>