ArcGIS Maps SDKs Native Blog - Page 17

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Latest Activity

(224 Posts)
MichaelBranscomb
Esri Frequent Contributor

ArcGIS Runtime Local Server SDK Microsoft (R) Windows (R) June 2019 Security Update Compatibility Pa...

Summary


This patch resolves an issue with Local Feature Services where the returned DrawingInfo JSON is missing markerGraphics geometry information when the ServiceFeatureTable.UseAdvancedSymbology property is set to true and the local machine has the Microsoft Windows June 2019 or later security updates installed.

Description


Esri® announces the ArcGIS Runtime Local Server SDK Microsoft® Windows® June 2019 Security Update Compatibility Patch. The June 2019 security updates from Microsoft added additional checks for records included in a metafile. Publishing services from ArcGIS leverages metafiles to transport character markers to the server. The conversion of these markers uses a Microsoft GDI function which was updated with the June 2019 updates - this update caused these metafiles to fail to convert. This fix resolves that issue by imposing stricter standards on creation of these metafiles inside of ArcGIS Runtime Local Server SDK. This patch deals specifically with the issues listed below under Issues Addressed with this patch.


Issues Addressed with this patch

BUG-000123420 - Local Feature Service DrawingInfo is missing markerGraphics geometry information when the ServiceFeatureTable.UseAdvancedSymbology property is set to true and the local machine has the Microsoft Windows June 2019 or later security updates installed. This causes point data to fail to render in ArcGIS Runtime. Other service operations may return "Error performing Advanced Symbols operation".

Installing this patch on Windows

ArcGIS Runtime Local Server SDK Microsoft (R) Windows (R) June 2019 Security Update Compatibility Pa...

more
0 0 819
MichaelBranscomb
Esri Frequent Contributor

ArcGIS (Desktop, Engine, Server) Microsoft (R) Windows (R) June 2019 Security Update Compatibility P... 

Summary

This patch resolves an issue with publishing services containing character marker symbology from ArcMap to ArcGIS Server, ArcGIS Enterprise or ArcGIS Online. This issue began with Microsoft's June 2019 security updates. The patch should be applied to ArcGIS Desktop, ArcGIS Engine and ArcGIS Server machines.

Description

Esri® announces the ArcGIS (Desktop, Engine, Server) Microsoft® Windows® June 2019 Security Update Compatibility Patch. The June 2019 security updates from Microsoft added additional checks for records included in EMF files. Publishing services from ArcMap leverages EMF files to transport character markers when publishing services to ArcGIS Server and ArcGIS Online. The conversion of these markers uses a Microsoft GDI function which was updated with the June 2019 security updates which caused these metafiles to fail to convert. This patch resolves the issue by imposing stricter standards on creation of these metafiles inside of ArcGIS Desktop. Symptoms of this issue include the inability for ArcGIS Runtime-based applications to show advanced symbols. The patch must be installed on client machines running ArcGIS Engine or ArcGIS Desktop as well as server machines running ArcGIS Server. This patch deals specifically with the issues listed below under Issues Addressed with this patch.

Issues addressed with this patch

  • BUG-000123406 - Feature Service drawingInfo is missing markerGraphics information when the returnAdvancedSymbols property is true and the hosting machine has the Microsoft Windows June 2019 or later security updates installed. This causes point data to fail to render in ArcGIS Apps (Collector, Explorer, ArcGIS Runtime). Other service operations may return "Error performing Advanced Symbols operation".

Downloads and installation 

ArcGIS (Desktop, Engine, Server) Microsoft (R) Windows (R) June 2019 Security Update Compatibility P... 

more
0 0 2,666
DanCobb
Deactivated User

Beginning with Qt version 5.12.4, Qt relies on a newer version of OpenSSL. Details of this upgrade are highlighted in this Qt blog. Please build OpenSSL for your Qt application using the latest version of OpenSSL recommended by Qt. For more information, see OpenSSL.  Also note that due to the recent updates to OpenSSL, Esri will no longer be shipping the Android OpenSSL libs.

more
1 2 7,323
Nicholas-Furness
Esri Regular Contributor

This is part 3 of a 3 part series on working with Location in your Runtime applications.

In parts 1 and 2 we introduced the AGSLocationDisplay and the AGSLocationDataSource and discussed how they work together to display location on your map view as well how to configure location appearance on the map view, and how the map view behaves as the location is updated.

We finished off with an understanding of how AGSLocationDataSources are created. In this post we'll create a new location data source that provides realtime location of the International Space Station, and show it in use in a simple application.

ISSLocationDataSource

There exists a very cool, simple, open source API that provides realtime locations of the International Space Station. You can find out about it here, but put simply you make an HTTP request to http://api.open-notify.org/iss-now.json and get JSON back with the current location.

Let's use that API to build a custom AGSLocationDataSource that provides the ISS's current location. We'll call it ISSLocationDataSource.

 

Building the data source

Starting with a simple project already linked to the ArcGIS Runtime, let's create a new Swift file named ISSLocationDataSource and define our subclass of AGSLocationDataSource:

 

class ISSLocationDataSource: AGSLocationDataSource {
...
}

 

Now let's implement doStart() and doStop():

 

class ISSLocationDataSource: AGSLocationDataSource {
    override func doStart() {
        startRequestingLocationUpdates()

        // Let Runtime know we're good to go
        didStartOrFailWithError(nil)
    }
    
    override func doStop() {
        stopRetrievingISSLocationsFromAPI()
        
        // Let Runtime know we're done shutting down
        didStop()
    }
}

 

Once we've started, we'll hit the API URL every 5 seconds using an NSTimer, and parse the response into an AGSLocation object:

 

...
private var pollingTimer: Timer?

func startRequestingLocationUpdates() {
    // Get ISS positions every 5 seconds (as recommended on the
    // API documentation pages):
    // http://open-notify.org/Open-Notify-API/ISS-Location-Now/
    pollingTimer = Timer.scheduledTimer(withTimeInterval: 5, repeats: true) {
        [weak self] _ in
        // Request the next ISS location from the API and build an AGSLocation.
        self?.requestNextLocation { newISSLocation in
            // TO AGSLocationDisplay: new location available.
            self?.didUpdate(newISSLocation)
        }
    }
}

 

Reading the http://api.open-notify.org/iss-now.json URL and turning the JSON response into an AGSLocation happens in requestNextLocation() function which is called every 5 seconds using an NSTimer. Notice the call to didUpdate() on line 13. As discussed in part 2 of this series, that call will pass the new AGSLocation to the AGSLocationDisplay, which in turn will make sure location is updated on the AGSMapView as needed.

You can see a full implementation of the entire ISSLocationDataSource class here, including requestNextLocation() and the JSON Decoding logic.

Using our custom location data source

To use the new custom data source in a map view, we simply set the AGSMapView.locationDisplay.dataSource to an instance of our new class (line 8 below) and start the AGSLocationDisplay:

 

override func viewDidLoad() {
    super.viewDidLoad()

    // Set the Map.
    mapView.map = AGSMap(basemap: AGSBasemap.oceans())
    
    // Use our custom ISS Tracking Location Data Source.
    mapView.locationDisplay.dataSource = ISSLocationDataSource()
    
    // Start the AGSMapView's AGSLocationDisplay. This will start the
    // custom data source and begin receiving location updates from it.
    mapView.locationDisplay.start { (error) in
        guard error == nil else {
            print("Error starting up location tracking: \(error!.localizedDescription)")
            return
        }
    }
}

 

It's that easy! Now you have a map that shows the live current location of the ISS.

Of course, it's a little counter-intuitive to see the blue dot tracking the space station (we've been trained to associate it with our own location), so we use some of the AGSLocationDisplay configuration options to change the symbol to use an icon of the ISS. Find the entire Xcode project here.

