Hi!
I am developing an iOS map using ArcGIS sdk. The app requires both online & offline use. We are dealing with dynamic map service to show the map.
Online:
I could load the map & and also added feature layers. I have used AGSDynamicMapServiceLayer map to load the dynamic map.
Offline:
I have downloaded the .geodatabase file to use offline.
When the user clicks a button to switch offline, I am downloading the package & also added the features layers from the .geodatabase. Before adding I have removed the layers that are added when in online.
Problem:
When I scroll the map in offline the visible maps gets invisible & never loaded. My doubt is shouldn't we add a map layer & then add feature layers?
code snippet:
for (AGSLayer* lyr in weakSelf.mapView.mapLayers) {
if([lyr isKindOfClass:[AGSFeatureTableLayer class]])
[weakSelf.mapView removeMapLayer:lyr];
}
//add layers from local geodatabase
weakSelf.geodatabase = geodatabase;
NSArray *directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:folderPath error:nil];
for (AGSFeatureTable* fTable in geodatabase.featureTables) {
if ([fTable hasGeometry]) {
weakSelf.localFeatureTable = [weakSelf.geodatabase.featureTables objectAtIndex:0];
weakSelf.featureTableLayer = [[AGSFeatureTableLayer alloc]initWithFeatureTable:weakSelf.localFeatureTable];
[weakSelf.mapView addMapLayer:self.featureTableLayer];
}
}
}
Am I missing something here. I could see the map screen that is visible before downloading the package, but it gets invisible when I scroll the map & never visible.
This is my first app using ArcGIS. Kindly help me.
Thanks in advance
Regards
Hi Dinakar.
This is a great question to post on the ArcGIS Runtime SDK for iOS discussion forum.
But your suspicion is a good one: it is always good to use a basemap layer along with a feature layer, and for offline scenarios, you can do this by referencing a .tpk (a tile package) that will provide a tiled basemap layer for your map. This needs to be added to your map first, then add your feature layer.
Let us know if this helps!