TOC Equivalent In SDK 100.x

724
6
Jump to solution
03-19-2018 09:28 PM
ShiminCai
Occasional Contributor III

Hi,

Our apps are now still on the SDK 10.2.5 and we are thinking to migrate to the SDK 100.2.1...

In our apps there is a key component TOC (table of content) that is built based on the TOC sample code in the SDK 10.2.x. Layer loading and displaying and feature editing etc are all around the TOC and our users are so used to it. It is a must to have after migration.

Looking at the SDK 100.2.1, I couldn't find any classes that could be used to build the TOC... Is there anything in the SDK 100.x that is similar or equivalent to the classes AGSMapContentsTree, AGSMapContentsLayerInfo and AGSMapContentsLegentElement in the SDK 10.2.5? If there is none currently, any plan to add in the future?

Thanks,

Shimin

0 Kudos
1 Solution

Accepted Solutions
MarkDostal
Esri Contributor

Shimin,

Thank you for your question!  Yes, there is an equivalent to those classes in the 100.x releases.  It is the AGSLayerContent protocol, which all layer classes implement, since the base class AGSLayer implements it.  It will have everything you need to construct a TOC.  The documentation for AGSLayerContent can be found here:  ArcGIS Runtime SDK for iOS: Protocol Reference 

We have not yet provided a TOC sample or Toolkit component, but there is a Legend Toolkit component.  The legend will loop through all of the map/scene's operational layers, recursively going through all sublayers to build the legend.  The methodology in there will be very similar to that of a TOC.  You can find it here:  GitHub - Esri/arcgis-runtime-toolkit-ios: Toolkit components that will simplify your iOS app develop... 

The source code is provided and can be found in that GitHub repo here:  arcgis-runtime-toolkit-ios/LegendViewController.swift at master · Esri/arcgis-runtime-toolkit-ios · ... 

Let us know if you need more help or have any other questions,

Mark

View solution in original post

0 Kudos
6 Replies
MarkDostal
Esri Contributor

Shimin,

Thank you for your question!  Yes, there is an equivalent to those classes in the 100.x releases.  It is the AGSLayerContent protocol, which all layer classes implement, since the base class AGSLayer implements it.  It will have everything you need to construct a TOC.  The documentation for AGSLayerContent can be found here:  ArcGIS Runtime SDK for iOS: Protocol Reference 

We have not yet provided a TOC sample or Toolkit component, but there is a Legend Toolkit component.  The legend will loop through all of the map/scene's operational layers, recursively going through all sublayers to build the legend.  The methodology in there will be very similar to that of a TOC.  You can find it here:  GitHub - Esri/arcgis-runtime-toolkit-ios: Toolkit components that will simplify your iOS app develop... 

The source code is provided and can be found in that GitHub repo here:  arcgis-runtime-toolkit-ios/LegendViewController.swift at master · Esri/arcgis-runtime-toolkit-ios · ... 

Let us know if you need more help or have any other questions,

Mark

0 Kudos
ShiminCai
Occasional Contributor III

Many thanks Mark and the info you provided is exactly what I'm looking for!!!

Any other migration guide documenting the changes would be a big help besides the document (https://community.esri.com/community/developers/native-app-developers/arcgis-runtime-sdk-for-ios/blo... ) which is a high level guide  and th.e deprecated list

Cheers,

Shimin

0 Kudos
MarkDostal
Esri Contributor

Shimin,

Excellent.  Let us know if there's anything else we can help with.  I'm going to forward your feedback about the guide documentation to the appropriate people.

Thanks,

Mark

0 Kudos
ShiminCai
Occasional Contributor III

Hi Mark,

Just wondering if there is any chance to have a TOC sample in the SDK 100.2.1?

Thanks,

Shimin

0 Kudos
MarkDostal
Esri Contributor

Shimin,

Yes, there will be a TOC sample at some point, but I don't know when that will be.  It will probably be a Toolkit component, like the Legend component I mentioned earlier.  If you'd like, please enter an issue in the "ArcGIS Runtime Toolkit for iOS' repo here:  Issues · Esri/arcgis-runtime-toolkit-ios · GitHub requesting a TOC component for the Toolkit, along with any features (other than the standard/basic TOC features) you'd like to see.

Thank you,

Mark

0 Kudos
ShiminCai
Occasional Contributor III

Many thanks Mark. Looking forward to it. Cheers, Shimin