Hello,
I am trying to develop some code that I can use to open a local SLPK with the Runtime and I have not found much sample code. I've used the MobileMapPackage class to open an MMPK, but I have not found a comparable class for SceneLayerPackage, or something similar.
Any ideas? Is this possible at this point?
Thanks,
Mike...
You should be able to open an *.slpk file directly with ArcGISSceneLayer like the following:
var sceneLayer = new ArcGISSceneLayer(new Uri(@"C:\temp\Test.slpk"));
await sceneLayer.LoadAsync();
var scene = new Scene(Basemap.CreateImagery())
{
InitialViewpoint = new Viewpoint(sceneLayer.FullExtent)
};
scene.OperationalLayers.Add(sceneLayer);
MySceneView.Scene = scene;
If the layer fails to load you can check ArcGISSceneLayer.LoadError for the reason.
Greg,
Thanks for the information. I finally got back around to trying this out today. When I call LoadAsync on the ArcGISSceneLayer, the LoadStatus of the layer is set to FailedToLoad and the LoadError is null.
Any ideas?
Thanks again,
Mike Hamsa
Chief Technology Officer - GeoSpatial Innovations, Inc.
P: 512-982-6735
Can you share what's in your scene layer package and how you created it? There are some layers that can go in a scene layer package that the runtime doesn't support as of yet. I suspect unsupported package contents is the case for you, but I would have expected a useful exception message.
Greg,
Yeah, I have a feeling that’s what it is as well. We’ve got a point cloud layer in that SLPK, and after looking around a little, that ma not be supported yet in the Runtime.
Do you think that may be the problem?
Thanks,
Mike Hamsa
Chief Technology Officer - GeoSpatial Innovations, Inc.
P: 512-982-6735
Yep, that's the problem. Point cloud scene layers are not currently supported by the Runtime. They are on the docket for the next release - if all goes well. I'll check the exception message and see if we can give a less confusing experience for unsupported scene layers like this.
Thank you very much Greg – that’s exactly what I needed.
Mike Hamsa
Chief Technology Officer - GeoSpatial Innovations, Inc.
P: 512-982-6735