Segment segment = new Line(); segment.setStart(startPoint); segment.setEnd(endPoint); Log.d("SEGMENT", "x: " + segment.getStartX() + "y: " + segment.getStartY()); Symbol lineSymbol = new SimpleLineSymbol(Color.BLUE, 4); someGraphicsLayer.addGraphic(new Graphic(segment, lineSymbol));
Solved! Go to Solution.
Polyline poly = new Polyline(); poly.startPath(startPoint); poly.lineTo(endPoint); allyGraphicsLayer.addGraphic(new Graphic(poly, new SimpleLineSymbol(Color.BLUE, 5)));
try
{
Segment segment = new Line();
segment.setStart(startPoint);
segment.setEnd(endPoint);
Log.d("SEGMENT", "x: " + segment.getStartX() + "y: " + segment.getStartY());
Polyline pLine = new Polyline();
pLine.addSegment(segment, true);
Symbol lineSymbol = new SimpleLineSymbol(Color.BLUE, 4);
int addedGraphicId = someGraphicsLayer.addGraphic(new Graphic(pLine, lineSymbol));
Log.d("Class/activity name for logging", "Graphic added id=" + addedGraphicId);
}
catch (Exception ex)
{
// log exception ex.getMessage()
}
So, for graphics you should use Point, Polyline or Polygon.