Skip to content

Commit 761b01f

Browse files
committed
move integrated mesh service to girona
1 parent bee88f3 commit 761b01f

File tree

4 files changed

+23
-47
lines changed

4 files changed

+23
-47
lines changed

java/integrated-mesh-layer/src/main/java/com/esri/arcgisruntime/sample/integratedmeshlayer/MainActivity.java

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@
1818
package com.esri.arcgisruntime.sample.integratedmeshlayer;
1919

2020
import android.os.Bundle;
21+
2122
import androidx.appcompat.app.AppCompatActivity;
22-
import com.esri.arcgisruntime.geometry.Point;
2323
import com.esri.arcgisruntime.layers.IntegratedMeshLayer;
2424
import com.esri.arcgisruntime.mapping.ArcGISScene;
25-
import com.esri.arcgisruntime.mapping.ArcGISTiledElevationSource;
26-
import com.esri.arcgisruntime.mapping.Basemap;
27-
import com.esri.arcgisruntime.mapping.Surface;
2825
import com.esri.arcgisruntime.mapping.view.Camera;
2926
import com.esri.arcgisruntime.mapping.view.SceneView;
3027

@@ -39,23 +36,18 @@ protected void onCreate(Bundle savedInstanceState) {
3936

4037
// create a scene and add it to the scene view
4138
mSceneView = findViewById(R.id.sceneView);
42-
ArcGISScene scene = new ArcGISScene(Basemap.createImagery());
39+
ArcGISScene scene = new ArcGISScene();
4340
mSceneView.setScene(scene);
4441

45-
// set the base surface with world elevation
46-
Surface surface = new Surface();
47-
surface.getElevationSources().add(new ArcGISTiledElevationSource(getString(R.string.elevation_source_url)));
48-
scene.setBaseSurface(surface);
49-
50-
// create IntegratedMeshLayer and add to the scene's operational layers
51-
IntegratedMeshLayer integratedMeshLayer = new IntegratedMeshLayer(getString(R.string.mesh_layer_url));
52-
scene.getOperationalLayers().add(integratedMeshLayer);
42+
// create an integrated mesh layer of part of the city of girona
43+
IntegratedMeshLayer gironaIntegratedMeshLayer = new IntegratedMeshLayer(
44+
"https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Girona_Spain/SceneServer");
45+
scene.getOperationalLayers().add(gironaIntegratedMeshLayer);
5346

54-
// create a camera and initial camera position
55-
Camera camera = new Camera(new Point(-119.622075, 37.720650, 2104.901239), 315.50368761552056, 78.09465920130114,
56-
0.0);
47+
// create a camera focused on a part of the integrated mesh layer
48+
Camera camera = new Camera(41.9906, 2.8259, 200.0, 190.0, 65.0, 0.0);
5749

58-
// set Viewpoint for SceneView using camera
50+
// set viewpoint for the scene view using a camera
5951
mSceneView.setViewpointCamera(camera);
6052
}
6153

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
<resources>
22
<string name="app_name">Integrated mesh layer</string>
3-
<string name="mesh_layer_url">https://tiles.arcgis.com/tiles/FQD0rKU8X5sAQfh8/arcgis/rest/services/VRICON_Yosemite_Sample_Integrated_Mesh_scene_layer/SceneServer</string>
4-
<string name="elevation_source_url">http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer</string>
5-
</resources>
3+
</resources>

kotlin/integrated-mesh-layer/src/main/java/com/esri/arcgisruntime/sample/integratedmeshlayer/MainActivity.kt

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,8 @@ package com.esri.arcgisruntime.sample.integratedmeshlayer
1919

2020
import android.os.Bundle
2121
import androidx.appcompat.app.AppCompatActivity
22-
import com.esri.arcgisruntime.geometry.Point
2322
import com.esri.arcgisruntime.layers.IntegratedMeshLayer
2423
import com.esri.arcgisruntime.mapping.ArcGISScene
25-
import com.esri.arcgisruntime.mapping.ArcGISTiledElevationSource
26-
import com.esri.arcgisruntime.mapping.Basemap
27-
import com.esri.arcgisruntime.mapping.Surface
2824
import com.esri.arcgisruntime.mapping.view.Camera
2925
import kotlinx.android.synthetic.main.activity_main.*
3026

@@ -34,30 +30,22 @@ class MainActivity : AppCompatActivity() {
3430
super.onCreate(savedInstanceState)
3531
setContentView(R.layout.activity_main)
3632

37-
// create a scene to add the IntegratedMeshLayer to add subsequently add it to the SceneView
38-
ArcGISScene(Basemap.createImagery()).let { scene ->
39-
// create IntegratedMeshLayer and add to the scene's operational layers
40-
with(IntegratedMeshLayer(getString(R.string.mesh_layer_url))) {
41-
scene.operationalLayers.add(this)
42-
}
43-
sceneView.scene = scene
33+
// create an integrated mesh layer of part of the city of girona
34+
val gironaIntegratedMeshLayer = IntegratedMeshLayer("https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Girona_Spain/SceneServer")
4435

45-
// set the base surface with world elevation
46-
with(Surface()) {
47-
this.elevationSources.add(ArcGISTiledElevationSource(getString(R.string.elevation_source_url)))
48-
scene.baseSurface = this
49-
}
36+
// create a scene and add the integrated mesh layer to it
37+
val gironaScene = ArcGISScene().apply {
38+
operationalLayers.add(gironaIntegratedMeshLayer)
5039
}
5140

52-
// create a camera and initial camera position
53-
with(
54-
Camera(
55-
Point(-119.622075, 37.720650, 2104.901239), 315.50368761552056, 78.09465920130114,
56-
0.0
57-
)
58-
) {
59-
// set Viewpoint for SceneView using camera
60-
sceneView.setViewpointCamera(this)
41+
// create a camera focused on a part of the integrated mesh layer
42+
val gironaCamera = Camera(41.9906, 2.8259, 200.0, 190.0, 65.0, 0.0)
43+
44+
sceneView.apply {
45+
// set the scene to the scene view
46+
scene = gironaScene
47+
// set the viewpoint for the scene view using a camera
48+
setViewpointCamera(gironaCamera)
6149
}
6250
}
6351

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
<resources>
22
<string name="app_name">Integrated mesh layer</string>
3-
<string name="mesh_layer_url">https://tiles.arcgis.com/tiles/FQD0rKU8X5sAQfh8/arcgis/rest/services/VRICON_Yosemite_Sample_Integrated_Mesh_scene_layer/SceneServer</string>
4-
<string name="elevation_source_url">http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer</string>
53
</resources>

0 commit comments

Comments
 (0)