I seem to have addressed the issue by re-calling the data from xml in
creating and calling the info window, rather than referencing the
marker and another variable to fill and place the window. I've
updated the xml and xsl files with the new code.
So I replaced this code:
var contentString = '<xsl:value-of select="name"/>';
var infowindow = new google.maps.InfoWindow({
content: contentString
});
var stnLatLng = new google.maps.LatLng(<xsl:value-of select="lat"/
>,<xsl:value-of select="long"/>);
var marker = new google.maps.Marker({
position: stnLatLng,
map: map,
title:"<xsl:value-of select="name"/>"
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
with this:
var stnLatLng = new google.maps.LatLng(<xsl:value-of select="lat"/
>,<xsl:value-of select="long"/>);
var marker = new google.maps.Marker({
position: stnLatLng,
map: map,
title:"<xsl:value-of select="name"/>"
});
google.maps.event.addListener(marker, 'click', function() {
var infowindow = new google.maps.InfoWindow({
position: new google.maps.LatLng(<xsl:value-of select="lat"/
>,<xsl:value-of select="long"/>),
content: "<xsl:value-of select="name"/>"
});
infowindow.open(map);
});
and now it seems to work.
--
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.