I'm stuck trying to loop through this array of GPS coordinates that puts pins on the google map.
Here is my code: http://pastie.org/466369
The problem is on line 27-36.
If I change it to the following, it will place 1 pin on that exact location, but I want it to loop through the array so I can add multiple pins:
//var markers = [];
for (var i = 0; i < 1; i++) {
var point = new GLatLng(39.729308,-121.854087);
marker = new GMarker(point);
map.addOverlay(marker);
markers[i] = marker;
}
Anyone know why this version below is breaking?
var markers = [
(39.729308,-121.854087),
(39.0,-121.0)
];
for (var i = 0; i < markers.length; i++) {
var point = new GLatLng(markers[i]);
marker = new GMarker(point);
map.addOverlay(marker);
markers[i] = marker;
}