ArcGIS Runtime SDK for .NET Samples

ArcGIS scene layer (URL)

Buildings from a scene service


// Copyright 2017 Esri.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
// language governing permissions and limitations under the License.

using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.UI.Controls;
using Foundation;
using System;
using UIKit;

namespace ArcGISRuntime.Samples.SceneLayerUrl
        "ArcGIS scene layer (URL)",
        "This sample demonstrates how to add an ArcGISSceneLayer as a layer in a Scene.",
    public class SceneLayerUrl : UIViewController
        // Constant holding offset where the SceneView control should start
        private const int yPageOffset = 60;

        // Create a new SceneView control
        private SceneView _mySceneView = new SceneView();

        // URL for a service to use as an elevation source
        private Uri _elevationSourceUrl = new Uri(@"");

        // URL for the scene layer
        private Uri _serviceUri = new Uri(

        public SceneLayerUrl()
            Title = "ArcGIS scene layer (URL)";

        public override void ViewDidLoad()

            // Execute initialization

        public override void ViewDidLayoutSubviews()
            // Setup the visual frame for the SceneView
            _mySceneView.Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);


        private void Initialize()
            // Create new Scene
            Scene myScene = new Scene();

            // Set Scene's base map property
            myScene.Basemap = Basemap.CreateImagery();

            // Create and add an elevation source for the Scene
            ArcGISTiledElevationSource elevationSrc = new ArcGISTiledElevationSource(_elevationSourceUrl);

            // Create new scene layer from the url
            ArcGISSceneLayer sceneLayer = new ArcGISSceneLayer(_serviceUri);

            // Add created layer to the operational layers collection

            // Create a camera with coordinates showing layer data
            Camera camera = new Camera(48.378, -4.494, 200, 345, 65, 0);

            // Assign the Scene to the SceneView
            _mySceneView.Scene = myScene;

            // Set view point of scene view using camera

        private void CreateLayout()
            // Add SceneView to the page

In this topic
  1. Code