|
POST
|
isNavigating will only fire when the map starts or stops navigating, not continuously. So you should observe that and when it's set to false, you know the map has stopped moving. See this question: https://community.esri.com/thread/242331-how-to-get-center-location-of-map-when-end-scrolling-in-arcgis-map-ios-swift
... View more
11-21-2019
03:30 PM
|
0
|
0
|
1229
|
|
POST
|
Hi Steve. Maybe It depends on the Basemap. Runtime determines the spatial reference to use by looking at the Basemap first (or if there isn't a basemap it has some fallback logic). Most likely your Basemap will be in Web Mercator, and so all coordinates for retrieved features will be in Web Mercator too. This is to avoid having the Runtime re-project from source data every time it needs to draw things. That can rapidly affect performance. If you use a WGS84 Basemap, you will see coordinates in Lat Lon. Generally, my previous suggestions will be more flexible and won't lock you to one basemap spatial reference or another. Also note that if you provide points created with AGSPointMakeWGS84() (or the standard AGSPoint constructor, specifying a Spatial Reference of .wgs84()) then you can provide those to set the viewpoint, etc. and Runtime will convert them appropriately. Really, your issue will typically only arise when reading coordinates and displaying them to the user (also when debugging and sanity checking against known latitudes and longitudes).
... View more
11-19-2019
12:56 PM
|
1
|
0
|
4921
|
|
POST
|
Sorry for the slow reply. It's odd that the credential prompt disappears. That shouldn't happen. I wonder if that's a side-effect of the SVProgressHUD? Is this still happening? But to provide a different login panel (the one in your screenshot is the default one that Runtime provides), you make use of AGSAuthenticationManager.delegate and provide a custom challenge handler. That challenge handler can display your own UI to get a username and password, which you can then create an AGSCredential from and pass on to the runtime. Here's an example (getLoginInfo() is your custom code that displays your own UI and returns a username and password - in this case I'm using a username of nil to signify that the user canceled). import UIKit
import ArcGIS
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, AGSAuthenticationManagerDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
AGSAuthenticationManager.shared().delegate = self
return true
}
func authenticationManager(_ authenticationManager: AGSAuthenticationManager, didReceive challenge: AGSAuthenticationChallenge) {
// Show your UI
getLoginInfo { (username, password) in
if let username = username {
let credential = AGSCredential(user: username, password: password)
challenge.continue(with: credential)
} else {
challenge.cancel()
}
}
}
... You don't have to set your AppDelegate to be the AGSAuthenticationManager's delegate, but it's often convenient since it's around the lifetime of your app.
... View more
11-15-2019
01:50 PM
|
1
|
0
|
2088
|
|
POST
|
There are a few approaches you can take. 1. Read the current viewpoint as a Center and Scale and use the targetGeometry (it will be a point): let mapCenter = mapView.currentViewpoint(with: .centerAndScale)?.targetGeometry as? AGSPoint 2. Get the UI center (as you were) and convert it to map coordinates: let mapCenter = mapView.screen(toLocation: mapView.center)
3. Use the visibleArea property to derive the center: let mapCenter = mapView.visibleArea?.extent.center In all those cases, the coordinate will be in the map's spatial reference. You'll want to convert them to lat/lon like this: if let latLon = AGSGeometryEngine.projectGeometry(mapCenter, to: .wgs84()) as? AGSPoint {
let lat = latLon.y
let lon = latLon.x
} If you find yourself needing latitude and longitude a lot, you can create an extension on AGSPoint: extension AGSPoint {
var latitude: Double {
return (AGSGeometryEngine.projectGeometry(self, to: .wgs84()) as? AGSPoint)?.y ?? 0
}
var longitude: Double {
return (AGSGeometryEngine.projectGeometry(self, to: .wgs84()) as? AGSPoint)?.x ?? 0
}
}
Note that if you're just using the Lat/Lon for display, you could make use of AGSCoordinateFormatter.LatitudeLongitudeStringFromPoint:format:decimalPlaces:() As for detecting when there's a new center, there have been a couple of questions about this recently which should help you: How to get center location of Map when end scrolling in ArcGIS Map iOS Swift ? https://community.esri.com/thread/242599-save-agsmapview-viewpoint-after-user-zoompan Hope this helps!
... View more
11-15-2019
01:33 PM
|
2
|
0
|
4921
|
|
POST
|
Out of the box we don't provide a component to do this, but it's very easy to create one and then hook into AGSAuthenticationManager's challengeHandler pattern to provide App Login tokens as needed. See this conversation on GitHub and the sample Gist code that goes with it.
... View more
11-14-2019
01:28 PM
|
2
|
0
|
1492
|
|
POST
|
Hey Todd. Yes. We apply a max width constraint. It's not supposed to be there when using a custom view, but it seems we have a bug. We'll get that fixed, but in the meantime you could set AGSCallout.autoAdjustWidth to false before you set your custom view: mapView.callout.autoAdjustWidth = false
mapView.callout.customView = myCustomView Sorry about that. Hope this info helps!
... View more
11-14-2019
10:19 AM
|
1
|
1
|
3131
|
|
POST
|
Hmm. When I've seen that, it means the web map is quite old. If you can Save As to create a new copy (or just Save if you're the owner) that should save a version in a recognized web map spec version and should then work.
... View more
11-13-2019
02:16 PM
|
0
|
0
|
1540
|
|
POST
|
I'd guess you're not creating the AGSMap from a web map (referred to by a portal item) but are rather constructing it using one of the local constructors? You should use initWithItem() or initWithURL(). Does that help?
... View more
11-13-2019
10:40 AM
|
0
|
2
|
1540
|
|
POST
|
I assume you're using a custom UIView for this with the AGSCallout.customView property. The callout should resize according to its contents. Just make sure that you're resizing the UITextView appropriately. This Stack Overflow thread might help.
... View more
11-13-2019
09:37 AM
|
0
|
4
|
3131
|
|
POST
|
Hi Todd Atkins. Yeah. I hear you. With Runtime 100 our goal was to simplify usage and in this case while we have reduced majority use cases to a simple API, we're not supporting cases like this very well. Still working on a solution, but in the meantime here's a workaround. You can create a separate AGSServiceFeatureTable that points at the same service endpoint. Set its featureRequestMode to .manual. When you do an identify, rather than calling AGSMapView.identify(), translate that into an AGSServiceFeatureTable.populateFromServiceWithParameters:clearCache:outFields:() call. Set the clearCache parameter to true. Set the outFields parameter to an array of field names. The completion block will be given an AGSFeatureQueryResult much as if you had called AGSFeatureTable.query(), but the features will only have the fields you want. The table will contain the results of your query too should you need to go back to them. You could even set up the AGSQueryParameters for the populate call to not return geometries. Really up to you. Depending on your use case, you might want to call AGSServiceFeatureTable.clearCacheWithKeepLocalEdits:() passing in false as soon as you're done with the results. Or you can hold on to them. It's up to you, your app, and your memory constraints. Hope that helps. Let me know if you have any questions.
... View more
11-12-2019
01:49 PM
|
0
|
8
|
2509
|
|
POST
|
Hmm. That service JSON doesn't have a subtypes attribute. Contrast with this version that I found: http://52.64.246.55/arcgis/rest/services/EPA/HFDRegulationRef/MapServer/11?f=json That service is 10.6.1 compared to your 10.4.1. I'm asking around to see what this means (this is an area of the spec I'm not very familiar with). But it matches what we're seeing in Runtime and if I open that 10.6.1 layer in Runtime I do see the subtypes parsed properly.
... View more
11-06-2019
02:37 PM
|
0
|
1
|
4194
|
|
POST
|
Thanks. Could you also share the JSON for layer 5 please?
... View more
11-06-2019
01:55 PM
|
0
|
4
|
3061
|
|
POST
|
Thank you. I sent you a DM with some more questions.
... View more
11-06-2019
01:22 PM
|
0
|
7
|
3061
|
|
POST
|
Hmm. Thanks for the info, Shimin Cai. I'm doing some digging. Where is this feature service hosted? ArcGIS Online or ArcGIS Enterprise? If Enterprise, what version?
... View more
11-06-2019
09:24 AM
|
0
|
9
|
3061
|
|
POST
|
It's impossible to provide an accurate answer with the information you've provided. As a pointer, this appears to be a permissions issue. "Invalid Token" means that the credentials used to authenticate the app to take the map offline are not suitable for doing so (perhaps the token expired), in this case for a tile service (possibly the basemap?). But with no information about the map, the owner of the map, the layers in the map and the owner(s) of those layers, nor any information on how you are authenticating your app to take the map offline, it's impossible to give any more info.
... View more
11-06-2019
08:53 AM
|
0
|
0
|
1044
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 05-14-2026 07:07 AM | |
| 2 | 04-30-2026 10:59 AM | |
| 4 | 04-22-2026 08:07 AM | |
| 1 | 01-29-2026 09:39 AM | |
| 1 | 12-17-2025 10:12 AM |