AnsweredAssumed Answered

Incorrect AGSLayer info in webMap:didLoadLayer:

Question asked by marius_tabletcommand on Nov 17, 2015
Latest reply on Nov 23, 2015 by marius_tabletcommand

Hello,

 

I'm trying to add a button that allows a user to disable certain layers, on user defined maps. The first implementation, that worked fine, was using webMap:didLoadLayer: to save the loaded layers to a different array, and then toggle the layer.visible property, as a response to a UITableView cell tap.

 

The problem with that approach is the fact that the (AGSLayer *)layer received by - (void)webMap:(AGSWebMap *)webMap didLoadLayer:(AGSLayer *)layer has different info then the AGSWebMapLayerInfo that are part of webMap.operationalLayers. The issue that bothers me is that the AGSLayer name is different than AGSWebMapLayerInfo title. If you're creating a layer using an online CSV file, the AGSLayer name is that url (e.g. https://docs.google.com/spreadsheets/d/...&output=csv), the AGSLayer layerId is nil, etc. The AGSWebMapLayerInfo title has the same name as specified in the ArcGIS online portal, the URL is correct, the layerId is set etc.

 

I've tried to change the AGSWebMapLayerInfo visibility property, however it does not seem to apply that change.

 

Do you have any suggestions on how to get the correct layer name, or how to convert an AGSWebMapLayerInfo to a valid AGSLayer that can change the visibility of the layer?

 

Thank you,

Marius

Outcomes