var pA:Array; pA = []; //just some loop to add all your XYs for your lines points for (m=0; m<gArrObj.length; m++){ pA.push(new MapPoint(X,Y,new SpatialReference(102100))); } var pLine:Polyline = new Polyline(null,new SpatialReference(102100)); pLine.addPath(pA); var gra:Graphic = new Graphic(pLine); graphicsLayer.add(gra);
the hurricane map looks like it is consuming a feed with the track data so the line is pre-rendered.
Are you looking for a way to make a service that updates itself when the points of the line change (like from an event theme) or actually having someone enter two coordinates in the flexviewer, and having it draw the line?
R_
Lefteris,
Drawing a line programatically is quite simple you just create an array of points and add them to a polylines path.var pA:Array; pA = []; //just some loop to add all your XYs for your lines points for (m=0; m<gArrObj.length; m++){ pA.push(new MapPoint(X,Y,new SpatialReference(102100))); } var pLine:Polyline = new Polyline(null,new SpatialReference(102100)); pLine.addPath(pA); var gra:Graphic = new Graphic(pLine); graphicsLayer.add(gra);
In that case, it looks like Robert has put you on the right track.
R_
Lefteris,
I am not sure if there is question in your last post or not...?