bluewalrus
12-09-2010, 05:49 PM
I've got this code which creates a google map. The map part is fine currently but the syntax of the for I think is off because it is only processing once. Does anyone see something wrong with it? Thanks.
for (var i = 0; i < 5; i++) {
var location = new google.maps.LatLng(lat[i], lng[i]);
var marker = new google.maps.Marker({
position: location,
map: map
});
var bounds = new google.maps.LatLngBounds(lat[i], lng[i]);
map.fitBounds(bounds);
map.fitBounds(bounds);
map.setCenter(location);
alert(i);
}
Here's a link as well:
http://174.120.151.156/~crazychr/test2.html
for (var i = 0; i < 5; i++) {
var location = new google.maps.LatLng(lat[i], lng[i]);
var marker = new google.maps.Marker({
position: location,
map: map
});
var bounds = new google.maps.LatLngBounds(lat[i], lng[i]);
map.fitBounds(bounds);
map.fitBounds(bounds);
map.setCenter(location);
alert(i);
}
Here's a link as well:
http://174.120.151.156/~crazychr/test2.html