AnsweredAssumed Answered

Hosted feature layer not appearing in ArcGIS SDK for iOS simulator

Question asked by schmourt311 on Jul 15, 2018

So basically, I'm trying to add my layer from ArcGIS Online to my iOS app following this tutorial: Load an item from ArcGIS Online | ArcGIS for Developers 

 

As far as I can see, I only need to change the URL ID, and the latitude/longitude to make it work for my own content, correct? Here is the webmap I'm trying to use. I've rewrote the function as follows (it's a map of streetlights in South East London. Can someone tell me why this won't run? It's a hosted feature layer on ArcGIS Online: 

 

override func viewDidLoad() {

        super.viewDidLoad()

        

        let portal = AGSPortal(url: URL(string: "https://www.arcgis.com")!, loginRequired: false)

        let item = AGSPortalItem(portal: portal, itemID: "084f03898e654467988fc2252acbfa9c")

        let map = AGSMap(basemapType: .navigationVector, latitude: 51.41391, longitude: -0.05170, levelOfDetail: 15)

        

        /*** ADD ***/

        let layer = AGSFeatureLayer(item: item, layerID: 0)

        map.operationalLayers.add(layer)

        /*** ADD ***/

        

        mapView.map = map

    }

Outcomes