|
POST
|
One thought. Setting the map on the map view will proceed to load the map. Once its loaded, its spatial reference is fixed and I wonder, because you haven't set a basemap or a spatial reference, whether it's set to something that isn't the same as the WMTS layer. Tiled layers are not reprojected in Runtime so that could lead to you not being able to display the layer. Can you try calling mapView.map = map right after you set map.basemap = Basemap(wmtsLayer)? Or you could create the ArcGISMap with a spatial reference if you know what it should be: https://developers.arcgis.com/android/api-reference/reference/com/esri/arcgisruntime/mapping/ArcGISMap.html#%3Cinit%3E(com.esri.arcgisruntime.geometry.SpatialReference) Do either of those suggestions help?
... View more
05-09-2022
10:44 AM
|
0
|
1
|
1882
|
|
POST
|
If you have your point of interest geometries, you could also use GeometryEngine.combineExtents to get the minimal containing envelope. You can then pass that envelope to MapView.SetViewpointGeometryAsync() (that's a shortcut/equivalent to the method that Keith mentioned above).
... View more
05-05-2022
10:34 AM
|
0
|
1
|
1021
|
|
POST
|
Any idea why AGSPolygon.fromJSON returns NIL instead of an AGSPolygon? Yes. As I mentioned before, the REST request you're making doesn't just return a geometry. In fact it returns a set of features, including metadata. Each feature contains a geometry, but the full JSON you get back is much more than that, and you're trying to hydrate a geometry from the entire feature set JSON. I strongly recommend that you follow the queryFeaturesAndAddAsGraphics() example method I provide and do not make your own REST requests. It will simplify your life significantly. You can see on line 79 of my example code that I get the polygon of the first feature that's returned. If you need to persist that, you can call toJSON() on it. The JSON you get out of that can be used later to create a new AGSPolygon with fromJSON(). Incidentally, your call to fromJSON() is also ignoring the error that is returned.
... View more
05-02-2022
01:01 PM
|
1
|
0
|
1746
|
|
POST
|
Hi. I think you might be overthinking this a bit 🙂 The Runtime SDK takes care of a lot of this stuff for you. Take a look at this sample, and the code I've included below. But there are also some other issues: You could just display the layer directly, filtering the state you want to see with a SQL definition expression (see the code below). But if you don't want to for some reason… You are adding an AGSGraphic to the AGSMapView.graphicsOverlays collection. This expects an AGSGraphicsOverlay. See https://developers.arcgis.com/ios/swift/sample-code/add-graphics-with-symbols/ and https://developers.arcgis.com/ios/swift/sample-code/add-graphics-with-renderer/ fromJSON expects a geometry JSON in Esri JSON format. You are passing in featureset JSON in GeoJSON format. See this page for some more info. Your code could be using AGSRequestOperation which will take care of services that require authentication. Here are two options to display this state. One uses an AGSFeatureLayer and filters the contents with a where clause. The other does an explicit query to get a feature and create an AGSGraphic from it. Either way, you will need to add an API Key from your developer account to load the basemaps in this code… // Copyright 2022 Esri.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import UIKit
import ArcGIS
class ViewController: UIViewController {
@IBOutlet weak var mapView: AGSMapView! {
didSet {
mapView.graphicsOverlays.add(overlay)
}
}
let overlay = AGSGraphicsOverlay()
// Create a service feature table "linked" to the States 500K Layer
let featureTable = AGSServiceFeatureTable(url: URL(string: "https://tigerweb.geo.census.gov/arcgis/rest/services/Generalized_TAB2020/State_County/MapServer/7")!)
override func viewDidLoad() {
super.viewDidLoad()
// Visit https://developers.arcgis.com/dashboard/ to create your API key (used for basemaps)
AGSArcGISRuntimeEnvironment.apiKey = "<YOUR API KEY>"
let map = AGSMap(basemapStyle: .arcGISNavigation)
mapView.map = map
displayLayerDirectly()
// queryFeaturesAndAddAsGraphics()
}
func displayLayerDirectly() {
guard let map = mapView.map else { return }
// Use a feature layer object pointing at the service feature table
let layer = AGSFeatureLayer(featureTable: featureTable)
// The layer by default doesn't display beyond 1:4,999,999
// See https://tigerweb.geo.census.gov/arcgis/rest/services/Generalized_TAB2020/State_County/MapServer/7
layer.minScale = 0
// Explicitly define the renderer
layer.renderer = AGSSimpleRenderer(symbol: AGSSimpleFillSymbol(style: .solid, color: .orange, outline: AGSSimpleLineSymbol(style: .solid, color: .blue, width: 2.0)))
// And now limit the results returned from the layer to just Idaho
layer.definitionExpression = "STATE='16'"
map.operationalLayers.add(layer)
}
func queryFeaturesAndAddAsGraphics() {
// We will query against the service feature table to get the state feature we want…
let queryParams = AGSQueryParameters()
queryParams.whereClause = "STATE='16'"
// Perform the query (no need to make data tasks explicitly, and we'll help with authentication if need be)
featureTable.queryFeatures(with: queryParams, queryFeatureFields: .loadAll) { [weak self] result, error in
guard let self = self else { return }
if let error = error {
print("Error performing query: \(error.localizedDescription)")
return
}
guard let feature = result?.featureEnumerator().nextObject() else { return }
// The polygon is already created as the feature's geometry.
let polygon = feature.geometry
// Create a graphic from the feature.
let graphic = AGSGraphic(
geometry: polygon,
symbol: AGSSimpleFillSymbol(
style: .solid,
color: .orange,
outline: AGSSimpleLineSymbol(style: .solid, color: .blue, width: 2.0)),
attributes: feature.attributes as? [String : Any])
// Add the graphic to the overlay we already added to the map view.
self.overlay.graphics.add(graphic)
}
}
} Hope that helps.
... View more
05-02-2022
10:58 AM
|
0
|
2
|
1761
|
|
POST
|
Hi. Thanks for pointing that out. The row for Mobile geodatabase is slightly incorrect/misleading and we'll get the documentation updated. A Lite license will allow viewing of mobile geodatabases. A Basic license is required for editing. Editing data requires a Basic license except if the data is unsecured and shared publicly, in which case editing is supported with a Lite license (for a mobile geodatabase, that means it must be downloaded from an unsecured feature service).
... View more
04-26-2022
08:27 AM
|
1
|
0
|
596
|
|
POST
|
From an initial look, could you turn off the spotSoundings and let us know if that helps? They seem to be slowing things down (we'll have to look into why). Once they're off, does panning/zooming behave any differently? You should be able to get to that through the shared AGSENCEnvironmentSettings… AGSENCEnvironmentSettings.shared().displaySettings.viewingGroupSettings.spotSoundings = false
... View more
04-15-2022
12:06 PM
|
0
|
0
|
578
|
|
POST
|
Hmmm. We've taken a look and PNW does seem abnormally slow. We'll have to take a look. Thanks for reporting that.
... View more
04-15-2022
11:58 AM
|
0
|
1
|
578
|
|
POST
|
Take a look at the sample app. You can download it form the App Store and explore capabilities. Each sample shows the code behind directly in the app, but it's also available on GitHub. But if you're looking to track the current centerpoint of the map display, you can use AGSMapView.viewpointChangedHandler. You would then want to call AGSMapView.currentViewpointWithType() and pass in .centerAndScale as the type. You'll get an AGSViewpoint back, and look at the targetGeometry. It'll be an AGSPoint that's the center of the map (you'll have to cast to AGSPoint). The point's coordinates will be in the spatial reference of the map (in this case Web Mercator) which is probably not what you want to output. You'd need to project it to WGS84. We also have a AGSCoordinateFormatter class that can help. See this code for an example: mapView.viewpointChangedHandler = { [weak self] in
guard let self = self else { return }
if let center = self.mapView.currentViewpoint(with: .centerAndScale)?.targetGeometry as? AGSPoint {
// Format the Lat Lon etc. using a standard format
if let latLonString = AGSCoordinateFormatter.latitudeLongitudeString(from: center, format: .degreesMinutesSeconds, decimalPlaces: 1) {
print(latLonString)
}
// Get the coordinates manually…
if let wgs84center = AGSGeometryEngine.projectGeometry(center, to: .wgs84()) as? AGSPoint {
print("Lat \(wgs84center.y), Lon \(wgs84center.x)")
}
}
} That will output something like this to the Xcode console… 19 56 53.8N 100 32 17.0W Lat 19.948264571145458, Lon -100.53804579499798 19 58 51.9N 100 42 37.8W Lat 19.98109671769453, Lon -100.71050437417519 20 00 03.9N 100 48 55.8W Lat 20.001080434190495, Lon -100.81549113806531 20 00 25.0N 100 50 46.6W Lat 20.006942571870393, Lon -100.84629108361138 20 00 25.0N 100 50 46.7W Lat 20.006942719211626, Lon -100.84629185776355 Please note that ENC layers require a Runtime Standard License when you're ready to deploy your app.
... View more
04-15-2022
11:05 AM
|
0
|
1
|
2126
|
|
POST
|
Hi @neddyseagoon, It's hard to tell for sure without seeing your data but it's possible that you're doing everything right and the data is just configured not to be visible outside of specific scale ranges? Are you able to share the data with us? Feel free to DM me if so and we can figure out the best way to get it to us.
... View more
04-15-2022
07:53 AM
|
0
|
6
|
2142
|
|
POST
|
Hi. The sample loads our global ocean bathymetry basemap for context and displays the ENC chart on top of it, hence the network connection. That basemap is not necessary and the ArcGIS Runtime can work entirely offline, as you need. You could try changing line 22 in the sample to: mapView.map = AGSMap(spatialReference: .webMercator()) Hope that helps!
... View more
04-15-2022
07:50 AM
|
1
|
1
|
2142
|
|
BLOG
|
iOS 15.4 and 15.4.1 introduced a crash in 3D applications built with the ArcGIS Runtime SDK for iOS and ArcGIS Runtime SDK for .NET (Xamarin.iOS / Xamarin.Forms-iOS) which the team have resolved with the 100.13.2 release for those SDKs. See the release notes for iOS and .NET. If your application meets the following criteria, we recommend you release an updated version of your app built with this new 100.13.2 release: Your app uses the ArcGIS Runtime SDK for iOS or the ArcGIS Runtime SDK for .NET. Your app uses version 100.13 or 100.13.1 of the ArcGIS Runtime SDK in question. Your app uses a 3D scene view (2D map views are not impacted). To learn more, including which devices are impacted, please see this blog post. This issue was logged as BUG-000148092 "Navigating a scene view crashes or freezes on newer iOS devices running iOS 15.4.".
... View more
04-13-2022
12:14 PM
|
2
|
0
|
2185
|
|
POST
|
Have you tried DisplayFilters? The Definition Expression determines what's obtained from the data source, so if you change that it will make a new request (hence the delay). Display Filters just work with the data in hand. Sounds like you want to use a ManualDisplayFilterDefinition.
... View more
04-11-2022
09:00 AM
|
0
|
0
|
655
|
|
POST
|
Hi. The Runtime SDKs were built from the outset with performance in mind and should be able to handle 10s of thousands of pins with ease. I don't know how you're approaching this to hit that memory spike, but one approach which should certainly work is to set up an AGSGraphicsOverlay on your AGSMapView (add it to the graphicsOverlays collection), and add 1000 AGSGraphics to the AGSGraphicsOverlay's graphics collection. Each AGSGraphic can have its own symbol, but the most efficient way to handle this is to set up a renderer on the AGSGraphicsOverlay, which can efficiently share symbols between graphics in the overlay. If all your points will be displayed the same way, an AGSSimpleRenderer is suitable. Otherwise, if points should be displayed based off an attribute, use an AGSUniqueValueRenderer and populate the attributes dictionary on each AGSGraphic. These samples may help: https://developers.arcgis.com/ios/swift/sample-code/add-graphics-with-renderer/ https://developers.arcgis.com/ios/swift/sample-code/unique-value-renderer/ https://developers.arcgis.com/ios/swift/sample-code/simple-renderer/ https://developers.arcgis.com/ios/swift/sample-code/picture-marker-symbols/ One other thought: if you are using images for your symbols with an AGSPictureMarkerSymbol, be sure the image is a sensible size. You don't need a 10MB image just to display a point on a map. Consider scaling it appropriately. Hope that helps.
... View more
04-04-2022
07:45 AM
|
1
|
3
|
1597
|
|
POST
|
FYI: Here is a blog post about this crash. I will accept it as the solution so it appears up front to anyone reading this post.
... View more
03-31-2022
02:01 PM
|
1
|
0
|
5295
|
|
BLOG
|
We have identified an issue displaying a scene view with the ArcGIS Runtime SDK for iOS and the ArcGIS Runtime SDK for .NET (Xamarin.iOS) on iOS 15.4 and 15.4.1. The issue affects iOS and iPadOS devices with an A14, A15, or M1 processor. [ Update, Apr 13 2022: 100.13.2 released, addressing the fix for iOS and .NET (Xamarin.iOS / Xamarin.Forms-iOS) - see blog ] [ Update, Apr 12, 2022: We are preparing an update to fix this issue, targeting release on April 13, 2022. ] [ Update, Apr 5, 2022: We have identified and are assessing a candidate fix. ] When displaying or interacting with a scene view, the scene view may become unresponsive, or the application may crash. 2D workflows (map view) are not affected. The ArcGIS Runtime SDK for Qt is not affected. Only ArcGIS Runtime SDKs version 100.13 and 100.13.1 are affected. ArcGIS Runtime SDKs version 100.12 and earlier are not affected. This issue impacts all applications that display a scene view. No workaround has been identified. We are working to identify the root cause and deliver a fix as a top priority, but at present no ETA is available. [April 5 2022] We have identified and are assessing a candidate fix. The devices that are impacted are: iPhone 12, 12 Pro, 12 Pro Max, 12 Mini (2020, A14 Bionic) iPhone 13, 13 Pro, 13 Pro Max, 13 Mini (2021, A15 Bionic) iPhone SE 3rd Gen (2022, A15 Bionic) iPad Air 4th Generation (2020, A14 Bionic) iPad Air 5th Generation (2022, M1) iPad Pro 11" 3rd Generation (2021, M1) iPad Pro 12.9" 5th Generation (2021, M1) iPad Mini 6th Generation (2021, A15 Bionic) The device must be running: iOS 15.4 iOS 15.4.1 Earlier versions of iOS (15.3.1 and earlier) are not affected. A sample stack trace is provided from iOS to help you identify if you are encountering this crash: Thread 0 [Crashed]:
0 AGXMetalG14 0x1f17f1d50 0x1f1411000
1 AGXMetalG14 0x1f17f6028 0x1f1411000
2 Runtimecore 0x10a72824c esri::rendering_engine::GPU_device_metal::submit_command_(objc_object*, esri::rendering_engine::Command const&, esri::rendering_engine::Pipeline const*) + 1775
3 Runtimecore 0x10a7289e0 esri::rendering_engine::GPU_device_metal::submit_commands(esri::common::Span<esri::rendering_engine::Command, -1l>) + 67
4 Runtimecore 0x10a736b60 esri::rendering_engine::Device::submit(esri::rendering_engine::Render_pass&, esri::common::Span<esri::rendering_engine::Command_set, -1l>) + 83
5 Runtimecore 0x10a084914 esri::map_renderer_3d::View3D::draw(std::__1::shared_ptr<esri::rendering_engine::Device> const&) + 5023
6 Runtimecore 0x109938110 esri::geoview::Scene_view::draw(esri::geoview::Device&) + 143
7 Runtimecore 0x10967fb18 RT_GeoView_draw + 51
8 ArcGIS 0x1059d0280 -[AGSMetalGeoViewRenderer drawRequested] (AGSMetalGeoViewRenderer.m:102)
9 ArcGIS 0x105a084a0 _28-[AGSGeoView setRtcGeoView:]_block_invoke_2 (AGSGeoView.m:260)
10 ArcGIS 0x105a45198 drawRequestedHandler (RTCGeoView.m:298)
11 Runtimecore 0x10995aa28 $std::__1::function<void (void*)>::operator()(void*) const + 35
12 Runtimecore 0x10a868abc esri::common::signal_detail::Signal_base::notify_(esri::common::Function_ref<void (esri::common::signal_detail::erased_target_base&)> const&) const + 351
13 Runtimecore 0x1098ff140 esri::common::Signal<void (esri::geoview::Geo_view const&)>::notify(esri::geoview::Geo_view const&) const + 39
14 Runtimecore 0x109905a8c esri::geoview::Geo_view_draw_requested::draw_request_callback() + 43
15 Runtimecore 0x10a077cb4 esri::map_renderer_3d::Map3D::pulse() + 447
16 Runtimecore 0x109938024 esri::geoview::Scene_view::pulse() + 51
17 Runtimecore 0x109680be0 RT_GeoView_pulse + 27
18 ArcGIS 0x1059d01a4 -[AGSMetalGeoViewRenderer drawInMTKView:] (AGSMetalGeoViewRenderer.m:87)
19 MetalKit 0x1bd7096fc -[MTKView draw] + 183
20 MetalKit 0x1bd717fb8 -[MTKViewDisplayLinkTarget draw] + 39
21 QuartzCore 0x184bb31a0 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 747
22 QuartzCore 0x184d0e0c4 CA::Display::DisplayLink::dispatch_deferred_display_links() + 347
23 UIKitCore 0x184140254 _setupUpdateSequence_block_invoke + 215
24 UIKitCore 0x183aba084 _UIUpdateSequenceRun + 83
25 UIKitCore 0x18413fcb0 $schedulerStepScheduledMainSection + 143
26 UIKitCore 0x18413f478 runloopSourceCallback + 91
27 CoreFoundation 0x180f2cf04 _CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 27
28 CoreFoundation 0x180f3dc90 _CFRunLoopDoSource0 + 207
29 CoreFoundation 0x180e77184 _CFRunLoopDoSources0 + 267
30 CoreFoundation 0x180e7cb4c _CFRunLoopRun + 827
31 CoreFoundation 0x180e906b8 CFRunLoopRunSpecific + 599
32 GraphicsServices 0x19cf2a374 GSEventRunModal + 163
33 UIKitCore 0x1837f5e88 -[UIApplication _run] + 1099
34 UIKitCore 0x1835775ec UIApplicationMain + 363
... View more
03-31-2022
01:47 PM
|
4
|
0
|
6763
|
| 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 |