how to draw line between two point

2980
2
10-13-2011 06:45 AM
yanli
by
New Contributor II
how to  draw a line between two point as knows?
 var point:MapPoint =new MapPoint(118.8021, 32.0702);
   var point2:MapPoint =new MapPoint(118.8029, 32.0684);



how to draw a line ?
Tags (2)
0 Kudos
2 Replies
by Anonymous User
Not applicable
I had to do something like this the other day, Ill post if anyone still needs it:

var startPoint:MapPoint = new MapPoint(geom.x, geom.y);
var endPoint:MapPoint = new MapPoint(endX,endY);
     
//Create polyline between these points
var newPath:Array = [];
newPath.push(startPoint,endPoint);
    
var polyline:Polyline = new Polyline([newPath], geom.spatialReference);
0 Kudos