0

I have a google maps application which is responsible get some information about a draggable marker. I would like to update the locality when this marker is moved.

So, I can update the latitude and longitude, but the locality I don't know how to do it. I'm using jquery-addresspicker and all methods that I'm using are here. That's what I did:

Added a listener on markerMoved method
google.maps.event.addListener(this.gmarker, 'dragend', $.proxy(this._markerMoved, this));

_updatePosition: function(location) {
  if (this.lat) {
    this.lat.val(location.lat());
  }
  if (this.lng) {
    this.lng.val(location.lng());
  }
  if (this.locality) {
    this.locality.val(??????);
  }
},

_markerMoved: function() {
  this._updatePosition(this.gmarker.getPosition());
}
.
.

Thanks in advance!

hugalves
  • 271
  • 4
  • 15
  • 1
    Check the accepted answer on this post - I think it might help http://stackoverflow.com/questions/3392160/converting-latitude-longitude-into-city-name-reverse-geolocating – Luke Baughan Mar 01 '13 at 14:23
  • bUKaneer, perfect tip! It was exactly what I need! Thanks! – hugalves Mar 02 '13 at 13:47

0 Answers0