[GIS] ArcGIS API for JavaScript: Draw a Tracker Line from GPS points

arcgis-javascript-apitracking

I have gps points which sent from tacker device I need to draw a line in openstreet map ArcGIS with Javascript, How can I do this. I can convert gps points to any format that needs to be (XML, JSON, GPX…) and I have time with lat and lon if needed.

I am new with ArcGIS API for Javascript.

34.673876,68.790897
34.673876,68.790897
34.673876,68.790897
34.673876,68.790897
34.673876,68.790897

I want something like this but ArcGIS its google:

http://jsfiddle.net/pintu31/EPM6A/2/

Best Answer

firstly, create a polyline

 var polyline = new Polyline(new SpatialReference({wkid:4326}));

after define path array,

var path = []
path.push(new Point(34.673876,68.790897));
path.push(new Point(34.673876,68.790897));
path.push(new Point(34.673876,68.790897));
path.push(new Point(34.673876,68.790897));
path.push(new Point(34.673876,68.790897));

and finally add path to polyline

polyline.addPath(path);
//add to map
map.graphics.add(new Graphic(polyline,new SimpleLineSymbol());