Additional details about ISSLocationDataSource.requestNextLocation():

  • We use an AGSRequestOperation to get the JSON response from the API (source code).
  • We create a new AGSOperationQueue that processes 1 operation at a time. This way we don't have duplicate simultaneous calls to the API (source code).
  • For the very first location we obtain, since we don't yet have a heading or velocity, we create an AGSLocation with lastKnown = true (source code) which means it will be displayed differently in the map view (by default a grey dot rather than a blue dot, indicating that we're still acquiring a location).
  • We use AGSGeometryEngine to calculate the velocity of the ISS by comparing the new location with the previous location.

There's also a slightly more detailed version with an overview map, reference lat/lon grids, and a path-tracking geometry here.

We hope you've enjoyed this series of blog posts. The Location Display and Location Data Sources provide a powerful configurable way to integrate location into your Runtime apps, no matter what source you're using for location.

more
1 0 2,176
Nicholas-Furness
Esri Regular Contributor

This is part 2 of a series of 3 blog posts covering Location and the ArcGIS Runtime SDKs. In part 1 we introduced the AGSLocationDisplay which is responsible for working with the AGSMapView to give your app a "blue dot" experience, and we talked about customizing the behavior and appearance of the current location on your map.

In this post, we'll talk about the third component of AGSLocationDisplay, which is where that location information comes from: the location data source…

Location Data Sources

A location data source feeds location updates to the AGSLocationDisplay which in turn takes care of updating the map view according to the configuration options discussed in part 1.

It is accessed via the AGSLocationDisplay.dataSource property.

The ArcGIS Runtime SDK for iOS comes with a few location data sources out of the box:

Data Source TypePurpose
AGSCLLocationDataSourceFollow your iOS device's built-in Core Location services (the default).
AGSSimulatedLocationDataSourceFollow a sequence of simulated locations or an AGSPolyline.
AGSGPXLocationDataSourceFollow the contents of a GPX file.

Each of these location data sources inherits from the base AGSLocationDataSource class:

By default an AGSLocationDisplay automatically creates and uses an AGSCLLocationDataSource. Just call AGSMapView.locationDisplay.start(completion) to start showing your location (but see the note here about configuring your app according to Apple's requirements for enabling location).

Custom Location Data Sources

What's neat is that by inheriting from AGSLocationDataSource and implementing a few simple methods, you can create your own custom data source that Runtime integrates with in exactly the same way as the 3 out-of-the-box ones mentioned above (which are themselves built using the pattern we'll discuss).

This extensibility is very powerful if you're working with proprietary location technology, such as an external high-accuracy GPS unit, a beacon-based indoor location system, or some other location determining system whose manufacturers provide an API or SDK.

Step-by-step, here's how you build out your own custom AGSLocationDataSource:

  1. Inherit from AGSLocationDataSource.
  2. Implement doStart().
    • Called by Runtime when the app calls AGSLocationDisplay.start(completion).
    • This must call didStartOrFailWithError() to signal that your source started OK (or failed to start).
      When you call didStartOrFailWithError() you either pass in nil if your source started OK and is ready to start providing locations, or pass in an Error if it failed to start.
  3. Implement doStop().
    • Called by Runtime when the app calls AGSLocationDisplay.stop().
    • This must call didStop() to signal that your source stopped OK.

That takes care of starting and stopping the data source when instructed to, but you also need to notify Runtime when you get new locations:

  • Call didUpdate(location) whenever you get a new location you need to pass on. You construct an AGSLocation object and call didUpdate(), passing in that location.
    An AGSLocation combines an AGSPoint with a timestamp. It also includes velocity, heading, accuracy estimates, and whether this location should be considered current or is an old (or "last known") location. Some of these properties are used to determine how the location is displayed in the map view.

That's it. With that implemented, you have a functioning Location Data Source. Let's discuss the documentation available to us about this, and how it all fits together.

Understanding Location Data Sources

First, let's look at the AGSLocationDataSource (ForSubclassEyesOnly) API, described in the reference docs:

These methods determine how your custom location data source and the AGSLocationDisplay will communicate.

A note on naming:

  • do… Instructions from the AGSLocationDisplay to your custom AGSLocationDataSource begin with "do" (doStart() and doStop()). These indicate an imperative from the location display for your data source to do something.

  • did… Feedback from your data source to the AGSLocationDisplay is done by calling functions that begin with "did" (didUpdateLocation(), didStartOrFailWithError(), didStop() etc.). These indicate feedback from your data source to update the location display (e.g. the state changed, or a new location is available). 

The "do" methods are expected to exist in your subclass of AGSLocationDataSource, so it's up to you to implement them.

The 'did' methods are all inherited from AGSLocationDataSource, so they're already defined for use by your subclass. You don't implement them. You just call them directly.

Here's how these methods work together:

  1. When an app wants to show location updates (by calling AGSMapView.locationDisplay.start(completion)), the AGSLocationDisplay will call doStart() on its dataSource.
  2. The data source initializes itself and calls didStartOrFailWithError(nil) to show it's started OK. It starts providing location updates by calling didUpdate(location) for each location update.
  3. When the app wants to stop showing location, it calls AGSMapView.locationDisplay.stop() and the AGSLocationDisplay will call doStop() on its dataSource. The data source calls didStop() and makes sure it doesn't call didUpdate(location) any more.

That's it for the theory. In the next blog post, we'll look at creating a custom AGSLocationDataSource from scratch and show it in use in a simple iOS application.

more
0 0 1,978
Nicholas-Furness
Esri Regular Contributor

The Blue Dot

Often your app needs to show your location, or a "blue dot", on a map. Maybe it's important to know where you are, or important to know where things are in relation to you. Often that context is critical to the core functionality of the app.

 

Runtime provides a robust blue dot experience. Out of the box, you simply call start() or stop() and Runtime takes care of talking to your device to get the best available location.

 

But Runtime takes this functionality further and provides a flexible framework to provide your own location source. Perhaps you need to connect to an external GPS unit or use a proprietary indoor location beacon system.

 

In this, the first of 3 posts on the topic, we'll take a look at how Runtime presents location in the map view. In part 2 we'll discuss how Runtime gets location updates from various location data sources and cover what it takes to create your own location data source. Finally, in part 3, we'll take what we've learnt so far and build a custom location data source. 

Your location in the Runtime

There are 3 Runtime components that work together to put that blue dot on your map: AGSMapViewAGSLocationDisplay, and AGSLocationDataSource

 

  • Every AGSMapView has an AGSLocationDisplay. It is responsible for showing and updating the current location on that map view.
  • You access the AGSLocationDisplay via the AGSMapView.locationDisplay property.
  • Your app starts and stops tracking location by calling AGSLocationDisplay.start(completion) and AGSLocationDisplay.stop().

 

Swift Note:
Swift translates method names automatically from Objective-C, so while the API doc references, for example, startWithCompletion:(), in Swift it will be written start(completion) and that's the form I'll use in this post.

 

