AnsweredAssumed Answered

Access Attributes for Sub-Layer Within AGSDynamicMapServiceLayer

Question asked by dpmarley on Mar 16, 2012
Latest reply on Mar 19, 2012 by dpmarley
I'm fairly new to the iOS SDK and trying to work through some basic concepts here.  What is the best way to access the attributes (the "attribute table" in old-school GIS terminology) associated with a sub-layer within an AGSDynamicMapServiceLayer?  I am working on an iPad app with a standard split view (map on the right, in detail view; table in left column of split view) where I want to show a set of project locations on the map, and have those projects show as a list in the table on the left. Ultimately I want to have interaction between the map and the table (touch a row in table to zoom to location on map, etc.).  I have the project locations in a feature class, and have that published as a standard AGS Map service.  I have the service/layer loaded into the map as a AGSDynamicMapServiceLayer.

From the documentation, I can see that the AGSGraphic contains an attributes collection, but from the doc it appears I need to run an AGSQueryTask or other task in order to get an AGSFeatureSet containing the graphics/attributes.  Is there a way to get it directly from the AGSDynamicMapServiceLayer that is already in the map?

So I could run a query to return all my records (say with a dummy where clause like "1=1") but this seems like an unnecessary step given that I already have the points on my map.  And if I use a query result to display a graphics layer, then I lose the symbology associated with the layer itself, and have to utilize a client-side graphic to display the points.  This might be OK, but just doesn't seem right when I am wanting to show a feature class in its entirety.

What's the best/recommended approach here?

Thanks in advance,