var line = new esri.geometry.Polyline(new esri.SpatialReference( {wkid:102100} )); var path = new Array(); for (i=0; i<xPoints.length; i++) { coords = '[' + xPoints + ',' + yPoints + ']'; path.push(coords); } alert(path); line.addPath(path); alert(line.paths);
var coords = []; var polyline = new esri.geometry.Polyline(new esri.SpatialReference({wkid:102100})); for (i=0;i < xPoints.length -1;i++){ coords.push([xPoints, yPoints]); } polyline.addPath(coords);
It is possible to add a midpoint without having the coordinate (only having the first and last point)?