I generated a RuntimeContent in ArcMap but without a basemap, now when I try to show this content in iOS (esri iOS runtime SDK) my map stands gray. When I put some basemap, the map appears correctly... Has some rules about every map contain a basemap?
Thx in advance.
Andre,
Did you get a chance to send the geodatabase? I've not received it yet, and wanted to make sure it's not a glitch with geonet.
Also as Yue Wu suggests, make sure the spatial reference of base map and geodatabase are same.
Suganya
Hello André,
I just tested your runtime content ("arcsde_data.geodatabase") in my sample read offline gdb code and it works as expected. Here I attach you the screenshot. Please verify the code again and make sure the path is valid and the AGSFeatureTableLayer add to the mapView. Suganya Baskaran
Hope this can help.
Hello André,
I would suggest you to check the value of NSString *pathGDBString when you set the breakpoint on here. Two things to make sure, one the path is correct and the gdb file has geometry for the layers.
Here I attached my snippet code to load the gdb file. Hope this can help.
- (void)viewDidLoad {
NSError *error;
NSString *gdbPathREST = [self gdbPathREST];
NSString *gdbName = @"gdbName.geodatabase";
NSString *gdbFileFullPath = [gdbPathREST stringByAppendingPathComponent:gdbName];
AGSGDBGeodatabase *gdb = [[AGSGDBGeodatabase alloc] initWithPath:gdbFileFullPath error:&error];
for (AGSFeatureTable* fTable in gdb.featureTables) {
if ([fTable hasGeometry]) {
AGSFeatureTableLayer *fTableLayer = [[AGSFeatureTableLayer alloc]initWithFeatureTable:fTable];
[self.mapView addMapLayer:fTableLayer];
}
-(NSString*)gdbPathREST {
NSString *documentsDirectory;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
if ([paths count] > 0) {
documentsDirectory = paths[0];
}
NSLog(@"Geodatabase directory: %@", documentsDirectory);
return documentsDirectory;
}
The path is correct, when a put an basemap all layers appear...
To be clear, I dont have an error, but the map doesnt appear...
Hello André,
I wonder what's your gdb file spatial reference it is when you generate the Runtime content from ArcMap.
Here is the paragraph I found from Create an offline map—ArcGIS Runtime SDK for iOS
"If your features are not displaying, make sure you have panned or zoomed to the appropriate extent, and that the spatial reference of the geodatabase matches the spatial reference of the map. You can set the spatial reference of a local geodatabase at generation time, as described in Generate a geodatabase from a feature service."
Would you try use my snippet that I sent to you in my last reply to test whether the offline map can load?