I'm getting some information from an API. I'm calling the geocoder to
get the point and then create my marker, with some text for the info
windows. My marker are placed on the map without a problem.

But when I click on the marker, it always display the same text. I
can't figure out how to 'pre-populate' the info window so when I click
on the marker it displays the correct information ...

function createMarker(point, text) {
alert('point: ' + point + 'text: ' + text)
var html ="<div class='infowindow'><strong>"+ text + "<\/strong><\/
div>";
//var marker = new GMarker(point, markerOptions);
var marker = new google.maps.Marker({
    map: map,
    position: point
});

infowindow = new google.maps.InfoWindow({
    content: html
});

google.maps.event.addListener(marker, 'click', function() {
    infowindow.open(map, marker);
});

return marker;
}

I hope it's clear enough! I'm using the google API V3

You can check the result in here: www.pukkafish.com/api/linkedin. You
will need a linkedIn account

-- 
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 google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to