I have an iOS app that loads a webMap and makes edits/updates to the feature layers of that webMap.
In ArcGIS Online, when I view the webMap in the viewer, and click on a content layer I get the following window.
If I Disable Editing on this layer, in my app I can no longer edit the layer.
My question is what does this setting do exactly? It shouldnt change the edit settings of the layer itself right?
When I load the URL of the feature layer that I changed to disable editing, I still see on the bottom of the feature layer the following:
so the featureLayer itself is still editable. In my app this is how I am getting the layer.
- (void)webMap:(AGSWebMap *) webmap didLoadLayer:(AGSLayer *)layer
if layer.name equals the layer i want, i save it as a AGSFeatureLayer* and make changes to that.
Should I not get the layers from the webmap and use their respectable URLs instead?
Thanks for any help guys.
Solved! Go to Solution.
My question is what does this setting do exactly? It shouldnt change the edit settings of the layer itself right?
This setting stores some information in the webmap saying that the author has disabled editing on the layer. The iOS SDK, when opening the webmap, honors this setting and creates a feature layer which reports that it doesn't support editing (the canCreate, canUpdate, and canDelete properties on AGSFeatureLayer returns NO). Of course, the backend feature service still supports editing (it remains unmodified), but since the feature layer chooses to not expose this onwards, things like popups (which inspect the feature layer's properties) don't provide the option to edit features in that layer.
If you were to not use the feature layer instance returned by the web map in webMap:didLoadLayer: delegate method, and instead create your own feature layer pointing to the URL of the feature service directly, your layer would report that it IS capable of editing.
I think that setting controls the ability to edit through the AGOL web map. An iOS app would be using the feature services directly, and can make changes to any service that allows edits.
My question is what does this setting do exactly? It shouldnt change the edit settings of the layer itself right?
This setting stores some information in the webmap saying that the author has disabled editing on the layer. The iOS SDK, when opening the webmap, honors this setting and creates a feature layer which reports that it doesn't support editing (the canCreate, canUpdate, and canDelete properties on AGSFeatureLayer returns NO). Of course, the backend feature service still supports editing (it remains unmodified), but since the feature layer chooses to not expose this onwards, things like popups (which inspect the feature layer's properties) don't provide the option to edit features in that layer.
If you were to not use the feature layer instance returned by the web map in webMap:didLoadLayer: delegate method, and instead create your own feature layer pointing to the URL of the feature service directly, your layer would report that it IS capable of editing.
Okay. That makes sense.
Thanks.
When you load the feature layer from a URL, the graphics count will be 0 until you query right?
Loading from a URL means you need to query in order to access features.
That depends upon the mode of the feature layer. In snapshot mode, all the features (up to the max limit supported by the service, defaults to 1000) are fetched. In OnDemand mode, only those features that fall within the map's current extent are fetched; provided you have added the layer to the map. If you don't add the layer to the map, the layer won't know the map's extent, and hence no features will be fetched. In selection mode, only those features that satisfy the selection query will be fetched.
Detailed info on the modes here - ArcGIS Feature layer—ArcGIS Runtime SDK for iOS | ArcGIS for Developers