Hello ,
I need to display a sceneLayer using a scene layer package(.slpk) , i don't know if i'm doing things right
here's my code
private async void startLocalServer()
{
// Create new Scene
MySceneView.Scene = new Scene();
// Create new scene layer from the url
string sceneURI = @"C:\Users\mkeddar\Documents\scene\sceneLayer.slpk";
ArcGISSceneLayer sceneLayer = new ArcGISSceneLayer(new System.Uri(sceneURI));
MySceneView.Scene.OperationalLayers.Add(sceneLayer);
await sceneLayer.LoadAsync();
MapPoint mp = sceneLayer.FullExtent.Extent.GetCenter();
MapPoint newMapoint = new MapPoint(mp.X, mp.Y, 5000, sceneLayer.SpatialReference);
Camera Camera = new Camera(newMapoint, 90, 0, 0);
MySceneView.SetViewpointCamera(Camera);
}
My code doesn't show me any thing and when i debug the layer is not loaded , there's no error message
i use arcgis runtime version 100.1 (developer mode) ,i've shared my (.slpk) and my layer , please help
thanks
Hello,
did you try to add a Basemap to the Scene and Load the Scene before adding the Operational Layer:
MySceneView.Scene = new Scene(BasemapType.Topographic);
MySceneView.Scene.LoadAsync();
MySceneView.Scene.OperationalLayers.Add(layer);
I've already tried it but it doesn't work i have now an exception telling me ('System.Threading.Tasks.TaskCanceledException' has been produced on WindowsBase.dll) very wired , i'm may be saying that may be (.slpk) is not yet supported with the local server cause i have the same problem with (.mmpk) file Local Server package support—ArcGIS Runtime SDK for .NET (WPF) | ArcGIS for Developers
I had a problem with .slpk i created it using python script ) and it didn't work when i created it using geoprocessing tool of arcGis pro it worked and i succeeded to display the sceneLayers , do you know how to edit the scene Layers by adding 3D Feature (3D geometries) ?