Select to view content in your preferred language

Its possible to show .geodatabase (Runtime Conent) without a basemap on iOS

5928
15
07-10-2014 10:16 AM
Andréde_Mattos_Ferraz
Deactivated User

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.

0 Kudos
15 Replies
SuganyaBaskaran1
Esri Contributor

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

0 Kudos
andrede_mattos_ferraz
Deactivated User

Sorry for the delay, I had some trouble with my esri account. The file is attached in this post.

Thx in advance

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

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.

Screen Shot 2014-08-15 at 8.27.36 AM.png

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

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;

}

0 Kudos
Andréde_Mattos_Ferraz
Deactivated User

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...

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

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?

0 Kudos