AnsweredAssumed Answered

Dynamic map in offline

Question asked by dinakarsoma2 on Apr 8, 2015
Latest reply on Apr 14, 2015 by ebader-esristaff



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.



I could load the map & and also added feature layers. I have used AGSDynamicMapServiceLayer map to load the dynamic map.



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.




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