How to fire dragend event of a marker in google maps v3?

Morteza Milani picture Morteza Milani · Jun 26, 2010 · Viewed 15.2k times · Source

I want to fire dragend event of a marker in another event say click event on the map. how can I do that?

google.maps.event.addListener(map,'click',function(pt){
   posSelectMarker.setPosition(pt.latLng);
   //Here I want to fire dragend event.
});

Answer

TheDeadMedic picture TheDeadMedic · Jun 26, 2010

Use event.trigger;

google.maps.event.trigger(markerObject, 'dragend', args);