Hi Guys,

I really need some help here.

I have entered 7 data in my database and all the markers' infowindows
are showing the last records.
Any way I can make it work?

Much appreciated.

-----------------------------------------------------------------------------------------------------------------------------------------------------

var marker, i;
var icon = new google.maps.MarkerImage("http://maps.google.com/
mapfiles/ms/micons/blue.png", new google.maps.Size(32, 32), new
google.maps.Point(0, 0),new google.maps.Point(16, 32));

for (i = 0; i < locations.length; i++) {
        getInfoAddress = "No: "+locations[i][3].toString()+" "+locations[i]
[1].toString()+" "+locations[i][2].toString()+" S("+locations[i]
[0].toString()+")";
        geocoder.geocode( { 'address': locations[i][0]}, function(results,
status) {
                if (status == google.maps.GeocoderStatus.OK) {
                        marker = new google.maps.Marker({
                                position: results[0].geometry.location,
                                map: map,
                                //animation: google.maps.Animation.BOUNCE,
                                icon: icon
                        });
                        var popup = new google.maps.InfoWindow({});
                        google.maps.event.addListener(marker, 'click', function 
() {
                                popup.setContent(getInfoAddress);
                                popup.open(map, marker);
                        });
                } else {
                        alert("Geocode was not successful for the following 
reason: " +
status);
                }
        });
}
-----------------------------------------------------------------------------------------------------------------------------------------------------

-- 
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.

Reply via email to