Set MapExtent (Point Feature)
Hi
I'm having trouble zooming into a point feature thru workflow;
I'm using the
1) SelectFeatures Activity to create a featureset containing a single point
2) GetFeatureSetExtent to get the FeatureSet Envelope
3) SetMapExtent using the FeatureSet Envelope
The workflow does not zoom to the point feature.
I'm guessing it's not displaying the single point because my xmin = xmax and ymin = ymax. If so, what is the best way to increase the bounding box of the featureset_envelope?
-
dump...
Doesn't anyone know how to assign an extent to the envelope?
fs_envelope(????)
0 -
Hi Kenneth
Did you mean bump as compared to dump? /customer/servlet/servlet.FileDownload?file=00P6000000e87wBEAQ
I am sorry that you had to wait for a reply. /customer/servlet/servlet.FileDownload?file=00P6000000e87w6EAA
Anyway have a look at this:
<Activity mc:Ignorable="sap" 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:s3="clr-namespace:System;assembly=System.ServiceModel" xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<x:Members>
<x:Property Name="argument1" Type="InArgument(x:String)" />
</x:Members>
<sap:VirtualizedContainerService.HintSize>1264,1354</sap:VirtualizedContainerService.HintSize>
<mva:VisualBasic.Settings>Assembly references and imported namespaces serialized as XML namespaces</mva:VisualBasic.Settings>
<Sequence sap:VirtualizedContainerService.HintSize="1224,1314" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">
<Sequence.Variables>
<Variable x:TypeArguments="esri:MapPoint" Name="myPoint" />
<Variable x:TypeArguments="esri:Envelope" Name="myExtent" />
<Variable x:TypeArguments="esri:Geometry" Name="myGeom" />
<Variable x:TypeArguments="x:Int32" Default="100" Name="extentRadius" />
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<gwa1:RunExternalCommand CommandName="ClearMarkupQuiet" sap:VirtualizedContainerService.HintSize="1202,82" />
<gwa1:ConfigureWorkflowContainer sap:VirtualizedContainerService.HintSize="1202,174" IsBusy="[True]" Message="Click on map" ShowContainer="[True]" Title="Zoom to click" WorkflowContainerName="Default" />
<gwa1:CaptureGeometry CaptureType="[Geocortex.Workflow.Activities.GeometryCaptureType.MapPoint]" sap:VirtualizedContainerService.HintSize="1202,82" Result="[myGeom]" />
<gwa1:Cast x:TypeArguments="esri:MapPoint" sap:VirtualizedContainerService.HintSize="1202,57" To="[myPoint]">
<gwa1:Cast.Value>
<InArgument x:TypeArguments="x:Object">[myGeom]</InArgument>
</gwa1:Cast.Value>
</gwa1:Cast>
<Assign sap:VirtualizedContainerService.HintSize="1202,57">
<Assign.To>
<OutArgument x:TypeArguments="esri:Envelope">[myExtent]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="esri:Envelope">[New Envelope()]</InArgument>
</Assign.Value>
</Assign>
<Parallel sap:VirtualizedContainerService.HintSize="1202,103">
<Assign sap:VirtualizedContainerService.HintSize="242,57">
<Assign.To>
<OutArgument x:TypeArguments="x:Double">[myExtent.XMin]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Double">[myPoint.X - extentRadius]</InArgument>
</Assign.Value>
</Assign>
<Assign sap:VirtualizedContainerService.HintSize="242,57">
<Assign.To>
<OutArgument x:TypeArguments="x:Double">[myExtent.YMin]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Double">[myPoint.Y - extentRadius]</InArgument>
</Assign.Value>
</Assign>
<Assign sap:VirtualizedContainerService.HintSize="242,57">
<Assign.To>
<OutArgument x:TypeArguments="x:Double">[myExtent.XMax]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Double">[myPoint.X + extentRadius]</InArgument>
</Assign.Value>
</Assign>
<Assign sap:VirtualizedContainerService.HintSize="242,57">
<Assign.To>
<OutArgument x:TypeArguments="x:Double">[myExtent.YMax]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Double">[myPoint.Y + extentRadius]</InArgument>
</Assign.Value>
</Assign>
</Parallel>
<gwa1:SetMapExtent Extent="[myExtent]" sap:VirtualizedContainerService.HintSize="1202,59" />
<gwa1:ConfigureWorkflowContainer sap:VirtualizedContainerService.HintSize="1202,174" IsBusy="[True]" Message="Click on map" ShowContainer="[False]" Title="Zoom to click" WorkflowContainerName="Default" />
<gwa1:RunExternalCommand CommandName="AddMarkup" CommandParameter="[myGeom]" sap:VirtualizedContainerService.HintSize="1202,82" />
</Sequence>
</Activity>Thanks
Ralph
0 -
I meant bump :) but I guess dump will would work too..... :)
Thx Ralph...I can see the assignment of the extent to the envelope. Much appreciated!
0 -
This workflow looks like it captures a user's point clicked on the map?
I'm at a loss as to how I can incorporate this into my workflow after the query task and selection task to zoom to the point?
Thanks0 -
HI Lauren,
I'm assuming you have a featureset containing a single point.
In Ralphs example the key points are;
1) "Get FeatureSet Exent" Activity to get the extent of your point in an "Envelope"
2) The "Assign" to increase the extent of the Envelope in a Parallel activity then
3) use the SetMapExtent to zoom to the point.
0 -
Hi Lauren
my workflow was an example only of how to get a MapPoint. In your case the MapPoint is the geometry of a Graphic in a Featureset. I have found that the key to getting your head around this stuff is getting some handle on what objects you are dealing with.
One place to start is here: http://resources.arcgis.com/en/help/silverlight-api/apiref/api_start.htm
and here to jump in to looking at what a Featureset is: http://resources.arcgis.com/en/help/silverlight-api/apiref/api_start.htm?ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.FeatureSet_members.html#PropertiesBookmark
On the face of it hard reading but worth the effort. ;-)
Best of luck
Ralph
0 -
Using the example I've tried to create a new envelope by expanding a map point using an assign. This is failing and I don't know why. What am I missing here?
/customer/servlet/servlet.FileDownload?file=00P6000000e88K0EAI
/customer/servlet/servlet.FileDownload?file=00P6000000e88KOEAY
0 -
Your assignment should be;
Envelope2.Xmin = MapPoint3.Xmin - extent
Envelope2.Ymin = MapPoint3.Ymin - extent
Envelope2.Xmax = MapPoint3.Xmax + extent
Envelope2.Ymax = MapPoint3.Ymax + extent
0 -
@Lauren,
Hi, we are stuck at exactly the same point as you. Did you find a way to get the result of the querytask (1 point) into the envelope?
Thanks.
0 -
Have used Ralph's posted example of how to populate point geometry into a new envelope. But when I assign myExtent = New Envelope()
I receive this error below. Do any of you know what the solution to this is?.....Walter
/customer/servlet/servlet.FileDownload?file=00P6000000eltpCEAQ
0 -
In Ralph's example, his syntax for the parallel>assign section is different than what you've stated:
Ralph has:
myExtent.XMin = mypoint.X - extentRadius
myExtent.YMin = mypoint.Y - extentRadius
myExtent.XMax = mypoint.X + extentRadius
myExtent.YMax = mypoiint.Y + extentRadius
When I try your similar line..... Envelope2.Xmin = MapPoint3.Xmin - extent an exclamation point appears in the assign box.
But even when I try to run Ralph's example through the simulator, I still get an error in the parallel>assign portion...."Object not set to an instance of an Object"
Does anyone have a solution for this?
Walter
0 -
Hi Walter
if you read the error message that you are getting in English it is telling you that yes you are making asking the code processor to make a new Envelope but it does not know what sort of Envelope, a Geocortex.Gis.Geometries.Envelope OR a ESRI.ArcGIS.Client.Geometry.Envelope.
so change your Assign to be:
envelope2 = New ESRI.ArcGIS.Client.Geometry.Envelope()
and then the processor will know what to do with it.
Have you also set a Variable for envelope2 to be of Variable Type ESRI.ArcGIS.Client.Geometry.Envelope to cover all you bases?
Regards
Ralph
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
12 Kommentare