i rewrote the function test and added the funtion infoW. my guess the
problem stemmed from
the for(var i in array)
here's my solution replace the test function and add my infoW function:
//rewritten
function test(){
var array = new Array(new
Array("1","one","1.207977439239313","-77.28482723236084"),
new
Array("2","two","1.2158720961678757","-77.27723121643066"),
new
Array("3","three","1.218532247113931","-77.29014873504639"),
new
Array("4","four","1.2226511853291904","-77.28697299957275"));
for(i=0;i<array.length;i++){
var pointX = new GLatLng(array[i][2], array[i][3]);
var first = array[i][0];
var second = array[i][1];
infoW(pointX,first,second);
//alert(first+"-"+second);
}
}
//show infowindow
function infoW(pointX,first,second) {
var marker = new GMarker(pointX);
map.addOverlay(marker);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(first+"-"+second);
});
}
Merry Christmas to you and yours
jonserr.com
On Wed, Dec 24, 2008 at 11:28 AM, andresscalderon <
[email protected]> wrote:
>
> Hello and Merry Christmas,
>
> I have problems setting the text in an InfoWindow when it come from an
> array (although I'm not sure if the problem is the array), the map is
> at...
>
> http://acalderon.50gigs.net/m/controls.html
>
> when I set the content of the window only the last text is shown in
> all the InfoWindow. What's wrong?, I've tried with slice() and get a
> copy of the variable but I have spend all the day and I cant solve
> it. Please help me, today is Christmas, jejejeje, just a bad joke =).
>
> Happy Holidays!!!
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---