SceneView

fun SceneView(arcGISScene: ArcGISScene, modifier: Modifier = Modifier, onViewpointChangedForCenterAndScale: (Viewpoint) -> Unit? = null, onViewpointChangedForBoundingGeometry: (Viewpoint) -> Unit? = null, graphicsOverlays: List<GraphicsOverlay> = remember { emptyList() }, sceneViewProxy: SceneViewProxy? = null, sceneViewInteractionOptions: SceneViewInteractionOptions = remember { SceneViewInteractionOptions() }, viewLabelProperties: ViewLabelProperties = remember { ViewLabelProperties() }, selectionProperties: SelectionProperties = remember { SelectionProperties() }, isAttributionBarVisible: Boolean = true, onAttributionTextChanged: (String) -> Unit? = null, onAttributionBarLayoutChanged: (AttributionBarLayoutChangeEvent) -> Unit? = null, cameraController: CameraController = remember { GlobeCameraController() }, analysisOverlays: List<AnalysisOverlay> = remember { emptyList() }, imageOverlays: List<ImageOverlay> = remember { emptyList() }, atmosphereEffect: AtmosphereEffect = AtmosphereEffect.HorizonOnly, timeExtent: TimeExtent? = null, onTimeExtentChanged: (TimeExtent?) -> Unit? = null, spaceEffect: SpaceEffect = SpaceEffect.Stars, sunTime: Instant = SceneViewDefaults.DefaultSunTime, sunLighting: LightingMode = LightingMode.NoLight, ambientLightColor: Color = SceneViewDefaults.DefaultAmbientLightColor, onNavigationChanged: (isNavigating: Boolean) -> Unit? = null, onSpatialReferenceChanged: (spatialReference: SpatialReference?) -> Unit? = null, onLayerViewStateChanged: (GeoView.GeoViewLayerViewStateChanged) -> Unit? = null, onInteractingChanged: (isInteracting: Boolean) -> Unit? = null, onCurrentViewpointCameraChanged: (camera: Camera) -> Unit? = null, onRotate: (RotationChangeEvent) -> Unit? = null, onScale: (ScaleChangeEvent) -> Unit? = null, onUp: (UpEvent) -> Unit? = null, onDown: (DownEvent) -> Unit? = null, onSingleTapConfirmed: (SingleTapConfirmedEvent) -> Unit? = null, onDoubleTap: (DoubleTapEvent) -> Unit? = null, onLongPress: (LongPressEvent) -> Unit? = null, onTwoPointerTap: (TwoPointerTapEvent) -> Unit? = null, onPan: (PanChangeEvent) -> Unit? = null, onDrawStatusChanged: (DrawStatus) -> Unit? = null, content: @Composable SceneViewScope.() -> Unit? = null)

A compose equivalent of the view-based SceneView.

Since

200.4.0

Parameters

arcGISScene

the ArcGISScene to be rendered by this composable SceneView

modifier

Modifier to be applied to the composable SceneView

onViewpointChangedForCenterAndScale

lambda invoked when the viewpoint changes, passing a viewpoint type of ViewpointType.CenterAndScale

onViewpointChangedForBoundingGeometry

lambda invoked when the viewpoint changes, passing a viewpoint type of ViewpointType.BoundingGeometry

graphicsOverlays

graphics overlays used by this composable SceneView

sceneViewProxy

the SceneViewProxy to associate with the composable SceneView

sceneViewInteractionOptions

the SceneViewInteractionOptions used by this composable SceneView

viewLabelProperties

the ViewLabelProperties used by the composable SceneView

selectionProperties

the SelectionProperties used by the composable SceneView

isAttributionBarVisible

true if attribution bar is visible in the composable SceneView, false otherwise

onAttributionTextChanged

lambda invoked when the attribution text of the composable SceneView has changed

onAttributionBarLayoutChanged

lambda invoked when the attribution bar's position or size changes

cameraController

the CameraController to manage the position, orientation, and movement of the camera

analysisOverlays

