Display an ArcGIS scene layer from a URL.
Use case
Adding a scene layer from a URL allows you to author the scene layer elsewhere in the platform, say with ArcGIS Pro or CityEngine, and then add that scene layer to a scene in Runtime. Loading a scene layer from a URL also permits the layer source to change dynamically without updating the code.
How to use the sample
Pan and zoom to explore the scene.
How it works
- Create an
ArcGISSceneLayer
passing in the URL to a scene layer service. - Wait for the user to tap with the
sceneView.GeoViewTapped
event and get the tapped screen point. - Call
sceneView.IdentifyLayersAsync(sceneLayer, screenPoint, tolerance, false, 1)
to identify features in the scene. - From the resulting
IdentifyLayerResult
, get the list of identifiedGeoElements
withresult.GeoElements
. - Get the first element in the list, checking that it is a feature, and call
sceneLayer.SelectFeature(feature)
to select it.
Relevant API
- ArcGISScene
- ArcGISSceneLayer
- SceneView
About the data
This sample shows a Portland, Oregon USA Scene hosted on ArcGIS Online.
Tags
3D, buildings, model, Portland, scene, service, URL
Sample Code
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="ArcGISRuntime.Samples.SceneLayerUrl.SceneLayerUrl"
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">
<Grid>
<esriUI:SceneView x:Name="MySceneView" />
</Grid>
</ContentPage>