What please is the html to trigger a marker's balloon? I want to place
a list of places next to the map, and have a balloon trigger when a
name is clicked. I am writing a V3 version that will do something
similar to this which is written in V2:
http://www.mandy.com/1/mapshow.cfm?tr=asns&sc=0prd<d=-33.8&lgd=151
I'm guessing it will looking something like this:
<a href="javascript:infowindow.open(map, marker1)">Mary</a>
<a href="javascript:infowindow.open(map, marker2)">Fred</a>
Here's how I am creating markers and balloons in the V3 script:
var infowindow = new google.maps.InfoWindow();
var marker1 = new google.maps.Marker({ position: new
google.maps.LatLng(51.01, -2.01), map: map, title: 'mary' });
google.maps.event.addListener(marker1, 'click', function() {
infowindow.setContent('Hello Mary');
infowindow.open(map, marker1);
});
var marker2 = new google.maps.Marker({ position: new
google.maps.LatLng(51, -2), map: map, title: 'fred'});
google.maps.event.addListener(marker2, 'click', function() {
infowindow.setContent('Hello Fred');
infowindow.open(map, marker2);
});
Thanks!!
John
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.