google maps api call GEvent.trigger from page href link

Discussion in 'Google API' started by srisen2, Apr 1, 2011.

  1. #1
    Hey im calling markers from a database and displaying them as marker$point where $point is the marker row id

    here is the marker creation in the header

    var point$postid = new GLatLng($latitude2, $longitude2);
    var html_text$postid = '<a href=\"post.php?id=$postid\" style=\"color: #87200f; text-decoration: none;\">$title</a><br>$ $price';
    var marker$postid = new Object();
    var marker$postid = new GMarker(point$postid, pin$postid);
    GEvent.addListener(marker$postid, 'click', function() {
    marker$postid.openInfoWindowHtml(html_text$postid);
    });
    map.addOverlay(marker$postid);


    im trying to trigger the GEvent in a link in the body of the page with this function

    function myclickk(marker) {
    GEvent.trigger('' + marker, "click");
    }

    and this link

    echo "<a href=\"myclickk('marker$postid')\" id=\"$postid\" style=\"position: relative; left: 0px; color: #87200f; text-decoration: none;\">show info</a><br>";

    I cant seem to get the link to register ive checked everything. I thought of using the add dom listener or an array which is what im seeing on the working examples but neither seem to work with the php database output that i am using. Does anyone have any ideas on how to get this working?
     
    srisen2, Apr 1, 2011 IP