Display Form, Zoom to Selected feature
It seems that I should be able to use a Display Form that shows a list of features, then have the user select a feature and zoom to it, without having to use Select Features and go back the the server to get a feature set.
I already have a list of features, I set the list box item to display a value from some culumn and then the value of that list box to hold the Shape.
Why can't I just take that shape and then set the extent of the map?
Is this just my inexperience with Workflows??
Of is there a way to take the String value of Shape and convert it to an Envelope, then use that Envelope to set the map extent?
Any help is appreciated!
-bert
-
> I already have a list of features, I set the list box item to display a value from some culumn and then the value of that list box to hold the Shape. Why can't I just take that shape and then set the extent of the map?
From (http://help.arcgis.com/en/webapi/silverlight/apiref/api_start.htm) http://help.arcgis.com/en/webapi/silverlight/apiref/api_start.htm,
(1) ESRI AGS API of SL: a list of features: IList<Graphic>
(2) ESRI AGS API of SL: Graphic has a public property called 'Geometry' (you call this as Shape field value of the feature, right?)
(3) ESRI AGS API of SL: Geometry contains a public property called 'Extent'
(4) Gcx WF has an activity called 'SetMapExtent' which takes a Envelope.
(5) Gcx DataItem(name, value)
Having said that, your datasource of the listbox should have a DisplayField Value (DataItem Value) from the extent of the feature's geometry, and a Display Name (DataItem Name) from any distinctive Featurs' attribute.
So create a variable for the list of DataItem as the input of the listbox.
And populate the DataItem with the Extent, and distintive attribute value of the features, and assign each DataItem to the list, and assign the list of dataItem as the input to the listbox.
then get the selected listbox item as the value of the SetMapExtent activity.
It should work.
Since Shape field value of the feature is different depending on the GEometry type, you may consider that depending on the geometry type too.
wish this helps you out.
Munhwan
0
Please sign in to leave a comment.
Comments
1 comment