Load a Scene from the Portal

903
2
08-24-2016 12:56 PM
AliBensaid
New Contributor II

Hi guys, I'm trying to load and show a Scene that I created on my Online Portal. I am currently able to load WebMaps using the WebMapViewModel class, but I can't find any way to load a Scene from the Portal directly ? Is there any way to do this ? Do I have to take the layers and add them to a local Scene manually ? 

Thanks !

Ali

0 Kudos
2 Replies
AliBensaid
New Contributor II

Hey guys, it's me again. 

After messing around a bit I found out that Web Scenes can be loaded through the WebMap.LoadFromPortalAsync method. But anytime I have a 3D layer on the Scene, I would receive an exception in that method concerning a "simpleRenderer" JSON deserialization issue. Does anyone have this issue or is there a fix/workaround to show 3D layers on the MapControl ?

Thank you for your answers

Ali

0 Kudos
AnttiKajanus1
Regular Contributor II

I think that WebMap is working with a Map (2d) and not with a Scene (3d). Also note that when you are working with 3d data, you need to use SceneView (with a Scene).

You should have two options here:

1) Create SceneView and Scene manually in code

2) Build your own deserialization from JSON that is returned from ArcGIS Portal Item and construct the Scene from that.

0 Kudos