How to load Geodatabase layer on AGSLocalTiledLayer in iOS?

2892
1
04-05-2014 01:26 AM
RahulMane
New Contributor
Hello,

I am new in ARCGIS development.
I have .tpk & .geodatabase files with me.
I have added mapLayer of AGSLocalTiledLayer, which works perfect.

Then i tried to add layer from geodatabase but it doesn't get added. (If i dont add AGSLocalTiledLayer layer then it shows layer form geodatabase) i m sure i m doing something wrong.

Here is my code.

AGSGDBGeodatabase *gdb = [[AGSGDBGeodatabase alloc]initWithPath:thePathString error:&error];
   
self.localFeatureTable = [[gdb featureTables] objectAtIndex:0];
self.localFeatureTableLayer = [[AGSFeatureTableLayer alloc] initWithFeatureTable:self.localFeatureTable];
self.localFeatureTableLayer.delegate = self;
   
for (AGSLayer* lyr in self.mapView.mapLayers) {
    if([lyr isKindOfClass:[AGSFeatureLayer class]])
        [self.mapView removeMapLayer:lyr];
}
  
for (AGSFeatureTable* fTable in gdb.featureTables) {
    if ([fTable hasGeometry]) {
       [self.mapView addMapLayer:[[AGSFeatureTableLayer alloc]initWithFeatureTable:fTable]];
    }
}

Please tell me what m i doing wrong, what should be done??

Thanks in advance.
0 Kudos
1 Reply
SuganyaBaskaran1
Esri Contributor
What are the spatial references of your tiled layer and localFeatureTableLayer? Did you generate the .geodatabase file through ArcMap or through the SDK?
0 Kudos