Add Point Graphic From Lat/Long
I am developing a workflow that allows a user to enter a route and ref post and the map zooms to and creates a point graphic. At this point I get a LAT/LONG returned from our LRS system.
My question is how to use the LAT/LONG string values to generate a point on the map? I assume I have to convert these to a double variable type and I should probably use the 'AddMarkupGeometry' found in the 'RunExternalCommand' tool. What parameters do I set? The documentation is lacking this piece of the puzzle.
Thanks.
-
I think I have the logic down, however, when I run the tool, I get this error:
There was a workflow error running activity: Exception has been thrown by the target of an invocation. Workflow 'Zoom to Route' failed Aborted exception: 'The calling thread cannot access this object because a different thread owns it.'. The calling thread cannot access this object because a different thread owns it.
I have checked the scope of all the variables and they seem okay to me.
This isn't the full code, just the piece that adds the graphics after I retrieve a LAT/LONG in string format:
Lat: 41.7795205378011 Long: -93.5706273723725
<Sequence DisplayName="Create Graphic For Map" sap2010:WorkflowViewState.IdRef="Sequence_3">
<Sequence.Variables>
<Variable x:TypeArguments="x:Double" Name="dblLat" />
<Variable x:TypeArguments="x:Double" Name="dblLong" />
</Sequence.Variables>
<Assign sap2010:WorkflowViewState.IdRef="Assign_29">
<Assign.To>
<OutArgument x:TypeArguments="x:Double">[dblLat]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Double">[Convert.ToDouble(strLat)]</InArgument>
</Assign.Value>
</Assign>
<Assign sap2010:WorkflowViewState.IdRef="Assign_30">
<Assign.To>
<OutArgument x:TypeArguments="x:Double">[dblLong]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Double">[Convert.ToDouble(strLong)]</InArgument>
</Assign.Value>
</Assign>
<Assign sap2010:WorkflowViewState.IdRef="Assign_31">
<Assign.To>
<OutArgument x:TypeArguments="esri:Graphic">[graphicPoint]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="esri:Graphic">[New ESRI.ArcGIS.Client.Graphic()]</InArgument>
</Assign.Value>
</Assign>
<Assign sap2010:WorkflowViewState.IdRef="Assign_32">
<Assign.To>
<OutArgument x:TypeArguments="esri:SpatialReference">[SpatialReference]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="esri:SpatialReference">[New ESRI.ArcGIS.Client.Geometry.SpatialReference(4326)]</InArgument>
</Assign.Value>
</Assign>
<Assign sap2010:WorkflowViewState.IdRef="Assign_33">
<Assign.To>
<OutArgument x:TypeArguments="esri:MapPoint">[mapPointLatLong]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="esri:MapPoint">[New ESRI.ArcGIS.Client.Geometry.MapPoint()]</InArgument>
</Assign.Value>
</Assign>
<Assign sap2010:WorkflowViewState.IdRef="Assign_34">
<Assign.To>
<OutArgument x:TypeArguments="x:Double">[mapPointLatLong.X]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Double">[dblLong]</InArgument>
</Assign.Value>
</Assign>
<Assign sap2010:WorkflowViewState.IdRef="Assign_35">
<Assign.To>
<OutArgument x:TypeArguments="x:Double">[mapPointLatLong.Y]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Double">[dblLat]</InArgument>
</Assign.Value>
</Assign>
<Assign sap2010:WorkflowViewState.IdRef="Assign_36">
<Assign.To>
<OutArgument x:TypeArguments="esri:SpatialReference">[mapPointLatLong.SpatialReference]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="esri:SpatialReference">[SpatialReference]</InArgument>
</Assign.Value>
</Assign>
<Assign sap2010:WorkflowViewState.IdRef="Assign_37">
<Assign.To>
<OutArgument x:TypeArguments="esri:SimpleMarkerSymbol">[simpleMarker]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="esri:SimpleMarkerSymbol">[New ESRI.ArcGIS.Client.Symbols.SimpleMarkerSymbol()]</InArgument>
</Assign.Value>
</Assign>
<gwa1:RunExternalCommand CommandName="AddTemporaryMarkupGeometry" CommandParameter="[mapPointLatLong]" DisplayName="Add Graphic to Map" sap2010:WorkflowViewState.IdRef="RunExternalCommand_4" />
</Sequence>Any help would be appreciated.
0 -
Nice work Rick. This is great!
0 -
Rick,
That's much more elegant than my hack. Thanks!
-Mark
0 -
This is great to create a point and zoom to it. However, I am looking to create a graphic like this:
/customer/servlet/servlet.FileDownload?file=00P6000000em16dEAA
Anyone have a sugesstion on how to accomplish this? I have the required already before I get to this point, I just don't know how to make it a label nor do I know how to add this symbol instead of a generic dot.
Thanks!
0 -
The workflow is cut off and I cannot load it. Can you please repost? 0 -
Sorry about that. Just now saw this post.
https://drive.google.com/open?id=0BxXPgwWy-4d9dmhmRU1TUGQzNUE0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
6 Kommentare