I am using the code to get line string feature.when ever i am using coord2 array i am getting correct line string but whenever i am using points array i am not getting correct line string .I have observed that coordinate values in points array are stored in same format as in coord2 array.
This is my code:
for(i=0;i<pathArr.length;i++)
{
var temp=(pathArr[i]+"").split(",");
//console.log("lat lon "+temp[1]+" " +temp[0]);
points[i]= [temp[1],temp[0]];
}
//window.alert(points);
var coord2=[[76,22],[77,24],[78,25],[66,12],[65,15],[76,22],[77,24],[78,25],[66,12],[65,15] ,[76,22],[77,24],[78,25],[66,12],[65,15],[78,25], [66,12],[65,15],[76,22]];
window.alert(coord2);
feature = new ol.Feature({
geometry: new ol.geom.LineString(points)
});