Pathik Vejani Pathik Vejani - 1 year ago 179
Javascript Question

how to get address on drag map pin

How can I get the address using map by dragging a pin?

here is the link which I am using the map : MAP-ADDRESS

The problem is, when I drag the pin that time latlong is changeable but the address is not.

javascript code:

map: ".map_canvas",
details: "form",
markerOptions: {
draggable: true
types: ["geocode", "establishment"]

// I can get lat long from here, but how to get the address?
$("#geocomplete").bind("geocode:dragged", function(event, latLng){
$("input[name=formatted_address]").val('address value');

Answer Source,-73.961452&key=YOUR_API_KEY

                    type: 'post',
                    dataType: "jsonp",
                    crossdomain: true,
                    url: '',
                    data: {
                        key: 'key',
                        latlng: lat + "," + lng
                    success: function (json) {
                      //show on page
                    async: false,
                    error: function ()
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download