AnsweredAssumed Answered

cannot edit/add on feature layer

Question asked by zqkun.public@gmail.com on Sep 2, 2015
Latest reply on Sep 4, 2015 by zqkun.public@gmail.com

My testing server has the following functions:

Screen Shot 2015-09-03 at 11.31.46.png

 

I want to draw a polygon and add the new polygon to this layer, but all the property canCreate/canDelete/canUpdate/canUpdateGeometry return NO, and of course, I failed to add graphic to this layer. Is anything I missing?

 

AGSGraphic *newGraphic = [AGSGraphic graphicWithGeometry:self.sketchLayer.geometry symbol:[self getMapSymbolByType:eIfosMapSymbolTypePolygon] attributes:@{@"attire":@"testttt", @"attr2":@"test22"}];
AGSFeatureLayer *inspectionLayer = [AGSFeatureLayer featureServiceLayerWithURL:[NSURL URLWithString:LAYER_URL_STR] mode:AGSFeatureLayerModeSnapshot];
inspectionLayer.editingDelegate = self;
// return NO
if (inspectionLayer.canCreate) {
     NSLog(@"can create");
}

// return NO
if (inspectionLayer.canDelete) {
     NSLog(@"can delete");
}

// return NO
if (inspectionLayer.canUpdate) {
     NSLog(@"can update");
}

// return NO
if (inspectionLayer.canUpdateGeometry) {
     NSLog(@"can  update geometry");
}

[inspectionLayer applyEditsWithFeaturesToAdd:[NSArray arrayWithObject:newGraphic] toUpdate:nil toDelete:nil];

Outcomes