AGSMapView shows blank when lite license is loaded

576
2
Jump to solution
04-14-2020 07:39 AM
AdrianTineo
New Contributor

Hi 

I am having trouble after loading the lite license key to remove the watermark in the ArcGIS Runtime iOS SDK.

  • The map (a GeoTIFF file) is displaying correctly when the license is not loaded. It shows with the watermark "Licensed For Developer Use Only". This is the relevant code.

    func setupMap() {

        guard let map =  map else { return }

        

        let raster = AGSRaster(fileURL: map.url)

        let rasterLayer = AGSRasterLayer(raster: raster)

        self.rasterLayer = rasterLayer

        let agsMap = AGSMap(basemap: AGSBasemap(baseLayer: rasterLayer))

        mapView.map = agsMap

    }

  • I am loading the license key as per the instructions here in the section "License your app with a license key". I put the code in the AppDelegate. This is the relevant code.

@UIApplicationMain

class AppDelegate: UIResponder, UIApplicationDelegate {

    let arcGISLicenseKey = "<LITE_LICENSE_KEY_OBTAINED_FROM_DASHBOARD>"

    

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

        

        let result = try! AGSArcGISRuntimeEnvironment.setLicenseKey(arcGISLicenseKey)

        switch (result.licenseStatus) {

        case .invalid:

            print("invalid license")

        case .expired:

            print("expired license")

        case .loginRequired:

            print("login required")

        case .valid:

            print("valid license")

        @unknown default:

            print("Unknown case for licenseStatus")

        }

        return true

    }

}

When I run this code, the console prints "valid license" and I no longer see the message in the console of "Licensed For Developer Use Only" but the map is showing blank. I get no further messages in the console.

How can I load the license successfully and be able to load the map correctly?

0 Kudos
1 Solution

Accepted Solutions
MichaelDavis3
Occasional Contributor III

Hi Adrian - I think displaying local raster data sources like GeoTiff imagery requires a Standard level license.  An application with a Lite license can't show those.  I'd suggest you try loading a web vector tile or raster tile baesmap to confirm the map is loading properly.

View solution in original post

0 Kudos
2 Replies
MichaelDavis3
Occasional Contributor III

Hi Adrian - I think displaying local raster data sources like GeoTiff imagery requires a Standard level license.  An application with a Lite license can't show those.  I'd suggest you try loading a web vector tile or raster tile baesmap to confirm the map is loading properly.

0 Kudos
AdrianTineo
New Contributor

Thanks Michael. You are right, AGSRaster requires a Standard license, as stated here:

This feature requires a Standard license for production deployment. No license required in Developer mode for testing.
0 Kudos