I am getting a variable amount of lat and lon returned from my database in the following config
lat,lon*lat,lon*lat,lon ect
So I split on the * which works.
Then I split on the , which seems to work if I print the spicific array cell.
When I try and do the below however it all goes to shit.
When I print
cords[0, 0] + cords[0, 1] + "\r\n" + cords[1, 0] + cords[1, 1] + "\r\n" + cords[2, 0] + cords[2, 1] + "\r\n"
and so on every row has the same exact lat and lon
41.47033705-81.93612862
41.47033705-81.93612862
41.47033705-81.93612862
41.47033705-81.93612862
...
I debuged this thing all night last night and then a couple hours tonight and I cant seem to find the error.
var cords = [];
var response = xmlhttp.responseText;
var locs = response.split("*");
for(var len = 0; len < locs.length; len++)
{
var temp = String(locs[len]).split(",");
if (temp.length > 1)
cords.push(temp[0],temp[1]);
}
I have also tried cords.push(temp) which doesnt work either