hello can anyone help me debug little error that my eyes seem to be skipping. error is: unexpected ( error. Are my array syntex correct?
function SourceClusting()
{
// grabbing count
var table = document.getElementById('OSDataCount');
var counter= table.rows[1].children[0].innerHTML
// putting all variable into arrays
var latitude()
var longitude()
var i
var marker =[];
// placing values into arrays
for (i=1;i == counter;i++)
{
longitude[i]=table.rows[i].children[6].innerHTML;
latitude[i]=table.rows[i].children[5].innerHTML;
marker[i]=new GMarker(new GLatLng(longitude[i],latitude[i]));
}
var markerCluster = new MarkerClusterer(map, marker);
}
cheers
Quite a few things:
parseInt()the string you get fromvar counter = ..., as a string can’t be used in comparisons with integers the way you’d like.var latitude = ()should bevar latitude = [], as it’s an array, Don’t forget those semicolons!==.iwithin it.Try this new, possibly working code: