Skip to content

Commit fa4364f

Browse files
authored
Remove redundant elevation source from TableTop micro app (#809)
* remove redundant elevation source from TableTop micro app * update code snippet of TableTop readme * update readme code snippet to match micro app * set opacity on existing base surface instead of creating a new one * remove redundant import
1 parent e7a950e commit fa4364f

File tree

2 files changed

+4
-14
lines changed
  • microapps/ArTabletopApp/app/src/main/java/com/arcgismaps/toolkit/artabletopapp/screens
  • toolkit/ar

2 files changed

+4
-14
lines changed

microapps/ArTabletopApp/app/src/main/java/com/arcgismaps/toolkit/artabletopapp/screens/MainScreen.kt

+2-8
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ import com.arcgismaps.LoadStatus
4141
import com.arcgismaps.data.ArcGISFeature
4242
import com.arcgismaps.geometry.Point
4343
import com.arcgismaps.mapping.ArcGISScene
44-
import com.arcgismaps.mapping.ElevationSource
45-
import com.arcgismaps.mapping.Surface
4644
import com.arcgismaps.mapping.layers.ArcGISSceneLayer
4745
import com.arcgismaps.mapping.view.ScreenCoordinate
4846
import com.arcgismaps.toolkit.ar.TableTopSceneView
@@ -60,12 +58,8 @@ fun MainScreen() {
6058
val arcGISScene = remember {
6159
ArcGISScene().apply {
6260
operationalLayers.add(arcGISSceneLayer)
63-
baseSurface = Surface().apply {
64-
elevationSources.add(
65-
ElevationSource.fromTerrain3dService()
66-
)
67-
opacity = 0f
68-
}
61+
// for the purpose of this sample, we want the base surface to be fully transparent
62+
baseSurface.opacity = 0f
6963
}
7064
}
7165
val arcGISSceneAnchor = remember {

toolkit/ar/README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ If ARCore is not optional for your application to function (as is the case with
5757
<meta-data android:name="com.google.ar.core" android:value="required" />
5858
```
5959

60-
Configure an `ArcGISScene` with the data you want to render in the table top scene:
60+
Configure an `ArcGISScene` with the data and base surface required for your table top use case:
6161

6262
```kotlin
6363

@@ -69,11 +69,7 @@ fun MainScreen() {
6969
operationalLayers.add(
7070
ArcGISSceneLayer("https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/DevA_BuildingShells/SceneServer")
7171
)
72-
baseSurface = Surface().apply {
73-
elevationSources.add(
74-
ElevationSource.fromTerrain3dService()
75-
)
76-
}
72+
baseSurface.opacity = 0f
7773
}
7874
}
7975
...

0 commit comments

Comments
 (0)