Hey all, i have another one that has me stumped.. yeah, i know.
This one is regarding my info windows that go along with my markers.
Everything loads fine, but if the map is moved, the content of the markers
get shifted.
here is the code that draws the markers, and the page is at
http://texaspivot.com:3000/pivrain3
function makeMarker(data, marker_array){
var marker = new google.maps.Marker({
position: new google.maps.LatLng(data.lat, data.lng),
icon: data.image,
title: data.title
});
var content = document.createElement("DIV");
content.style.height = "300px";
content.style.width = "500px";
content.style.margin = "10px";
content.innerHTML = data.info_html;
var infowindow = new google.maps.InfoWindow({
content: content
});
// Open the infowindow on marker click
google.maps.event.addListener(marker, "click", function() {
infowindow.setContent(data.info_html);
infowindow.open(map, marker);
});
// Add another event to close the marker if the map is clicked
elsewhere
google.maps.event.addListener(map, "click", function(){
infowindow.close();
});
marker_array.push(marker);
}
for (index in marker_stats_a) makeMarker(marker_stats_a[index],
markers_array_a);
thanks for any tips.
sk
--
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.