Click or drag to resize

ElevationSourceCollection Class

A collection of elevation sources.
Inheritance Hierarchy
SystemObject
  Esri.ArcGISRuntimeRuntimeCollectionElevationSource
    Esri.ArcGISRuntimeRuntimeObservableCollectionElevationSource
      Esri.ArcGISRuntime.MappingElevationSourceCollection

Namespace:  Esri.ArcGISRuntime.Mapping
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.7.0.0
Syntax
C#
public class ElevationSourceCollection : RuntimeObservableCollection<ElevationSource>

The ElevationSourceCollection type exposes the following members.

Properties
Methods
  NameDescription
Public methodCode exampleAdd
Adds an item to the collection.
(Inherited from RuntimeCollectionT.)
Public methodAddRange (Inherited from RuntimeObservableCollectionT.)
Protected methodBlockReentrancy
Disallow reentrant attempts to change this collection. E.g. a event handler of the CollectionChanged event is not allowed to make changes to this collection.
(Inherited from RuntimeObservableCollectionT.)
Protected methodCheckReentrancy
Check and assert for reentrant attempts to change this collection.
(Inherited from RuntimeObservableCollectionT.)
Public methodCode exampleClear
Removes all items from the collection
(Inherited from RuntimeCollectionT.)
Protected methodClearItems
Called by base class Collection<T> when the list is being cleared; raises a CollectionChanged event to any listeners.
(Inherited from RuntimeObservableCollectionT.)
Public methodCode exampleContains
Determines whether the collection contains a specific value.
(Inherited from RuntimeCollectionT.)
Public methodCopyTo
Copies the elements of the collection to an Array, starting at a particular Array index.
(Inherited from RuntimeCollectionT.)
Public methodCode exampleGetEnumerator
Returns an enumerator that iterates through the collection.
(Inherited from RuntimeCollectionT.)
Public methodCode exampleIndexOf
Determines the index of a specific item in the collection.
(Inherited from RuntimeCollectionT.)
Public methodCode exampleInsert
Inserts an item to the collection at the specified index.
(Inherited from RuntimeCollectionT.)
Protected methodInsertItem
Called by base class Collection<T> when an item is added to list; raises a CollectionChanged event to any listeners.
(Inherited from RuntimeObservableCollectionT.)
Public methodMove
Moves the item at the specified index to a new location in the collection.
(Inherited from RuntimeCollectionT.)
Protected methodMoveItem
Called by base class ObservableCollection<T> when an item is to be moved within the list; raises a CollectionChanged event to any listeners.
(Inherited from RuntimeObservableCollectionT.)
Protected methodOnCollectionChanged
Raises the CollectionChanged event with the provided arguments.
(Inherited from RuntimeObservableCollectionT.)
Protected methodOnPropertyChanged
Raises a PropertyChanged event (per INotifyPropertyChanged).
(Inherited from RuntimeObservableCollectionT.)
Public methodCode exampleRemove
Removes the first occurrence of a specific object from the collection
(Inherited from RuntimeCollectionT.)
Public methodCode exampleRemoveAt
Removes the item at the specified index.
(Inherited from RuntimeCollectionT.)
Protected methodRemoveItem
Called by base class Collection<T> when an item is removed from list; raises a CollectionChanged event to any listeners.
(Inherited from RuntimeObservableCollectionT.)
Protected methodSetItem
Called by base class Collection<T> when an item is set in list; raises a CollectionChanged event to any listeners.
(Inherited from RuntimeObservableCollectionT.)
Top
Events
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.
CreateTerrainSurfaceFromRasterUse a terrain surface with elevation described by a raster file.
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.