analysis overlays that render the results of 3D visual analysis on the composable SceneView

imageOverlays

image overlays for displaying images in the composable SceneView

atmosphereEffect

the effect applied to the scene's atmosphere

timeExtent

the TimeExtent used by the composable SceneView

onTimeExtentChanged

lambda invoked when the composable SceneView's TimeExtent is changed

spaceEffect

the visual effect of outer space in the composable SceneView

sunTime

the position of the sun in the composable SceneView based on a specific date and time

sunLighting

the type of ambient sunlight and shadows in the composable SceneView

ambientLightColor

the color of the composable SceneView's ambient light

onNavigationChanged

lambda invoked when the navigation status of the composable SceneView has changed

onSpatialReferenceChanged

lambda invoked when the spatial reference of the composable SceneView has changed

onLayerViewStateChanged

lambda invoked when the composable SceneView's layer view state is changed

onInteractingChanged

lambda invoked when the user starts and ends interacting with the composable SceneView

onCurrentViewpointCameraChanged

lambda invoked when the viewpoint camera of the composable SceneView has changed

onRotate

lambda invoked when a user performs a rotation gesture on the composable SceneView

onScale

lambda invoked when a user performs a pinch gesture on the composable SceneView

onUp

lambda invoked when the user removes all their pointers from the composable SceneView

onDown

lambda invoked when the user first presses on the composable SceneView

onSingleTapConfirmed

lambda invoked when the user taps once on the composable SceneView

onDoubleTap

lambda invoked the user double taps on the composable SceneView

onLongPress

lambda invoked when a user holds a pointer on the composable SceneView

onTwoPointerTap

lambda invoked when a user taps two pointers on the composable SceneView

onPan

lambda invoked when a user drags a pointer or pointers across composable SceneView

onDrawStatusChanged

lambda invoked when the draw status of the composable SceneView is changed

content

the content of the composable SceneView

See also

Samples

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import com.arcgismaps.Color
import com.arcgismaps.data.ServiceFeatureTable
import com.arcgismaps.geometry.Point
import com.arcgismaps.geometry.SpatialReference
import com.arcgismaps.mapping.ArcGISMap
import com.arcgismaps.mapping.ArcGISScene
import com.arcgismaps.mapping.ArcGISTiledElevationSource
import com.arcgismaps.mapping.BasemapStyle
import com.arcgismaps.mapping.Surface
import com.arcgismaps.mapping.Viewpoint
import com.arcgismaps.mapping.layers.FeatureLayer
import com.arcgismaps.mapping.symbology.SimpleLineSymbol
import com.arcgismaps.mapping.symbology.SimpleLineSymbolStyle
import com.arcgismaps.mapping.symbology.SimpleRenderer
import com.arcgismaps.mapping.view.Camera
import com.arcgismaps.toolkit.geoviewcompose.MapView
import com.arcgismaps.toolkit.geoviewcompose.SceneView

fun main() { 
   //sampleStart 
   // Display a SceneView with an elevation surface and an initial viewpoint

// add base surface for elevation data
val elevationSource = ArcGISTiledElevationSource(
    uri = "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"
)

val surface = Surface().apply {
    elevationSources.add(elevationSource)
    // add an exaggeration factor to increase the 3D effect of the elevation.
    elevationExaggeration = 2.5f
}

val cameraLocation = Point(
    x = -118.794,
    y = 33.909,
    z = 5330.0,
    spatialReference = SpatialReference.wgs84()
)

val camera = Camera(
    locationPoint = cameraLocation,
    heading = 355.0,
    pitch = 72.0,
    roll = 0.0
)

// create a scene to display the elevation source
val scene by remember {
    mutableStateOf(ArcGISScene(BasemapStyle.ArcGISImagery).apply {
        baseSurface = surface
        initialViewpoint = Viewpoint(cameraLocation, camera)
    })
}

// display the Composable SceneView
SceneView(
    scene,
    modifier = Modifier.fillMaxSize(),
) 
   //sampleEnd
}