Google Map ~ trigger marker click event

use function to trigger marker's onclick event

---------------------------------------------------------------------------------------------------
var markers = {};

var point = new GLatLng(x.lat, x.lng);
markers[1] = new GMarker(point);

GEvent.addListener(markers[1], "click", function () {
alert('xxxxxxxxx');
});


GEvent.trigger(markers[id], 'click');
---------------------------------------------------------------------------------------------------

reference
http://stackoverflow.com/questions/2730929/how-to-trigger-the-onclick-event-of-a-marker-on-a-google-maps-v3

沒有留言: