|
POST
|
If you log the AGSLocation to the console from within the dispatch to main, does it look correct?
... View more
05-23-2018
04:35 PM
|
0
|
4
|
2451
|
|
POST
|
Hi Muruganandham Kuppan, When you call createFeature() you will get an AGSArcGISFeature back. But until you call applyEdits(), that feature just exist locally and does not have an ID that you should use. Once you call applyEdits() to write the feature to the service, then there will be an ID to use. Call AGSArcGISFeature.refreshObjectID() on your handle to the feature to populate the OBJECTID. Cheers, Nick
... View more
05-23-2018
12:11 PM
|
0
|
0
|
2194
|
|
POST
|
I'm still checking to see if this is a requirement, but you could try dispatching the AGSLocationDisplaySource delegate calls to the main thread. If the sessionDataReceived notification is being fired (and so received) on a background thread I could see that could potentially cause problems.
... View more
05-23-2018
04:24 AM
|
0
|
11
|
2451
|
|
POST
|
Hey Shimin Cai, Collector does indeed take a similar approach. For inspiration you could look at this C# NMEA Parser. You would have to translate from C# to Swift but there might be some useful info for you there in building your Location Data Source. Cheers, Nick.
... View more
05-22-2018
05:45 PM
|
0
|
16
|
11694
|
|
POST
|
For anyone else following the thread… After some discussion offline it turns out the layer had a definitionExpression on it which the newly added feature didn't match. So, the new feature was being added to the feature service OK, but was not being displayed in the map. Glad we were able to figure this out, Muruganandham Kuppan!
... View more
05-17-2018
05:56 AM
|
1
|
2
|
2194
|
|
POST
|
Hey Jake, Not sure this is the same as the other app freezing issue we discussed separately yesterday, but I'd like to get a repro case for this. I think I can work with what you've given me access to but I'll let you know if I need more info. Separately, if you wouldn't mind (and to help with the readability of this thread), could you edit your post to include the full stack as another attachment. Maybe just keep the crash back trace? Thanks! Nick.
... View more
05-16-2018
06:11 AM
|
0
|
3
|
2714
|
|
POST
|
Hi Muruganandham Kuppan, I need to find out more about the difference between the two, but this thread might be helpful to you. Cheers, Nick
... View more
05-16-2018
05:42 AM
|
0
|
2
|
978
|
|
POST
|
Hi Brendan McCann, Which service URL and what version of the Runtime SDK are you using? Cheers, Nick
... View more
05-16-2018
05:31 AM
|
0
|
0
|
676
|
|
POST
|
Could you try that please? Try with the current release (100.2.1). If you still have problems, let's move to DM and investigate your service and your code to try to build a repro case.
... View more
05-15-2018
09:52 AM
|
0
|
0
|
2194
|
|
POST
|
HI Shimin Cai, If you're still looking to implement your own data source, look at the reference doc here. Here's what you need to do. Implement a class that inherits from AGSLocationDataSource. The key functions you need to implement are doStart() and doStop(). These are the entry points to your class. << Runtime communicating to your custom location data source: doStart() will be called by the Runtime when you call AGSMapView.locationDisplay.startWithCompletion(). doStop() will be called by the Runtime when you call AGSMapView.locationDisplay.stop(). >> Providing feedback to Runtime during startup/shutdown: Starting your external device - When Runtime calls your doStart() function, you need to tell Runtime once the external device has started up. Call self.didStartOrFailWithError:() from within your doStart() function to let the Runtime know your external device has started or that it failed to start. Stopping your external device - When Runtime calls your doStop() function, you need to tell Runtime once the external device has stopped. Call didStop() from within your doStop() function to let the Runtime know your external GPS device has stopped. >> Providing location updates to Runtime: Getting a new location - Whenever your external device's API gives you a new location, construct a new AGSLocation object and pass it to self.didUpdateLocation:(). Getting a new heading - If you get a new heading only (and not a completely new location), call self.didUpdateHeading:() with the new heading to let the Runtime know. Hope this helps. Cheers, Nick.
... View more
05-15-2018
06:10 AM
|
2
|
24
|
11696
|
|
POST
|
Hi, You should check the canAddFeature property if you're adding rather than canUpdateFeature. Once you call addFeature:completion: you should see the new feature in the map view. Which version of the Runtime SDK are you using?
... View more
05-14-2018
09:24 AM
|
0
|
2
|
2194
|
|
POST
|
Hi, You don't need to use an AGSGraphic to create a new feature. The pattern is: Create a new feature on the AGSFeatureTable with geometry and attributes using AGSFeatureTable.createFeature(). Add the feature to the AGSFeatureTable using AGSFeatureTable.add(). See Edit features—ArcGIS Runtime SDK for iOS | ArcGIS for Developers. Since you are working with a server (and not local data), then there is one more call to make to push your add to the server, namely applyEdits. The applyEditsWithCompletion() function is found on AGSServiceFeatureTable (and since you created your feature layer with a URL to a service, the AGSFeatureLayer.featureTable property will be an AGSServiceFeatureTable). See the Edit features (connected) sample, in particular the applyEdits call. This should get you going.
... View more
05-07-2018
09:17 AM
|
2
|
8
|
2194
|
|
POST
|
Hi, Update 3 of the runtime (due in the June timeframe) will expose Subtypes through the API. I'm afraid that in the meantime you'll have to get the metadata from the REST endpoint and parse out the information yourself (as you mention, you'll need to upgrade your server). This code might help point you in the right direction: func parseSubtypeInfo(forServiceFeatureTable featureTable:AGSServiceFeatureTable) {
guard let url = featureTable.url else {
return
}
let operation = AGSJSONRequestOperation(remoteResource: featureTable,
url: url,
queryParameters: nil)
operation.registerListener(AGSOperationQueue.shared()) { (jsonResult, error) in
guard error == nil else {
print("Error loading resources: \(error!.localizedDescription)")
return
}
guard let jsonDict = jsonResult as? [String:Any] else {
print("JSON not a dictionary!")
return
}
guard let subtypeField = jsonDict["subtypeField"] as? String,
let defaultSubtypeCode = jsonDict["defaultSubtypeCode"] as? Int,
let subtypes = jsonDict["subtypes"] as? [[String:Any]] else {
print("Couldn't find Subtype info")
return
}
print("Subtype Field: \(subtypeField)")
// subtypes is now an Array of subtype definition Dictionaries.
}
AGSOperationQueue.shared().addOperation(operation)
}
Hope this helps, Nick.
... View more
04-20-2018
03:07 PM
|
2
|
1
|
2540
|
|
POST
|
Hey Shimin, You're nearly there. You just need to make sure the gdb is loaded. gdb.load(completion: { (error) in
guard error == nil else {
print("Error loading the geodatabase! \(error!.localizedDescription)")
return
}
for table in gdb.geodatabaseFeatureTables {
let layer = AGSFeatureLayer(featureTable: table)
map.operationalLayers.add(layer)
}
}) But note that the tables won't have loaded either at this point, so to read hasGeometry, you might want to do this: gdb.load(completion: { (error) in
guard error == nil else {
print("Error loading the geodatabase! \(error!.localizedDescription)")
return
}
AGSLoadObjects(gdb.geodatabaseFeatureTables, { (allLoaded) in
if !allLoaded {
for table in gdb.geodatabaseFeatureTables where table.loadError != nil {
print("Error loading \(table.tableName): \(table.loadError!.localizedDescription)")
}
}
for table in gdb.geodatabaseFeatureTables where table.hasGeometry {
let layer = AGSFeatureLayer(featureTable: table)
map.operationalLayers.add(layer)
}
})
}) If you know your geodatabase only has featuretables with geometry, you can just add them to the operational layers without first loading them.
... View more
04-13-2018
07:47 AM
|
1
|
1
|
640
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-17-2025 10:12 AM | |
| 1 | 11-05-2025 10:52 AM | |
| 1 | 11-04-2025 08:55 AM | |
| 1 | 11-04-2025 08:38 AM | |
| 1 | 11-01-2025 03:25 PM |