Zoom for single selected feature
Hello,
I'm relatively new to Geocortex and workflows but I'm struggling with what I think should be a simple task. We have a simple 'select by parcel ID' tool that auto completes so it will only ever return one unique polygon. What I would like my workflow to do is zoom automatically to the parcel and highlight it, without having to click it on the side Results window in the Silverlight viewer.
I have tried to use the 'set map extent' tool but can't figure out how to set the FeatureSet as an envelope. I have also tried to buffer the feature and set the geometry as a graphic to zoom to that, but haven't had much luck. Any suggestions would be much appreciated! Thanks!
-Blair
-
Hi Blair,
Try using the following syntax to get the extent of the feature from the feature set:
myFeatureSet.Features.First.Geometry.Extent()
Note: This assumes that you only have one feature returned. You will also have to Import System.Linq to use First
-Victoria
0 -
Hi Victoria and Blair
I have found that :
myFeatureSet.Features(0).Geometry.Extent
also works and doesn't need the System.Linq namespace to work
Thanks
Ralph
0 -
Thanks Ralph!
That worked first try! Are these extra actions just tricks you pick up along the way or is there any solid documentation (link?) out there that can be used? I am finding that the guessing game combined with forum chatter isn't usually getting me answers all that fast...
Thanks for the help!
-Blair0 -
Hi Blair
I guess it starts with understanding what is being returned. ie what is a FeatureSet? (read http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.FeatureSet_members.html )
FeatureSet.Features gives you an IList(Of Graphic) (Graphic is an ESRI object, read further here: http://help.arcgis.com/en/webapi/silverlight/apiref/api_start.htm )
IList is a .net framework object (http://msdn.microsoft.com/en-us/library/5y536ey6.aspx) http://msdn.microsoft.com/en-us/library/5y536ey6.aspx (Try google search for .net IList )
Forum chatter is a bit like a field of icebergs, the background information that you need doesn't always show above the surface (in the forums)
Hope that helps as to how I figure some of these these issues
Regards
Ralph
0
Please sign in to leave a comment.
Comments
4 comments