Start up workflow to zoom in specified point from url string
I am trying to create a workflow that will take a lat/long from a url string from an external program and automatically zoom to the specified location and also add a point at the same time.
This is going to be used with a crime reporting type of project where a new crime is reported and a user can click a button that will open the geocortex map with the lat/long in the url and zoom to and add a point at the specified location.
Help?
-
These are the steps:
-Create workflow that has Lat and Long arguments that zooms to point.-Add workflow to Essentials (don't do anything with the parameters here).
-Set that workflow as the startup workflow.
-When you launch your viewer try something like this: www.server.com/yourviewer/viewer.html?Lat=48.425897&Long=-123.369684
Post back if you need help with any step in particular.
Kevin
0 -
Try something like this out:
Use the built in argument passing capabilities and get rid of the url manipulation. (X and Y)
Assign X and Y to a new mappoint.
Add some geometry to the point with a buffer activity.
Set map extent to the geometry of the point.
<Activity mc:Ignorable="sap sads" x:Class="{x:Null}" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:eac="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client" xmlns:eacg="clr-namespace:ESRI.ArcGIS.Client.Geometry;assembly=ESRI.ArcGIS.Client" xmlns:eact="clr-namespace:ESRI.ArcGIS.Client.Tasks;assembly=ESRI.ArcGIS.Client" xmlns:esri="http://schemas.esri.com/arcgis/client/2009" xmlns:gce="clr-namespace:Geocortex.Core.Extensions;assembly=Geocortex.Core" xmlns:gfc="clr-namespace:Geocortex.Forms.Client;assembly=Geocortex.EssentialsWpfApi" xmlns:gfci="clr-namespace:Geocortex.Forms.Client.Items;assembly=Geocortex.EssentialsWpfApi" xmlns:gr="clr-namespace:Geocortex.Reporting;assembly=Geocortex.Reporting" xmlns:gwa="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow" xmlns:gwa1="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow.Activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=System.Core" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=mscorlib" xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities" xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:sc="clr-namespace:System.Collections;assembly=mscorlib" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:sw="clr-namespace:System.Windows;assembly=PresentationFramework" xmlns:sw1="clr-namespace:System.Windows;assembly=WindowsBase" xmlns:sw2="clr-namespace:System.Windows;assembly=PresentationCore" xmlns:swt="clr-namespace:System.Windows.Threading;assembly=WindowsBase" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <x:Members> <x:Property Name="X" Type="InArgument(x:String)" /> <x:Property Name="Y" Type="InArgument(x:String)" /> </x:Members> <sap:VirtualizedContainerService.HintSize>546,1339</sap:VirtualizedContainerService.HintSize> <mva:VisualBasic.Settings>Assembly references and imported namespaces serialized as XML namespaces</mva:VisualBasic.Settings> <Sequence sap:VirtualizedContainerService.HintSize="506,1259" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces"> <Sequence.Variables> <Variable x:TypeArguments="esri:MapPoint" Default="[new MapPoint()]" Name="mapPoint" /> <Variable x:TypeArguments="scg1:IEnumerable(esri:Graphic)" Name="results" /> <Variable x:TypeArguments="esri:SpatialReference" Name="spatialRef" /> </Sequence.Variables> <sap:WorkflowViewStateService.ViewState> <scg1:Dictionary x:TypeArguments="x:String, x:Object"> <x:Boolean x:Key="IsExpanded">True</x:Boolean> </scg1:Dictionary> </sap:WorkflowViewStateService.ViewState> <If Condition="[String.IsNullOrEmpty(X) OR String.IsNullOrEmpty(Y)]" sap:VirtualizedContainerService.HintSize="484,1135"> <If.Else> <Sequence sap:VirtualizedContainerService.HintSize="359,987"> <sap:WorkflowViewStateService.ViewState> <scg1:Dictionary x:TypeArguments="x:String, x:Object"> <x:Boolean x:Key="IsExpanded">True</x:Boolean> </scg1:Dictionary> </sap:WorkflowViewStateService.ViewState> <gwa1:GetMapInfo Height="{x:Null}" Scale="{x:Null}" Width="{x:Null}" Debug="True" sap:VirtualizedContainerService.HintSize="337,161" SpatialReference="[spatialRef]" /> <Assign sap:VirtualizedContainerService.HintSize="337,60"> <Assign.To> <OutArgument x:TypeArguments="esri:SpatialReference">[mapPoint.SpatialReference]</OutArgument> </Assign.To> <Assign.Value> <InArgument x:TypeArguments="esri:SpatialReference">[spatialRef]</InArgument> </Assign.Value> </Assign> <Assign sap:VirtualizedContainerService.HintSize="337,60"> <Assign.To> <OutArgument x:TypeArguments="x:Double">[mapPoint.X]</OutArgument> </Assign.To> <Assign.Value> <InArgument x:TypeArguments="x:Double">[double.Parse(X)]</InArgument> </Assign.Value> </Assign> <Assign sap:VirtualizedContainerService.HintSize="337,60"> <Assign.To> <OutArgument x:TypeArguments="x:Double">[mapPoint.Y]</OutArgument> </Assign.To> <Assign.Value> <InArgument x:TypeArguments="x:Double">[double.Parse(Y)]</InArgument> </Assign.Value> </Assign> <gwa1:BufferTask Distance="1000" Geometry="[mapPoint]" GeometryServiceUrl="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer" sap:VirtualizedContainerService.HintSize="337,261" Results="[results]" Unit="[ESRI.ArcGIS.Client.Tasks.LinearUnit.Meter]" /> <gwa1:SetMapExtent Extent="[results.first().Geometry.Extent]" sap:VirtualizedContainerService.HintSize="337,61" /> </Sequence> </If.Else> </If> </Sequence> </Activity>0 -
How do i make this code work?
Store it as a work flow, add the workflow to the viewer, check it as run at startup.
That's it? Please guide.
Thank you.0 -
Hi Naresh
You add it to the Site initially then to the Viewer as an item in the Toolbar / I Want To menu / Context menu depending on where you want to start it from.
Having read your words again it is in the Viewer that you specify what workflow to run at startup such as a Disclaimer workflow.
Since you need to supply args at startup, search the viewer Admini Guide for how to structure the Url
eg http://server.domain.com/vwr/Index.html?run=FindParcel&pid=02503116
Hope that helps more than it confuses
Regards
Ralph Price0
Please sign in to leave a comment.
Comments
4 comments