+ Reply to Thread
Results 1 to 3 of 3

Thread: Access Attributes for Sub-Layer Within AGSDynamicMapServiceLayer

  1. #1
    David Marley
    Join Date
    Apr 2010
    Posts
    90
    Points
    1
    Answers Provided
    0


    0

    Default Access Attributes for Sub-Layer Within AGSDynamicMapServiceLayer

    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,

    Dave
    David Marley, GISP | Sr. Geospatial Developer
    Geographic Information Services, Inc.

  2. #2
    Nimesh Jarecha

    Join Date
    Oct 2009
    Posts
    883
    Points
    493
    Answers Provided
    106


    0
    This post is marked as the answer

    Default Re: Access Attributes for Sub-Layer Within AGSDynamicMapServiceLayer

    The AGSDynamicMapServiceLayer you see in a map is nothing but an image of the map. So you cannot get attributes of the features from an image. Hence, you have to execute a query task to get the features as graphics.

    Based on your description the best recommended approach would be to load all layers as AGSFeatureLayer and you'll get all graphics in a map with attributes and symbology defined in the service.

    Hope this helps!

    Regards,
    Nimesh

  3. #3
    David Marley
    Join Date
    Apr 2010
    Posts
    90
    Points
    1
    Answers Provided
    0


    0

    Default Re: Access Attributes for Sub-Layer Within AGSDynamicMapServiceLayer

    Thanks for the clarification Nimesh. I had come to the same conclusion about the AGSDynamicMapServiceLayer and have been trying the Query approach - it seems like I can do what I need using query. The idea of using an AGSFeatureLayer is a good one...I will definitely explore that as well.

    Thanks,

    Dave
    David Marley, GISP | Sr. Geospatial Developer
    Geographic Information Services, Inc.

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts