Files missing from Online-Offline Editing Sample

950
5
05-27-2012 10:50 PM
Chrisvan_Aart
New Contributor
Hi Guys,

For a client we are building a sketching app that has to work in online-offline modus.
The app needs to be able to start without contacting any feature layers.


The Online-Offline Editing Sample gives us clues how to work with feature layers in offline modus by loading the feature definition from local files.


In OnlineOfflineFeatureLayer.m there is
---
- (id)initWithURL:(NSURL *)url mode:(AGSFeatureLayerMode)mode online:(BOOL)online{
   if (self.bOnline)
        {
         ...

        }
        else {
            //restore features from saved feature store...
           
            NSDictionary *featureLayerDefinition = [self readFeatureLayerDefinition];
            NSDictionary *featureSetDictionary = [self readFeatureSet];
--

So the method readFeatureLayerDefinition is going to load a definition from a local file:
---
-(NSDictionary *)readFeatureLayerDefinition
{
    NSError *error = nil;
    NSDictionary *flDefinition = nil;
   
    NSString *filename = [self featureLayerDefinitionFilename];   
    if ([[NSFileManager defaultManager] fileExistsAtPath:filename]) {
  NSString *flDefinitionString = [NSString stringWithContentsOfFile:filename encoding:NSUnicodeStringEncoding error:&error];
       
        flDefinition = (NSDictionary *)[flDefinitionString AGSJSONValue];
    }       
   
return flDefinition;
}
---

featureLayerDefinitionFilename reads:
static NSString *kFlDefinitionFileName = @"FeatureLayerDictionary";

This file (next to static NSString *kFeatureSetFileName = @"FeatureSet";) is missing from the sample project.


Can you send/put these files online?

Thanks!

--

Chris van Aart
2CoolMonkeys
0 Kudos
5 Replies
RickJones
Occasional Contributor II
Those files are generated by the sample when you go offline.
0 Kudos
Chrisvan_Aart
New Contributor
The point is that the app needs to coldstart in offline modus.
So it needs to work without ever contacting the ARCGis server

Do you have a sample of the contents of the files? Or can one extract the files from a feature layer of ARCGis server?
0 Kudos
RickJones
Occasional Contributor II
I had to add .txt to the filenames to upload them.  They normally have no extension.


Edit: Of course, you can modify the onlineoffline class to use whatever path and filename you want.
0 Kudos
KirstenBeyer
New Contributor
Hi Chris,

Did you find a solution to this problem?

We are also trying to create an ios app that works in offline mode, without contacting server.  We need code to read in/access the feature layer data.  We have imported .tpk files without problems, but the feature layer is more complicated.  Is there a way to bring in map package (.mpk) files, or another feature format, offline?

Thanks!
K.B.

The point is that the app needs to coldstart in offline modus.
So it needs to work without ever contacting the ARCGis server

Do you have a sample of the contents of the files? Or can one extract the files from a feature layer of ARCGis server?
0 Kudos
LeiQingtian
New Contributor
I also have the same function is a FeatureLayer of how offline when custom and I do not know a friend you achieve.Can you tell me under realistic idea of �??�??it?Thank you very much!
0 Kudos