POST
|
What can cause addAttachment to never call its completion block? func addImage(_ image: UIImage, toFeature agsArcGISFeature: AGSArcGISFeature, completion: @escaping ((Error?) -> Void)) {
agsArcGISFeature.load() { error in
if let error = error {
completion(error)
return
}
guard let imageData = image.jpegData(compressionQuality: 0.85) else {
completion(nil)
return
}
print("Calling addAttachment()")
agsArcGISFeature.addAttachment(withName: "image.jpg", contentType: "jpg", data: imageData) { agsAttachment, error in
if let error = error {
print("addAttachment() completed with error")
completion(error)
} else {
print("addAttachment() completed successfully")
completion(nil)
}
}
}
}
In the above code, neither of the print() statements (lines 16 or 19) ever execute. The feature is a loaded feature from a feature service in ArcGIS Online. I feel like I am missing something simple.
... View more
07-07-2020
04:18 PM
|
0
|
2
|
709
|
POST
|
If I want to download a song, podcast, or similar content, I would use a URLSession, which allows a download to continue to completion, even if the app has been suspended or terminated. Once started, does AGSGenerateOfflineMapJob (or AGSExportTileCacheJob or AGSExportVectorTilesJob) continue running in the background, even if the app has been suspended or terminated?
... View more
07-20-2019
04:12 PM
|
0
|
2
|
799
|
POST
|
I just retried the code doing the same thing. The hosted map is using Topo as its basemap. I still get the error message on the layer, "World Topographic Map: Illegal state". If it helps, I ran the test today at 4:24pm eastern (Tuesday, 5/28/2019). I ran it again on the smaller boundary in the same map and it worked great.
... View more
05-28-2019
01:37 PM
|
1
|
1
|
890
|
POST
|
OK, I just found the notes on the map services for the basemaps saying to use the alternate map services for exporting. I'm guessing this is what I was running into. So if I understand correctly, I need to make and use a separate tile cache if the user is going offline with a map that uses one of the Esri basemaps. Is there a documented lookup tool that cross-references from ArcGIS Online interactive map service to export-friendly map service? Or should I build my own?
... View more
05-24-2019
01:09 PM
|
0
|
3
|
890
|
POST
|
I am using AGSGenerateOfflineMapJob to download a simple map package from a web map in ArcGIS Online. Sometimes it works but sometimes I get "Illegal state" on the basemap. In testing, it seems like making the boundary smaller helps. On my original test boundary (which was larger), I could consistently download the region successfully if the basemap was Streets but if the basemap was Topographic or Imagery it would come back saying that layer was in error with "Illegal state" as the message. I used Tile Package Estimator on the same region, which, because it is an envelope formed by the screen, should be larger. It returned the following for the three basemaps: Streets: Levels 0 - 19 (10,128 tiles) (36.991MB) Topographic: Levels 0 - 19 (10,128 tiles) (44.35MB) Imagery: Levels 0 - 19 (10,128 tiles) (148.146MB) I condensed what I'm doing down to this simple function (in Swift) for this post: func testDownload(agsPortalItem: AGSPortalItem, boundaryPolygon: AGSPolygon, url: URL) {
let offlineMapTask = AGSOfflineMapTask(portalItem: agsPortalItem)
self.offlineMapTask = offlineMapTask
offlineMapTask.defaultGenerateOfflineMapParameters(withAreaOfInterest: boundaryPolygon) { (parameters, error) in
let generateOfflineMapJob = offlineMapTask.generateOfflineMapJob(with: parameters!, downloadDirectory: url)
// skipping typical progress indicator setup
generateOfflineMapJob.start(statusHandler: nil) { (result, error) in
if let error = error {
print(error.localizedDescription)
} else if let layerErrors = result!.layerErrors as? [AGSLayer: Error], !layerErrors.isEmpty {
let layerErrorMessages = layerErrors.map { "\($0.key.name): \($0.value.localizedDescription)" }
print("layer errors: \(layerErrorMessages)")
} else {
print("Success")
}
}
}
}
What am I doing wrong? Are there limits I need to avoid or override?
... View more
05-23-2019
10:29 AM
|
0
|
4
|
1141
|
POST
|
Weekend followup with problem apparently FIXED... This AGSMapViewTouchTest app has made it much easier to chase this bug. Here is what I have learned. Switching the gesture recognizer to a separate transparent UIView on top of mapView does not fix this problem. It is almost like deep inside the ArcGIS Runtime code, something is using KVO to observe something in the Apple stack and then acting on it. Very weird. This problem only happens if mapView.interactionOptions.isEnabled is set to false AFTER a gesture has been recognized and begun. A simple fix is to use mapView's UIView.isUserInteractionEnabled instead. I'm embarrassed it took me until now to try this. Apparently this does not affect my gesture that is already in progress. So in my production app, Draw GIS, I have changed to using UIView.isUserInteractionEnabled. Now it doesn't use AGSMapView.interactionOptions at all. In testing so far, it looks like the problem is gone. I am going to float this new version to my beta testers and see how it goes.
... View more
02-23-2019
12:19 PM
|
0
|
2
|
1357
|
POST
|
Hi Nicholas Furness, I added the code to recursively iterate through all subviews and disable all gesture recognizers from the AGSMapView and down. Before, I was just getting four. Now that I am recursively iterating through all subviews, I am getting eight. So now I am disabling all gesture recognizers. And the problem still persists. Near the top of this thread, replying to Mark Dostal over a year ago, I said one day I might would make a stand-alone app to duplicate the problem. That day was yesterday. And I was able to reproduce it easily with just a couple Swift source files. I put it up in GitHub - Worth/AGSMapViewTouchTest: Testing touch interaction with AGSMapView in ArcGIS Runtime SDK for iOS. And I put a video of me recreating the problem here: AGSMapViewTouchTest - YouTube. I will start now looking into blocking input to the mapView with an overlay view. Near the beginning of this project, back in 2017, the overlay view was my original plan but I struggled to have seamless interaction with both my gesture recognizers and Esri's gesture recognizers when they were in different views. But I have learned a lot since then. I will look again at this possible solution. Thanks, Worth
... View more
02-22-2019
03:35 PM
|
1
|
0
|
1357
|
POST
|
All the views are accounted for, both ArcGIS's and mine. So I tried your second idea. I didn't know I needed to set the lite license if I was already going to setLicenseInfo() with the user's licenseInfo before I displayed the mapView. Anyway, the problem is fixed now by doing what you said. This is how I did it: func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { ... let licenseKey = "insert your license key here" do { let _ = try AGSArcGISRuntimeEnvironment.setLicenseKey(licenseKey) } catch let error as NSError { print(error) } ... return true } So the artifact is now gone. Thanks.
... View more
01-27-2019
08:42 AM
|
0
|
6
|
1372
|
POST
|
ArcGIS Runtime SDK for iOS 100.4. I set it to "editor" based on the licenseInfo I got from the logged in user.
... View more
01-25-2019
01:12 PM
|
0
|
8
|
1372
|
POST
|
In my code I used "AGSArcGISRuntimeEnvironment.setLicenseInfo(licenseInfo)" to eliminate the message, "Licensed for developer use only" from the mapView. This works but now I have these artifacts showing that look like they are left over from the "developer use only" message. See the artifacts inside the red circle in the bottom left corner of the screen shot below: Does anyone know what this is or how to eliminate it?
... View more
01-25-2019
11:31 AM
|
0
|
10
|
1861
|
POST
|
So are you saying currently there is no way to query to the millisecond level if I am using ArcGIS Runtime SDK? What do you mean by works at Feature Service level?
... View more
12-13-2018
05:46 AM
|
0
|
0
|
1048
|
POST
|
As far as I can tell, that gets populated during my call to AGSServiceFeatureTable.applyEdits(), either locally or on the server.
... View more
12-03-2018
10:00 AM
|
0
|
0
|
1048
|
POST
|
The data isn't collected. it is only when I query the feature service for EditDate, which is originated by the ArcGIS Online server, that I don't get sub-second accuracy.
... View more
12-03-2018
09:53 AM
|
0
|
2
|
1048
|
POST
|
In the ArcGIS Online feature service? Maybe this is a limitation of ArcGIS Online?
... View more
12-03-2018
09:16 AM
|
0
|
4
|
1048
|
Title | Kudos | Posted |
---|---|---|
1 | 05-28-2019 01:37 PM | |
1 | 11-20-2018 05:24 AM | |
1 | 02-22-2019 03:35 PM | |
1 | 07-17-2018 12:06 PM | |
1 | 01-12-2018 03:17 PM |
Online Status |
Offline
|
Date Last Visited |
12-06-2022
09:55 PM
|