Click or drag to resize

ArcGISTiledElevationSource Class

Class that represents an elevation source that can visualize an ArcGIS elevation image service.
Inheritance Hierarchy
SystemObject
  Esri.ArcGISRuntime.MappingElevationSource
    Esri.ArcGISRuntime.MappingArcGISTiledElevationSource

Namespace:  Esri.ArcGISRuntime.Mapping
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.7.0.0
Syntax
C#
public sealed class ArcGISTiledElevationSource : ElevationSource

The ArcGISTiledElevationSource type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleArcGISTiledElevationSource
Initializes a new instance of the ArcGISTiledElevationSource class.
Public methodCode exampleArcGISTiledElevationSource(Uri)
Initializes a new instance of the ArcGISTiledElevationSource class from the specified URI.
Public methodArcGISTiledElevationSource(Item)
Initializes a new instance of the ArcGISTiledElevationSource class with the specified PortalItem.
Public methodCode exampleArcGISTiledElevationSource(TileCache)
Initializes a new instance of the ArcGISTiledElevationSource class with the specified TileCache.
Top
Properties
  NameDescription
Public propertyCredential
Gets or sets the Credential used to access a remote service.
Public propertyIsEnabled
Gets or sets the enabled state of the elevation source.
(Inherited from ElevationSource.)
Public propertyItem
Gets the PortalItem for the elevation source.
Public propertyLoadError
Gets the load error of the elevation source (null if loading was successful).
(Inherited from ElevationSource.)
Public propertyLoadStatus
Gets the load status of the elevation source.
(Inherited from ElevationSource.)
Public propertyName
Gets or sets the name of the elevation source.
(Inherited from ElevationSource.)
Public propertyCode exampleSource
Gets or sets the endpoint of the ArcGIS elevation service.
Public propertyTileCache
Gets or sets the TileCache for a local elevation source tile package.
Top
Methods
  NameDescription
Public methodCancelLoad
Cancels an ongoing load.
(Inherited from ElevationSource.)
Public methodLoadAsync
Initiates loading of the elevation source.
(Inherited from ElevationSource.)
Public methodRetryLoadAsync
Retry loading the elevation source.
(Inherited from ElevationSource.)
Top
Events
  NameDescription
Public eventLoaded
Occurs when the elevation source is loaded.
(Inherited from ElevationSource.)
Public eventLoadStatusChanged
Occurs when the elevation source LoadStatus property is changed.
(Inherited from ElevationSource.)
Public eventPropertyChanged
Occurs when a property value changes.
(Inherited from ElevationSource.)
Top
Remarks
An ArcGIS tiled elevation source provides elevation data on which layers may be draped or offset from.
Examples

Android

Example Name: ChangeAtmosphereEffect

Changes the appearance of the atmosphere in a scene.

Code example screen shot.

C#
// Copyright 2019 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: http://www.apache.org/licenses/LICENSE-2.0
// 
// 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 System;
using Android.App;
using Android.OS;
using Android.Views;
using Android.Widget;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.UI;
using Esri.ArcGISRuntime.UI.Controls;
using Surface = Esri.ArcGISRuntime.Mapping.Surface;

namespace ArcGISRuntimeXamarin.Samples.ChangeAtmosphereEffect
{
    [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "Change atmosphere effect",
        "Map",
        "Change the appearance of the atmosphere in a scene.",
        "",
        "3D", "AtmosphereEffect", "Scene")]
    public class ChangeAtmosphereEffect : Activity
    {
        // Hold references to the UI controls.
        private SceneView _mySceneView;
        private Button _realisticOption;
        private Button _horizonOnlyOption;
        private Button _noneOption;

        private readonly string _elevationServiceUrl = "http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer";

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Title = "Change atmosphere effect";

            CreateLayout();
            Initialize();
        }

        private void Initialize()
        {
            // Create the scene with a basemap.
            _mySceneView.Scene = new Scene(Basemap.CreateImagery());

            // Add an elevation source to the scene.
            Surface elevationSurface = new Surface();
            ArcGISTiledElevationSource elevationSource = new ArcGISTiledElevationSource(new Uri(_elevationServiceUrl));
            elevationSurface.ElevationSources.Add(elevationSource);
            _mySceneView.Scene.BaseSurface = elevationSurface;

            // Set the initial viewpoint.
            Camera initialCamera = new Camera(64.416919, -14.483728, 100, 318, 105, 0);
            _mySceneView.SetViewpointCamera(initialCamera);

            // Apply the selected atmosphere effect option.
            _realisticOption.Click += (o, e) => _mySceneView.AtmosphereEffect = AtmosphereEffect.Realistic;
            _horizonOnlyOption.Click += (o, e) => _mySceneView.AtmosphereEffect = AtmosphereEffect.HorizonOnly;
            _noneOption.Click += (o, e) => _mySceneView.AtmosphereEffect = AtmosphereEffect.None;
        }

        private void CreateLayout()
        {
            // Create a new vertical layout for the app.
            var layout = new LinearLayout(this) { Orientation = Orientation.Vertical };

            // Create a new horizontal layout to hold buttons for all three options.
            var buttonContainer = new LinearLayout(this) { Orientation = Orientation.Horizontal };

            // Layout parameters allow buttons to share space equally in the view.
            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.MatchParent,
                ViewGroup.LayoutParams.MatchParent,
                1.0f
            );

            // Create the scene view.
            _mySceneView = new SceneView(this);

            // Create the buttons and add them to the button container.
            _realisticOption = new Button(this);
            _realisticOption.Text = "Realistic";
            _realisticOption.LayoutParameters = layoutParams;

            _horizonOnlyOption = new Button(this);
            _horizonOnlyOption.Text = "Horizon only";
            _horizonOnlyOption.LayoutParameters = layoutParams;

            _noneOption = new Button(this);
            _noneOption.Text = "None";
            _noneOption.LayoutParameters = layoutParams;

            buttonContainer.AddView(_realisticOption);
            buttonContainer.AddView(_horizonOnlyOption);
            buttonContainer.AddView(_noneOption);

            // Add the views to the layout.
            layout.AddView(buttonContainer);
            layout.AddView(_mySceneView);

            // Show the layout in the app.
            SetContentView(layout);
        }
    }
}
Examples

