Pathik Vejani Pathik Vejani - 6 months ago 55
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');


                    type: 'post',
                    dataType: "jsonp",
                    crossdomain: true,
                    url: '',
                    data: {
                        key: 'key',
                        latlng: lat + "," + lng
                    success: function (json) {
                      //show on page
                    async: false,
                    error: function ()