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.
Here's a link as well:Code: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); }
http://174.120.151.156/~crazychr/test2.html



Reply With Quote

Bookmarks