Not able to load KML on Arcgis Map.

372
1
07-21-2023 11:47 PM
KAMLESHDURGUDE
New Contributor II

Hi, 

I am trying to load KML file on the Arcgis Map. It is giving following error.

Error Domain=com.esri.arcgis.runtime.error Code=8001 "Unlicensed feature." UserInfo={NSLocalizedFailureReason=, NSLocalizedDescription=Unlicensed feature., Additional Message=}

I am using iOS runtime sdk v100.15. I have standard license key. Still it is showing the same error.

 Please find the code below:

func showKML(){

guard let kmlPath = Bundle.main.path(forResource: "LNT_Campus_kml_1", ofType: "kml") else {fatalError("Unable to get kml")}

 let kmlDataset = AGSKMLDataset(url: URL(string: kmlPath)!)

 let kmlLayer = AGSKMLLayer(kmlDataset: kmlDataset)

 map.operationalLayers.add(kmlLayer)

 kmlLayer.load { [weak self] (error) in

 if let error = error {

print(error)

}

}

}

1 Reply
Nicholas-Furness
Esri Regular Contributor

Hello.

You need a Standard license to access KML files stored locally on your device (see the licensing documentation). It looks like you have applied a license, but it is not a Standard license.

Note that during development and testing (by not applying a license) you can test using a local KML file, but your app will have a watermark and you cannot deploy to production.

Also note that KML accessed via the web (e.g. via https) can be used with a Lite license.

Hope that helps.

0 Kudos