deeptivb

Selected Feature Geometry error for a zoom to selected functionality

Discussion created by deeptivb on Jan 24, 2011
Latest reply on Dec 5, 2011 by ahoque-esristaff
Hello,

I am a newbie with Silverlight/ArcGIS server development. I am developing a web app in ArcGIS Server 10, Silverlight 3, VS 2010. This is an upgrade to an app which was working in ArcGIS 9.x, VS 2008, Silverlight 2.

I am accessing an SDE layer and trying to zoom into the record that user inputs in an autocomplete box. It gets the selected feature but SelectedFeature.Geometry comes back as nothing, when it is expecting polygon geometry.

I have the map service and the geometry service running on the server, tabular queries are coming back fine, it is the spatial queries which do not work. If I change the dynamic map service to my old map service(ArcGIS 9.x,...), the spatial queries also work perfectly.

Has this got anything to do with using SDE layer as the spatial layer? I cannot figure out why the geometry of the selected feature comes back as nothing from the new service. Something to do with Silverlight/ArcGIS 10 upgrade I s'pose. Found a thread, which explains the same problem as mine, but it does not seem to have addressed the geometry part? Any help is appreciated.

Calling all experts

TIA

-Deepti

Dim featureSet As FeatureSet = args.FeatureSet

If featureSet IsNot Nothing AndAlso featureSet.Features.Count > 0 Then
Dim selectedFeature As Graphic = featureSet.Features(0)

Dim selectedFeatureExtent As ESRI.ArcGIS.Client.Geometry.Envelope = selectedFeature.Geometry.Extent

     Dim expandPercentage As Double = 300
     Dim widthExpand As Double = selectedFeatureExtent.Width * (expandPercentage / 100)
     Dim heightExpand As Double = selectedFeatureExtent.Height * (expandPercentage / 100)

 Dim displayExtent As New ESRI.ArcGIS.Client.Geometry.Envelope(selectedFeatureExtent.XMin - (widthExpand / 2), selectedFeatureExtent.YMin - (heightExpand / 2), selectedFeatureExtent.XMax + (widthExpand / 2), selectedFeatureExtent.YMax + (heightExpand / 2))

 MyMap.ZoomTo(displayExtent)

Outcomes