Wednesday, 7 October 2015

arcgis javascript api - Polyline not showing on esri maps


I have list of points. I am pushing these points to an array. Now when i draw polyline through esri map graphics.add then its not shwoing anything.


My code for drawing polyline on esri map is as follows:


  var Points = new Array();
var PointsGoogle = new Array();
for (VIndex = 0; VIndex < ItemList.Coordinates.length; VIndex++)
{
latlng = new esri.geometry.Point(ItemList.Coordinates[VIndex].X,ItemList.Coordinates[VIndex].Y);


Points.push(latlng);

// polyline.addPath([new esri.geometry.Point(10,10), new esri.geometry.Point(20,20), new esri.geometry.Point(30,30)]);
}

var polylineSymbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([204, 102, 51]), 4);
var polyline = new esri.geometry.Polyline(esrimap.spatialReference);
polyline.addPath(Points);
esrimap.graphics.add(new esri.Graphic(polyline, polylineSymbol));


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...