|
POST
|
Sorry about asking bunch of question in one day. I am new in this development area and having some problems in implementing few things. I have three feature layers that I need to update in offline mode. On popupsContainerDidFinishViewingPopups method, I am testing the offline status of the device, and if offline then I am writing feature to a text file. There are saperate textfiles for saperate feature layer. Each text file looks like this, basically writing featureset to file. "geometryType":"esriGeometryPoint","features":[{"geometry":{"x":456050.74480000045,"y":5001363.0892999982,"spatialReference":{"wkid":26915}},"attributes":{"CostToRepair":"500","USNG":"null","OBJECTID":10003,"Latitude":"null","Notes":"null","Longitude":"null","IndicentID":1,"Structure":2,"Category":1}}],"spatialReference":{"wkid":26915}} The problem I am having is in updating features back from text file. And the way I am doing is this -(IBAction)syncInspections:(id)sender{ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentDir = [paths1 objectAtIndex:0]; NSString *readPolyFile = [documentDir stringByAppendingPathComponent:@"InfraPolygonFile.txt"]; NSString *readLineFile = [documentDir stringByAppendingPathComponent:@"InfraLinesFile.txt"]; NSString *readPointFile = [documentDir stringByAppendingPathComponent:@"InfraPointFile.txt"]; NSString *addedPolygonString = [NSString stringWithContentsOfFile:readPolyFile encoding:NSUnicodeStringEncoding error:nil] ; NSMutableDictionary *polyDict = [addedPolygonString AGSJSONValue]; NSArray *polyArray = [AGSJSONUtility decodeFromDictionary:polyDict withKey:@"features" fromClass:[AGSGraphic class]]; if(polyArray.count){ [self.impactPolygon updateFeatures:polyArray]; } NSString *addedPointString = [NSString stringWithContentsOfFile:readPointFile e ncoding:NSUnicodeStringEncoding error:nil] ; NSMutableDictionary *pointDict = [addedPointString AGSJSONValue]; NSArray *pointArray = [AGSJSONUtility decodeFromDictionary:pointDict withKey:@"features" fromClass:[AGSGraphic class]]; if(pointArray.count){ [self.impactPoints updateFeatures:pointArray]; } NSString *addedLinesString = [NSString stringWithContentsOfFile:readLineFile encoding:NSUnicodeStringEncoding error:nil] ; NSMutableDictionary *linesDict = [addedLinesString AGSJSONValue]; NSArray *linesArray = [AGSJSONUtility decodeFromDictionary:linesDict withKey:@"features" fromClass:[AGSGraphic class]]; if(linesArray.count){ [self.impactLine updateFeatures:linesArray]; } } - (void)featureLayer:(AGSFeatureLayer *)featureLayer operation:(NSOperation *)op didFailFeatureEditsWithError:(NSError *)error { NSLog(@"%@,%@",error.localizedDescription, featureLayer.name); } It works fine if I am updating any one layer at a time, that is by commenting out updateFeatures method of other two layer. But, if I am updating all the three layers in this method, then its giving me error message " 'GET' method not supported" randomly for one of the layer. Is there anything I am doing wrong. Any suggestion appreciated.
... View more
11-02-2012
11:33 AM
|
0
|
7
|
1433
|
|
POST
|
In my feature layer I have domains. In the feature callout , the title is showing coded value. How can I show the coded value label as the title.
... View more
11-02-2012
08:10 AM
|
0
|
4
|
1349
|
|
POST
|
I am trying to implement offline editing of feature layer. In the popupsContainerDidFinishViewPopups menthod, I check for offline status of the device, if offline then I am writing the featureSet to a text file as. AGSGraphic *graphicToWrite = self.popupVC.currentPopup.graphic; [self.OfflinePoints addObject:graphicToWrite]; AGSFeatureSet *fSet = [AGSFeatureSet featureSetWithFeatures:self.OfflinePoints]; NSString *str = [NSString stringWithFormat:@"%@", [[fSet encodeToJSON] AGSJSONRepresentation]]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentDir = [paths objectAtIndex:0]; NSString *readFile = [documentDir stringByAppendingPathComponent:@"pointFile.txt"]; BOOL bSuccess = [str1 writeToFile:readFile atomically:YES encoding:NSUnicodeStringEncoding error:nil]; NSLog(@"Success %@", bSuccess ? @"YES" : @"NO"); The problem here is that there are some values in the attribute which are null. Output written to the textfile looks like this {"geometryType":"esriGeometryPolyline","features":[{"geometry":{"paths":[[[456694.88599999977,5001929.1936000008],[457409.26250000019,5000738.5662999982],[456456.76059999969,5000579.8160000006]]],"spatialReference":{"wkid":26915}},"attributes":{"CostToRepair":"2000","USNG":"null","OBJECTID":4401,"Latitude":"null","Notes":"null","Longitude":"null","IncidentID":1,"Structure":"null","Category":6}}],"spatialReference":{"wkid":26915}} All the null values are written as "null". While updating the featureSet, I am getting in error log "GET" method not supported. I tried this in the REST page and what I noticed was all that String type attributes are fine with "null", but there are some fields which are of type integer or double, and "null" doesn't work for them. Is there anything I can do to take care of this while writing to text file.
... View more
11-02-2012
07:25 AM
|
0
|
0
|
2760
|
|
POST
|
Once I start drawing on the sketch layer on the map; I don't know how to stop drawing and go to regular tap mode. Is it possible to trigger start and stop drawing on the sketch layer?
... View more
10-29-2012
10:45 AM
|
0
|
2
|
1053
|
|
POST
|
Hi Nimesh, I have one more question added to this table editing. I am looping through the query results and then creating a new features for table editing (attribute only, no geometry) from query each feature. Then I want to add this new feature one at a time to empty featureSet, how can I do that. I couldn't find a way to add new features to empty featureSet. Really appreciate help on this. Thanks, Vikrant If you are satisfied with answer then please mark thread as answered. Regards, Nimesh
... View more
10-01-2012
07:16 AM
|
0
|
0
|
915
|
|
POST
|
Is there a way I can show "edit" button in the popup info of the feature layer. Similar in Arcgis.com , where you click on feature and it shows popup info, having zoomin and edit button at the bottom.
... View more
09-24-2012
12:41 PM
|
0
|
0
|
650
|
|
POST
|
I am also trying to do the exact same steps to add feature to a feature layer. The error I am seeing in the log is AGSJSONRepresentation failed: Error is: NaN is not a valid number in JSON
... View more
09-21-2012
07:46 AM
|
0
|
0
|
667
|
|
POST
|
You should do it like this... AGSPopupInfo *popupInfo = [AGSPopupInfo popupInfoForGraphic:graphic]; AGSPopup *popup = [AGSPopup popupWithGraphic:graphic popupInfo:popupInfo]; self.popupVC = [[[AGSPopupsContainerViewController alloc]initWithPopups:[NSArray arrayWithObject:popup]]autorelease]; Regards, Nimesh Thanks!! that works. Also is it possible to edit a table in the feature service (not related table)?. I need to add records to a table in the feature service based on selection on the map.
... View more
09-18-2012
01:08 PM
|
0
|
0
|
915
|
|
POST
|
The Feature Layer Editing sample shows editing of layers from the webmap. How can do the editing (adding/deletingattributes) in the popup for the layers which are not part of arcgis.com webmap. Specifically, the statement in the method didClickCalloutAccessoryButtonForGraphic() self.popupVC = [[[AGSpopupsContanerViewController alloc] initWithWebMap:self.webmap forFeature:graphic usingNavigationControllerStsck:NO autorelese]; what do I pass instead of initWithWebMap
... View more
09-17-2012
11:14 AM
|
0
|
6
|
1589
|
|
POST
|
Seems like editor digit (with toolbar) does not display the info window correctly, info window goes out of the map if you click on a feature located in the upper, left or right portion of the map. It does not happen with attribute inspector though. Is there a way I can fix the position of the info window?
... View more
09-11-2012
07:36 AM
|
0
|
1
|
1076
|
|
POST
|
I have editing application with about 10 layers to edit. Everything works fine when I have all the layers turned on all the time and template picker shows all the symbols. Problem comes when I try to hide and show the layers and update template picker dynamically as layers get turned off and on from the checkbox. Problem that I am seeing is with overlapping features in this case, sometimes when I click on the point feature at the junction of two line features the infowindow shows the title of point feature but displays the attribute table of line feature. Further, when I click on next feature or previous feature button on infoWindow, this table get fixed automatically. In the same code everything works fine if I don't toggle layers and update template picker. In second case, when I use attributeInspector digit instead of editor widget, I loose the capability of geometry editing. Is there is a workaround in this case?
... View more
09-07-2012
11:13 AM
|
0
|
2
|
1074
|
|
POST
|
Can someone tell me how to put text symbol on the map with Linethrough and underline style. I have been trying with this line of code and it doesn't work. app.symbols.textSymbol = new esri.symbol.TextSymbol(text).setColor(new dojo.Color([128,0,0])).setDecoration('DECORATION_UNDERLINE').setAlign(esri.symbol.Font.ALIGN_START).setAngle(45).setFont(new esri.symbol.Font("12pt"); var labelPointGraphic = new esri.Graphic(labelPoints[0],app.symbols.textSymbol); app.map.graphics.add(labelPointGraphic);
... View more
08-16-2012
06:34 AM
|
0
|
1
|
1010
|
|
POST
|
How to we query or select feature from feature layer (snapshot mode) in offline mode. In my case NSLog shows the message executing selection on server and then it just hangs.
... View more
08-08-2012
01:18 PM
|
0
|
1
|
739
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-17-2016 06:36 AM | |
| 1 | 05-02-2016 02:14 PM |
| Online Status |
Offline
|
| Date Last Visited |
08-20-2025
10:28 AM
|