I have a SwiftUI project that has a 3D Sceneview of the earth. I have used a mobile scene package to achieve this and it works fine.
I now want to add operational layers to this SceneView. I am using a Lite licence.
I have my Data in the form of a .shp file which I have downloaded and just directly added to my project. I can also use a kml file.
I have tried to use the following:
let url = Bundle.main.url(forResource: "World_Cities", withExtension: "shp")!
let shapefileFeatureTable = ShapefileFeatureTable(fileURL: url)
try await shapefileFeatureTable.load()
let featureLayer = FeatureLayer(featureTable: shapefileFeatureTable)
viewModel.scene.addOperationalLayer(featureLayer)
However this doesn't work and no data is shown. As this is a fully offline application I cannot download the content for the layers so wondering what I'm doing wrong here. Or if my approach is wrong and I need to use a different method to display the cities layer. I can do it by creating individual GraphicsLayers for each city but that is very tedious. I want to just add an operationalLayer somehow.
I tried this also without the .load() line and also didn't work. With the .load() line there will be an error message "unlicensedFeature". Not sure if that is the issue though as it should be possible to add layers with a Lite Licence.
Solved! Go to Solution.
I have confirmed with our licensing folks that displaying a shapefile require a standard license. Please check this doc on licensing for more details.
> I tried this also without the .load() line and also didn't work. With the .load() line there will be an error message "unlicensedFeature"
Can you try to comment out the lite license, and use the default developer mode?
I tried to write up a demo to load an MSPK and a world cities shapefile and they display just fine, shown in the attached screenshot. If you can see the shapefile feature layer with the license removed, then I'll help you consult our licensing staff to see what is the specific license required for it.
Thanks, it does display with the licence commented out so I guess this is a licensing issue. I am using a Lite Licence at the moment.
I have confirmed with our licensing folks that displaying a shapefile require a standard license. Please check this doc on licensing for more details.
Ok. thanks for that.