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:

        var temp=(pathArr[i]+"").split(",");
      //console.log("lat lon "+temp[1]+"   " +temp[0]);
          points[i]= [temp[1],temp[0]];

   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]];
  feature = new ol.Feature({
 geometry: new ol.geom.LineString(points)
  • Is there a question here? Does something not work as expected or is there an error? It isn't clear. Feb 18 '16 at 13:56

See API docs:

  • 1
    @vani if the answer is what you're looking for, mark it as correct. Feb 19 '16 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.