views:

415

answers:

1

Created a google map with GMap2 and put pinpoints on there that open up a balloon with the address when the pinpoint is clicked.

I would like users to be able to click text on the page itself and use jquery to open up the corresponding balloon. However I can't figure out the ID to use to call a jquery click event. Basically I've got a store listing down the left side and when user clicks store name I want it to open up the corresponding balloon.

GEvent.addListener(marker_500, "click", function ()
{
map.openInfoWindowHtml(point, myHtml);
}

Any idea what element tied to this click event is?

Tried

$("#marker_500").click();

And that doesn't work. Also tried alerting $(this).attr('id'); inside the click function and that is undefined. thanks jason

+1  A: 

Check this out:

http://econym.org.uk/gmap/example_map15.htm

The above link will help you out in your specific case. The link given below is a comprehensive tutorial with respect to google maps.

http://econym.org.uk/gmap/

HTH

Raja
Nice..thanks. I actually just got it to work using basically the same method. I had the google maps code loading onready. And the maps object wasn't available in my jquery click event. Taking it out of onready $(".googleMapBubbleLink").click(function () { var currentStoreID = $(this).attr("storeID"); map.openInfoWindowHtml(eval('point_' + currentStoreID), eval('myHtml_' + currentStoreID)); });
Jason
@Jason - cool. I am glad that it worked for you.
Raja