Xamarin Forms Android

Example Name: SceneLayerUrl

Display an ArcGIS scene layer from a URL.

Code example screen shot.

C#
// 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: http://www.apache.org/licenses/LICENSE-2.0
// 
// 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 System;
using Esri.ArcGISRuntime.Geometry;
using Xamarin.Forms;

namespace ArcGISRuntime.Samples.SceneLayerUrl
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "ArcGIS scene layer (URL)",
        "Layers",
        "Display an ArcGIS Scene layer from a service.",
        "")]
    public partial class SceneLayerUrl : ContentPage
    {
        // URL for a service to use as an elevation source.
        private readonly Uri _elevationSourceUrl = new Uri(
            "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer");

        // URL for the scene layer.
        private readonly Uri _serviceUri = new Uri(
            "https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Buildings_Portland/SceneServer");

        public SceneLayerUrl()
        {
            InitializeComponent();
            Initialize();
        }

        private async void Initialize()
        {
            // Create new Scene.
            Scene myScene = new Scene {Basemap = Basemap.CreateImagery()};

            // Create and add an elevation source for the Scene.
            ArcGISTiledElevationSource elevationSrc = new ArcGISTiledElevationSource(_elevationSourceUrl);
            myScene.BaseSurface.ElevationSources.Add(elevationSrc);

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

            // Add created layer to the operational layers collection.
            myScene.OperationalLayers.Add(sceneLayer);

            try
            {
                // Load the layer.
                await sceneLayer.LoadAsync();

                // Get the center of the scene layer.
                MapPoint center = (MapPoint)GeometryEngine.Project(sceneLayer.FullExtent.GetCenter(), SpatialReferences.Wgs84);

                // Create a camera with coordinates showing layer data.
                Camera camera = new Camera(center.Y, center.X, 225, 220, 80, 0);

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

                // Set view point of scene view using camera.
                await MySceneView.SetViewpointCameraAsync(camera);
            }
            catch (Exception e)
            {
                await Application.Current.MainPage.DisplayAlert("Error", e.ToString(), "OK");
            }
        }
    }
}
XAML
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"             
             xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms"
             xmlns:mapping="clr-namespace:Esri.ArcGISRuntime.Mapping;assembly=Esri.ArcGISRuntime" 
             x:Class="ArcGISRuntime.Samples.SceneLayerUrl.SceneLayerUrl">
  <Grid>
        <esriUI:SceneView x:Name="MySceneView">
        </esriUI:SceneView>
  </Grid>
</ContentPage>
See Also
Additional Examples
Hyperlink to ExampleDescription
AddAnIntegratedMeshLayerView an integrated mesh layer from a scene service.
Animate3DGraphicAn `OrbitGeoElementCameraController` follows a graphic while the graphic's position and rotation are animated.
ChangeAtmosphereEffectChanges the appearance of the atmosphere in a scene.
ChooseCameraControllerControl the behavior of the camera in a scene.
CreateTerrainSurfaceFromTilePackageSet the terrain surface with elevation described by a local tile package.
DisplaySceneDisplay a scene with a terrain surface and some imagery.
DistanceMeasurementMeasure distances between two points in 3D.
GetElevationAtPointGet the elevation for a given point on a surface in a scene.
LineOfSightGeoElementShow a line of sight between two moving objects.
LineOfSightLocationPerform a line of sight analysis between two points in real time.
ListKmlContentsList the contents of a KML file. KML files can contain a hierarchy of features, including network links to other KML content.
PlayKmlToursPlay tours in KML files.
SceneLayerSelectionIdentify GeoElements in a scene layer.
SceneLayerUrlDisplay an ArcGIS scene layer from a URL.
SceneSymbolsShow various kinds of 3D symbols in a scene.
SurfacePlacementsPosition graphics relative to a surface using different surface placement modes.
TerrainExaggerationConfigure the vertical exaggeration of terrain (the ground surface) in a scene.
ViewPointCloudDataOfflineDisplay local 3D point cloud data.
ViewshedCameraAnalyze the viewshed for a camera. A viewshed shows the visible and obstructed areas from an observer's vantage point.
ViewshedGeoElementAnalyze the viewshed for an object (GeoElement) in a scene.
ViewshedLocationPerform a viewshed analysis from a defined vantage point. Viewshed analyses have several configuration options that are demonstrated in this sample.