AnsweredAssumed Answered

Adding runtime content to map

Question asked by ShiminCai on Apr 13, 2018
Latest reply on Apr 13, 2018 by ShiminCai

Hi all,

 

I'm using SDK100.2.1 and adding runtime content layers (*.geodatabase file created in ArcMap and stored locally on device) to the map as shown in the code below. I found that the geodatabaseFeatureTables.count is always zero and as a result no layers are added to the map. Is this the correct way adding the runtime content layers to the map in 100.2.1? I'm able to do this in SDK 10.2.5.

 

I'm using the free license level Lite.

 

Thanks in advance.

 

Shimin

 

let baseMap = AGSBasemap(baseLayer: self.baseLayer) 

let map = AGSMap(basemap: baseMap)

 

let gdb = AGSGeodatabase(fileURL: URL(fileURLWithPath: gdbFilePath)

 

                print(gdb.geodatabaseFeatureTables.count)

                

                for gdbFeatureTable: AGSGeodatabaseFeatureTable in gdb.geodatabaseFeatureTables

                {

                    if gdbFeatureTable.hasGeometry

                    {

                        let gdbFeatureLayer = AGSFeatureLayer(featureTable: gdbFeatureTable)

                        map.operationalLayers.add(gdbFeatureLayer)

                    }

                }

self.mapView.map = map

Outcomes