Various properties on AGSLocationDisplay determine what the location display looks like on the map view (you don't have to use a blue dot if your app needs something else) and how the map view keeps up with the current location.

 

If you just want to use your device's built-in GPS, that's actually all you need to know. But let's look at some ways to control and configure that location display…

 

AGSLocationDisplay

There are 3 key aspects of Location Display that you can change.

  1. Behavior: How does the map view update itself as the current location changes.
  2. Appearance: What does the location display look like and how does it change depending on what information is available?
  3. Data Source: Where does the location display get the current location from?

 

Configuring behaviour

The auto-pan mode changes how the AGSMapView keeps up with location updates, that is, how does the map view move to follow the blue dot around. Set the auto-pan mode using AGSLocationDisplay.autoPanMode.

 

Mode Purpose and behavior
Off This is the default. The blue dot is free to move around your map display (or beyond it) while the map view remains still.
Recenter

The map will follow the blue dot as it moves, based off the AGSLocationDisplay.wanderExtentFactor, a number between 0 and 1:

  • 0 means the map view will constantly recenter on the blue dot.
  • 1 means the map view will recenter when the blue dot reaches the edge of the map view.
  • The default is 0.5, which allows a bit of movement before the map view recenters.

Navigation

Good for driving. The map view updates for the current location, but orients to the direction of motion. Use the AGSLocationDisplay.navigationPointHeightFactor property to determine how far from the bottom of the display the location will be anchored.
Compass Navigation Good for walking. The map view updates for the current location, but orients to the direction the device is pointing.

 

When you manipulate the map view's area of interest either programmatically or by panning/zooming it, the auto-pan mode will be reset to off. You can monitor for changes to the auto-pan mode with the AGSLocationDisplay.autoPanModeChangeHandler.

 

When you switch on auto-pan (i.e. it was off, but you set it to one of the other values), the map view will pan and zoom to the next location update. You can control the scale level for this pan and zoom with AGSLocationDisplay.initialZoomScale.

In most use cases, fixing the zoom like this is sensible behavior, but if you want to just recenter without zooming the map, simply set the initialZoomScale to the current AGSMapView.mapScale before you set the autoPanMode.

 

Configuring appearance

By default the location symbol will be a blue dot. It's augmented with a few visual aids to indicate accuracy, direction of motion (course), direction the device is pointing (heading) and whether locations are being updated (a "ping"). See these properties on AGSLocationDisplay for more details:

 

The Location… Gathering the Location…

 

You control whether to use the courseSymbol when movement is detected with the AGSLocationDisplay.useCourseSymbolOnMovement property.

 

Lastly, if you don't want a visual indication that a new location was received, you can set AGSLocationDisplay.showPingAnimation to false.

 

Location Data Source

One other important configurable item on AGSLocationDisplay is the location data source. We'll look at that part 2 when I'll cover how data sources work, and in part 3 we'll create our own custom data source.

more
2 0 2,509
by Anonymous User
Not applicable

I'm not going to hide it, I love the ArcGIS Runtime's loadable design pattern. We find the loadable pattern across the ArcGIS runtime; no doubt you interact with it often.

In short, the pattern allows you to work with an object that might take some time figuring stuff out before it’s ready to be used. For example, it might depend on multiple (possibly remote) resources, sometimes in sequence, before it knows enough about itself to be usable. Once these resources are retrieved, the loadable object executes a callback block signaling that it's ready. An AGSMap is a good concrete example as it might need to load multiple remote layers before it knows what extent and spatial reference to use.

Some other qualities of a good loadable object include:

  • calling the completion block on a suitable thread based off the thread the load was started from (see this blog post).
  • providing an observable loadStatus and loadError, though generally you just wait for the completion block to be called.
  • handling load failure elegantly with the option to retry later if needed (perhaps the network connection was interrupted).

As an added bonus, a full implementation of <AGSLoadable> can be found in AGSLoadableBase, a class designed to be subclassed (and which saves you reinventing a lot of wheels, doing a lot of the heavy lifting of load state and callback thread considerations).

"It's only a protocol," you might say. "You can't always subclass AGSLoadablebase," you might suggest. "Try implementing AGSLoadable yourself, do you still love it?" you might pronounce.

Hot take, but of course you'd be right. As an engineer, I'm tickled by problems like this and eagerly look for solutions.

Today I'd like to share with you a delightful maneuver that allows any class to adhere to <AGSLoadable> with neither the need for a custom async implementation (yikes) nor subclassing AGSLoadableBase.

I'd like to introduce you to LoadableSurrogate & <LoadableSurrogateProxy>, a member/protocol solution that offloads the heavy lifting of async loading onto a surrogate loader.

There are two actors in this maneuver, engaged in a parent/child delegate-like relationship:

  1. LoadableSurrogate is a concrete subclass of AGSLoadableBase that routes messages to a proxy object.
  2. A proxy object that adheres to <LoadableSurrogateProxy> we'd like to make loadable with the help of a loadable surrogate.

A class can leverage this tool by creating a LoadableSurrogate member, adhering to <LoadableSurrogateProxy> and specifying the LoadableSurrogate's proxy.

In this example, I've built a simple loader that downloads an image of (my favorite muppet) Kermit the Frog hanging out on the legendary Hollywood walk of fame.

class KermitLoader: NSObject, LoadableSurrogateProxy { }

I can use the kermit loader object like any other <AGSLoadable>:

let kermitLoader = KermitLoader()  kermitLoader.load { (error) in  
   
    if let error = error {         
        print("Error: \(error.localizedDescription)")     
    }

    imageView.image = kermitLoader.kermitImage
}

The kermit loader is initialized with a LoadableSurrogate member, assigning the surrogate's proxy to self.

class KermitLoader: NSObject, LoadableSurrogateProxy {

    private let surrogate = LoadableSurrogate()          

    override init() {
        super.init()         
        surrogate.proxy = self
    }     
    /* ...

For the kermit loader to conform to <LoadableSurrogateProxy> it must also conform to <AGSLoadable>. Conveniently, all <AGSLoadable> methods can be piped through the surrogate.

    ... */
    func load(completion: ((Error?) -> Void)? = nil) {
        surrogate.load(completion: completion)     
    }          

    func retryLoad(completion: ((Error?) -> Void)? = nil) {         
        surrogate.retryLoad(completion: completion)     
    }          
 
    func cancelLoad() {         
        surrogate.cancelLoad()     
    }     
    /* ...

Following the same pattern outlined above, you might opt to compute the <AGSLoadable> properties loadStatus and loadError on the fly, getting those values from the surrogate.

Instead, I've opted to persist those properties and thus, expose them to KVO.

    ... */
    @objc var loadStatus: AGSLoadStatus = .unknown

    @objc var loadError: Error? = nil
    //
    // Proxy informs of changes to `loadStatus` and `loadError`.
    //

    func loadStatusDidChange(_ status: AGSLoadStatus) {         
        self.loadStatus = status     
    }          

    func loadErrorDidChange(_ error: Error?) {         
        self.loadError = error     
    }     
    /* ...

Everything we've seen up until this point is boilerplate and can be copied and pasted. Let's get to the good stuff.

First, in order to perform the loadable operation we'll need to set up some resources and properties. We need a URL to the image, a data task, and of course a reference to the loaded image.

    ... */
    private let kermitURL = URL(string: "https://c1.staticflickr.com/2/1033/1024297684_582bc1c05a_b.jpg")!

    private var kermitSessionDataTask: URLSessionDataTask?

    var kermitImage: UIImage? = nil
    /* ...

What comes next is the custom loadable implementation. If you have ever subclassed AGSLoadableBase directly, this should feel familiar.

The proxy object is responsible for starting the load and completing with an error or nil, depending on the success of the operation. The proxy object is also responsible for canceling any async operations as well.

    ... */
    func doStartLoading(_ retrying: Bool, completion: @escaping (Error?) -> Void) {    

        if retrying {                          
            let previousDataTask = kermitSessionDataTask             
            kermitSessionDataTask = nil
            previousDataTask?.cancel()             
            kermitImage = nil
        }                  

        kermitSessionDataTask = URLSession.shared.dataTask(with: kermitURL) { [weak self] data, response, error in

            guard let self = self else { return }                          

            if let data = data, let image = UIImage(data: data) {                 
                self.kermitImage = image             
            }                          

            if response == self.kermitSessionDataTask?.response {                 
                completion(error)             
            }         
        }                  

        kermitSessionDataTask!.resume()     
    }     
    /* ...

The proxy object is also responsible for canceling running operations. If you want the surrogate to supply a generic CancelledError, you can return true. In this example the data task reliably provides its own cancel error in the task's callback and thus we return false.

    ... */
    func doCancelLoading() -> Bool {                  
        kermitSessionDataTask?.cancel()         
        kermitSessionDataTask = nil
        kermitImage = nil
        // Returns `false` because the URLSession returns a cancel error in the completion callback.
        // Return `true` if you want the surrogate to supply a generic cancel error.
        return false
     } 
 }

Cool! Now let's take a look under the hood of the LoadableSurrogate, powering much of the kermit loader.

To start, a LoadableSurrogate is a subclass of AGSLoadableBase.

class LoadableSurrogate: AGSLoadableBase { /* ...

A LoadableSurrogate passes messages to a proxy object. As you saw in the KermitLoader.init(), the kermit loader specifies itself as the proxy.

    ... */
    weak var proxy: LoadableSurrogateProxy? {         
        didSet {             
            proxy?.loadStatusDidChange(loadStatus)             
            proxy?.loadErrorDidChange(loadError)         
        }     
    }     
    /* ...

A LoadableSurrogate observes loadError and loadStatus so that it may immediately inform the proxy of changes to either of these properties.

... */
    // Cocoa requires we hold on to observers.
    private var kvo: Set<NSKeyValueObservation> = []          

    override init() {            

        super.init()      

        let loadStatusObservation = self.observe(\.loadStatus) { [weak self] (_, _) in

            guard let self = self else { return }                          

            self.proxy?.loadStatusDidChange(self.loadStatus)         
        }                  

        kvo.insert(loadStatusObservation)                  

        let loadErrorObservation = self.observe(\.loadError) { [weak self] (_, _) in

            guard let self = self else { return }                          

            self.proxy?.loadErrorDidChange(self.loadError)         
        }                  

        kvo.insert(loadErrorObservation)     
    }     
    /* ...

And finally a LoadableSurrogate handles piping the loadable method calls to and from the proxy.

    ... */
    private let UnknownError = NSError(domain: "LoadableSurrogate.UnknownError", code: 1, userInfo: [NSLocalizedDescriptionKey: "An unknown error occurred."])          

    override func doStartLoading(_ retrying: Bool) {                  

        // We want to unwrap the delegate, if we have one.
        if let proxy = proxy {                

            // Call start loading on the delegate.
            proxy.doStartLoading(retrying) { [weak self] (error) in

                guard let self = self else { return }                                  

                // Finish loading with the reponse from the delegate.
                self.loadDidFinishWithError(error)             
            }         
        }         
        else {             
            // No delegate, finish loading.
            loadDidFinishWithError(UnknownError)         
        }     
    }

    private let CancelledError = NSError(domain: "LoadableSurrogate.CancelledError", code: NSUserCancelledError, userInfo: [NSLocalizedDescriptionKey: "User did cancel."])      

    override func doCancelLoading() {   

        // Call cancel delegate method.
        if proxy?.doCancelLoading() == true {                          

            self.loadDidFinishWithError(CancelledError)         
        }     
    } 
}

To see this maneuver in action, have a look at this playground.

Happy loading!

more
0 0 507
MarkDostal
Esri Regular Contributor

The latest release of the ArcGIS Runtime Toolkit for iOS is here. It has been updated to work with the 100.5 release of the Runtime SDK for iOS.
 
This release includes:
• New PopupController component and example; the PopupController provides a complete feature editing and collecting experience.
• New TemplatePickerViewController component and example; the TemplatePickerViewController allows the user to choose from a list of AGSFeatureTemplates, commonly used for creating a new feature.
• Fix for a TimeSlider issue when using a combination of play/pause and manual dragging.
• Project updates for Xcode 10.2

You can find the Toolkit here.

See this blog post for information on the SDK release.
 
We hope you enjoy the new release! Let us know what you're building with it.

more
0 0 544
LucasDanzinger
Esri Frequent Contributor

Yesterday, we released Update 5 of ArcGIS Runtime SDK for Qt version 100. To get an overview all of the new functionality across all of the Runtime SDKs, you can read the blog on the ArcGIS Blog. Some notable new features include support for WFS, 3D subsurface navigation, mobile scene packages, and several new 3D layer types. In addition to this, the Qt team has been working very hard on some additional work items throughout the release. Here are some noteworthy things to know about the Update 5 release for the Qt SDK:

Qt 5.12 Upgrade


We updated our build environment to be based on Qt 5.12. This brought us a whole host of new features such as improved performance and memory consumption. In addition, 5.12 brought in support for Xcode 10, which is critical for apps that are deployed to Apple's AppStore. Finally, 5.12 brought in a compiler change in Android from gcc to clang. This allowed us to update our NDK minimum and bring in support for Android armv8 (64-bit). This is crucial for apps that are deployed to the Google Play Store and also opens the door for performance gains.

C++ 11 range-based for loops


We now fully support using C++ 11 style range-based for loops with our list model types. This means you can migrate your C-style loops from this:

for (int i = 1; i < m_graphicsOverlay->graphics()->size(); i++)
{
}

to this:

for (auto graphic : *(m_graphicsOverlay->graphics()))
{
}

New compiler warnings for deprecations


We have refactored the selection mechanism for visually selecting features and graphics in 2D and 3D. As such, we have some newly deprecated members. As part of this release, we have introduced new compiler warnings that will warn you if you are using these deprecated members. We plan to use this pattern going forward to notify you of any API deprecations.

ECMAScript 6 & 7 Support


One of the cool new features of Qt 5.12 is the inclusion of ES 6 & 7 features within QML's JavaScript engine. We have sanity tested many of the newer JS language features and everything thus far is working as expected. Some new features include arrow functions, string interpolation, constant variables (const instead of var), block scoped variables (let instead of var), function default parameters, classes, static functions, and more. This was one of the topics of discussion at this year's Dev Summit, so feel free to check out this video of the presentation if you'd like to hear more.

TableView


Qt 5.12 brings in support for a new Qt Quick Table View. At the Dev Summit last month, Neil MacDonald gave an interesting talk on how you can use our AttributeListModel and the Qt Quick Table View to build an attribute table. You can watch this presentation here.

Sample Improvements


Upgrading our minimum to Qt 5.12 means that we now fully embrace Qt Quick Controls 2 and have removed Qt Quick Controls 1 from all samples (Qt Quick Controls 1 were deprecated at 5.11). As such, we now have a unified style throughout the samples and our sample viewer app, and we were also able to utilize Qt's new high DPI support. This can be enabled by setting 

QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

in your main.cpp. Once this is enabled, your code can be cleaned up by removing all of the scaleFactor multiplications that were previously required to scale pixel values on different DPI devices. In the coming weeks, we will be adding more Update 5 samples to the master branch of our GitHub page, so please continue to watch the repo here.

Platform updates


As mentioned in our 100.4 release notes, 100.5 will no longer support Ubuntu 14.04, macOS Sierra, or iOS 10. As such, 100.5 also dropped support for 32-bit iOS, which means our static library size was cut in half, and the macOS installer is now significantly smaller than previous releases. As mentioned earlier, we now support 64-bit android, and we also have an embedded Linux beta available for ARM devices. You can join this beta program through the early adopter site.

more
1 0 846
Nicholas-Furness
Esri Regular Contributor

The latest release of the Runtime SDK for iOS is here (see the release notes, and the general announcement over on the ArcGIS Blog), and it brings with it a slew of great new features, and some cool new internals that pave the way for even more goodness in future releases.

Some highlights from the iOS perspective:

  • We're now promoting the use of the Dynamic Framework for integrating ArcGIS Runtime SDK for iOS into your projects (and have deprecated the Static framework, which will be removed in a future release). This is Apple's preferred approach and matches what CocoaPods has been doing since Runtime 100.1. It also makes integration with the project simpler (e.g. you no longer explicitly add ArcGIS.bundle to your projects). See Configure your Xcode Project in the iOS SDK Guide.
  • In alignment with Apple's policies and since 100.5 now requires iOS 11 or higher, support for 32-bit devices has been dropped. You shouldn't notice any change as a developer, but it means means that the SDK installer package is now much smaller to download!
  • If you've been using custom views in an AGSCallout, the Runtime now makes use of AutoLayout to fit the view. See this release note.

This is not specific to the iOS Runtime SDK, but if you work with selections in your map view, please note the new behavior we have introduced at 100.5. These changes were brought about as we prepare for significant features down the line (including Metal support).

As has been mentioned before, 100.5 is the last release of the dedicated Runtime SDK for macOS.

The Samples app and Toolkit have already been updated for 100.5, and the Open Source apps will be update shortly (Data Collection already has been!).

We hope you enjoy the new release! Let us know what you're building with it.

more
1 4 1,395
118 Subscribers