|
POST
|
Hi, The requirement is that you use image tiled layers. Unfortunately (as @SNauman mentioned) we weren't able to get support for vector tile layers in for this first release, but it's one of our top priorities. Until we add vector tile support… You can use a .tpkx or .tpk created in ArcGIS Pro. You can publish an image tile service from ArcGIS Pro. You could use a layer that's already published in ArcGIS Online. You can see a few examples published by Esri here (though because they're image tile layers, many of them are deprecated, so while you can dev/test with them, don't use them in production). You could even use ArcGIS Pro to create an image tile layer of a map that just has a vector tile layer: I haven't tried this workflow, but I believe that in theory you could create a custom style in the Vector Tile Style Editor, create a Map in ArcGIS Pro using that custom style, and use ArcGIS Pro to export that to an image tile layer (I think ArcGIS Pro just refers to them as "tile layers") either as a local tile (.tpkx/tpk) or as a hosted service in ArcGIS Online. That would also probably be OK for dev & test if you're using our published basemaps as the source data but you'd need to talk to us about using that in production. Those are all stopgap options until we add vector tile support to the Maps SDKs. At that point this will become much simpler.
... View more
08-11-2022
04:49 PM
|
0
|
5
|
4303
|
|
POST
|
Hi. Are you making REST requests yourself against the routing service? If you're using the Runtime SDK, simply use the AGSRouteTask. It will handle unpacking the response into Runtime geometry objects. See these links: https://developers.arcgis.com/ios/route-and-directions/#route-task https://developers.arcgis.com/ios/swift/sample-code/find-route/
... View more
08-11-2022
02:31 PM
|
0
|
2
|
3451
|
|
POST
|
You can use AGSRequestConfiguration to log some debug info to the console. Try something like this: let locatorTask = AGSLocatorTask(url: URL(string: "https://my-server/services/GeocodeServer/")!)
if let gc = AGSRequestConfiguration.global().copy() as? AGSRequestConfiguration {
gc.debugLogRequests = true
locatorTask.requestConfiguration = gc
} That should output the request for you. Please note that you should not log this debug info in a release version of your app. There is a performance hit to this logging and you should disable it in production and testing.
... View more
08-09-2022
09:16 AM
|
0
|
2
|
1451
|
|
POST
|
Look at the Parts collection on the PolylineBuilder. Each Part represents a sequence of joined MapPoints along the Polyline. For a simple Polyline with no breaks, there could well just be 1 Part. Each Part is comprised of a sequence of MapPoints, and Segments between them (Segments could be straight lines, cubic beziers, or elliptic arcs). You can Add (append), Remove, and Insert MapPoints (and Segments for that matter) on the Part. You can also update a point by calling SetPoint(). Everything you want to modify on a Polyline should be doable on PolylineBuilder (even if you need to dig in to the Parts). The key is the split between the immutable geometry, and the modifiable builder.
... View more
08-09-2022
08:36 AM
|
2
|
0
|
1615
|
|
POST
|
Hi. Thanks for following up in the Esri Community! Unfortunately there is a bug in Runtime that means that true curves in a GraphicsOverlay require that the graphics overlay rendering mode is set to static. The default mode is dynamic. This also impacts true curves in a feature layer backed by a mobile geodatabase, but that doesn't impact you here. One alternative you could consider if you must display the GraphicsOverlay in dynamic mode is to densify the curve geometry and use the densified geometry for your graphic. Hope this helps. I'll see how we can expose this information through the docs until we are able to fix it.
... View more
08-08-2022
12:15 PM
|
0
|
1
|
2582
|
|
POST
|
In short, performance. Based off lessons learnt in the previous generation Runtime SDKs, we decided that geometries should be immutable. This way we can be explicit about monitoring and reflecting updates. For example, if you re-use a point in two places, what does that mean if you modify it? If that point is part of a polygon or polyline, modifying it could change the valid or "simple" state of that polygon/polyline, which can have various repercussions on rendering paths. And of course there's a performance impact in monitoring and propagating that change. Instead, you use Geometry Builders. These are lightweight objects that can accept an existing geometry or start from a blank slate, allow manipulation and construction of a new geometry, and then output that new geometry. For example, to add a point to a polyline, you can create a PolylineBuilder from the polyline, add a point, then call ToGeometry() to get a modified polyline. To modify a MapPoint, create a MapPointBuilder from the MapPoint, modify the X/Y/Z/M properties as needed using the getters and setters, then call ToGeometry() to get an updated MapPoint. Depending on what you want to do, there are also methods on GeometryEngine that could come in handy.
... View more
08-08-2022
10:17 AM
|
2
|
2
|
1643
|
|
POST
|
A lot will depend on how your locator is configured (you might be able to configure it to accommodate the Unit Name as part of the address - I'm not familiar with creating locators). You could also use the geocodeWithSearchValues() override and specify individual address attributes you want to search on. You can see the list of attributes your locator supports by looking at the AGSLocatorTask.locatorInfo.searchAttributes array (the locator will need to be loaded before you can read this metadata).
... View more
08-01-2022
06:43 AM
|
0
|
0
|
1556
|
|
POST
|
Hi. Image tiled layers are designed for efficient display and don't have any backing information built in. A couple of thoughts… Do you have access to the source data as feature data to query against? Another option would be to export an image snapshot of the map view using exportImage(), and convert the lat/lon from an AGSPoint into a screen location using locationToScreen(), then read the pixel value of the image for the CGPoint you get back.
... View more
07-28-2022
11:54 AM
|
1
|
1
|
1269
|
|
POST
|
Hi. The identify calls available on AGSMapView are focused on interaction so revolve around tapping on the screen. To search using an arbitrary geometry, you will have to call Query on the feature tables that you're interested in. This assumes that the "symbol markers" you're referring to represent features in a feature layer. Take a look a this conceptual doc: hosted-feature-layers Also take a look at this sample, which references a feature table (in this case, an AGSServiceFeatureTable), sets up an AGSQueryParameters, and then calls queryFeatures using the parameters, which is returned a set of features. You would do the same, except that instead of setting a whereClause on the parameters, you would set the geometry to the geometry from the sketch editor, and spatialRelationship to .within. If the "symbol markers" are graphics in a graphics overlay, then you'll have to iterate over each graphic in the graphics overlay and for its geometry use the AGSGeometryEngine.geometry(graphicGeom, within: sketchGeom) to narrow it down. This code could help. It shows both GraphicsOverlay and Feature Layer approaches. I haven't actually run it, but it compiles 🙂 extension AGSGraphicsOverlay {
func getGraphics(within searchPolygon: AGSPolygon) -> [AGSGraphic] {
let graphicsWithinGeometry = (graphics as? [AGSGraphic])?.filter { graphic in
guard let graphicGeometry = graphic.geometry else { return false }
return AGSGeometryEngine.geometry(graphicGeometry, within: searchPolygon)
}
return graphicsWithinGeometry ?? []
}
}
extension Array where Element == AGSGraphicsOverlay {
func getGraphics(within searchPolygon: AGSPolygon) -> [AGSGraphicsOverlay: [AGSGraphic]] {
var results = [AGSGraphicsOverlay: [AGSGraphic]]()
for overlay in self {
results[overlay] = overlay.getGraphics(within: searchPolygon)
}
return results
}
}
extension AGSMap {
func queryFeatures(within searchPolygon: AGSPolygon, completion: @escaping ([AGSFeatureLayer: Result<AGSFeatureQueryResult, Error>]) -> Void) {
// Create a store for all the results coming back from each feature layer
var results = [AGSFeatureLayer: Result<AGSFeatureQueryResult, Error>]()
// Create a Dispatch Group to coordinate the async Query calls against all the feature layers.
let coordinator = DispatchGroup()
// Query each feature layer in parallel, collecting all the query results in the `results` variable.
for layer in operationalLayers.compactMap({ return $0 as? AGSFeatureLayer }) {
guard let table = layer.featureTable else { continue }
// Find all features in the feature layer that are within the search polygon
let params = AGSQueryParameters()
params.whereClause = "1=1"
params.spatialRelationship = .within
params.geometry = searchPolygon
coordinator.enter()
table.queryFeatures(with: params) { [layer] result, error in
defer { coordinator.leave() }
if let error = error {
results[layer] = Result.failure(error)
} else if let result = result {
results[layer] = Result.success(result)
} else {
assertionFailure("No result OR error - that shouldn't happen")
}
}
}
// Once all the queries have completed, execute this code…
coordinator.notify(queue: .main) {
completion(results)
}
}
} You could then call that with something like this… if let searchGeom = sketchEditor.geometry as? AGSPolygon {
map.queryFeatures(within: searchGeom) { results in
for (layer, queryResponse) in results {
print("Got result for \(layer.name)")
switch queryResponse {
case .success(let queryResult):
print("Found \(queryResult.featureEnumerator().allObjects.count) features")
case .failure(let error):
print("There was an error querying the layer: \(error.localizedDescription)")
}
}
}
if let results = (mapView.graphicsOverlays as? [AGSGraphicsOverlay])?.getGraphics(within: searchGeom) {
for (overlay, graphics) in results {
print("Found \(graphics.count) graphics in overlay \(overlay)")
}
}
} Again, I haven't had a chance to run this code, but it should give you an idea of how to do this.
... View more
07-27-2022
09:55 AM
|
1
|
1
|
1660
|
|
POST
|
Hey @Element808. Thanks for the kind words again! Are you asking about being able to read a web map or web scene? Right now we support accessing layers directly. Reading a web map/web scene is something that we'll get to in time but first we want to add support for a few more layer types. Then there's the question of integrating with Unreal Landscapes. For that, I'll have to defer to someone on the team who's more familiar with working with Unreal Engine. In the meantime, perhaps you can explain what features of Unreal Landscapes you need to use? It could be that the Maps SDK already supports what you need, albeit slightly differently. Nick.
... View more
07-21-2022
11:17 AM
|
1
|
0
|
7979
|
|
POST
|
Hi @ShawnKleese, I have a theory about what's going on. Can you comment out your line of code that sets the global API Key on the ArcGISRuntimeEnvironment please and try that? Here's what I think is happening: Preplanned map areas are stored as hidden portal items that are related to the web map portal item (there's an area item for each preplanned map area, and each area item itself has related package items, all hidden). The API Key might have access to the web map, but we don't yet automatically extend the API Key access to these related portal items. By setting the global API Key on line 2, any Runtime object that doesn't have an explicit credential set will default to using that global API Key and bypass the authentication manager flow. I think that your OfflineTask can see the web map item, but cannot read the related area items to enumerate them. We need to update our API Key scoping logic to include these related area and package items when scoping an API Key for a web map. In the meantime you could do a couple of things: Do not set the API Key globally, but set it on each Runtime object that needs it. Explicitly set your credential (from line 5 in your code) on your OfflineMapTask with setCredential(). You should then be able to enumerate the preplanned areas. You will probably also need to set it on the DownloadPreplannedOfflineMapJob that you create from the OfflineMapTask Let us know if that helps. If not, you should create a test web map that is entirely public and we can investigate further from there.
... View more
07-20-2022
09:53 AM
|
0
|
1
|
1837
|
|
POST
|
Hi @mvida. Thanks for the question. Yes. Support for vector tile layers is top priority for us and we aim to deliver it late 2022 or early 2023.
... View more
07-14-2022
07:45 AM
|
2
|
0
|
913
|
|
POST
|
Hi @Justin_Greco. Just to clarify, August will be our last release before we introduce Swift UI in the 200.0 release of the new ArcGIS Runtime SDK for Swift. Re-reading the blog post, I can see we could be clearer. I've updated the post. In the meantime, just to reiterate Ting's comment above, we do have this sample to show how to use the current ArcGIS Runtime SDK for iOS with Swift UI.
... View more
07-10-2022
09:11 AM
|
0
|
1
|
3899
|
|
POST
|
Hi. When you take a web maps offline, you do not get geocoding support from that web map. You would have to get hold of .loz/.loc locator files for the area in question (you could use ArcGIS Pro to create those if you have the source data, see Introduction to locators and Create a locator in the ArcGIS Pro docs). Mobile Map Packages are another way to get geocoding offline, but again they are not derived from Web Maps, but created in ArcGIS Pro (which packages up the .loz/.loc files inside the .mmpk). For an overview of the offline options that Runtime supports, see the Offline conceptual guide. One thought: you say that the web map contains address search information. Can you provide more details? If you have a feature layer of addresses that's downloaded with your offline map, you can query that to find feature locations. It's not as optimized as building a locator from your data and doesn't support Suggest capabilities, but can work in a pinch if the data is right. Hope this helps. Nick.
... View more
06-16-2022
05:44 AM
|
0
|
0
|
898
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | Thursday | |
| 2 | 3 weeks ago | |
| 4 | a month ago | |
| 1 | 01-29-2026 09:39 AM | |
| 1 | 12-17-2025 10:12 AM |