Draw a line (graphic) between to sets of coordinates?
I have a workflow that generates to sets of coordinates. I would like to then draw a line between these two points and add it as a graphic to the map. Adding points to the map is no problem, but I haven't been able to figure out how to create the line. I've searched for examples, but I haven't found anything. Does anyone know where I can find examples of adding linear graphics to a map via a workflow?
Thank you,
Stephanie
0
-
Hello Stephanie,
This is currently not possible; I'll create a feature request for this behaviour.
It is possible to snap the plotted coordinates to features within a layer, which you could then snap a drawing between the same two locations.Thanks, Stefan
0 -
Hi Stefan
are you saying it is not possible to create a straight line between two points or add linear graphics? As I also would like to add graphics to a worklow (e.g my users create a point and I would like to buffer that point within a range of 150m as a graphic as they need to draw the next point 150m away). I cannot work out a way to do this yet.0 -
You should first create a PointCollection and fill it with the two points.
http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Geometry.PointCollection.html
Create a new PolyLine and add the pointcollection as a path.
http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Geometry.Polyline_members.html
You could add the line to the viewer with e.g. a Run External Command activity with command AddMarkup, or with the Update Graphics Layer activity.0 -
Hi Sylvia,
This is possible through workflow, but not directly on the map using existing tools. Thank you Marshall for providing your sample!
Stefan
0
Please sign in to leave a comment.
Comments
4 comments