Global and local scenes using different projections to display the same basemap layer and feature layer
What are global and local scenes?
Global and local scenes are different viewing modes you can use to visualize 3D data. When you work with a scene, you choose whether to render the data on a globe or to project it on a plane that can be navigated in 3D space.
A global scene is typically used to display data that spans around the globe when viewing the curvature of the earth is important.
A local scene is a projected view of a surface that is typically used for smaller extents. It is useful when visualizing data such as a country or a city. To show only a region of interest, you can clip a local scene to an extent.
A global scene generally displays data in a geographic coordinate system, while local scenes can only display data in projected coordinate systems.
In both global and local scenes, you can display data below the ground and navigate below and above the ground.
How to create a scene
To create a global or local scene, you define the basemap layer and data layers to display and then set the camera properties.
Define the scene
The first step is to create the scene with a basemap layer and/or data layers. You can also reference an elevation service to display the scene with relief.
ArcGIS API for JavaScriptArcGIS Runtime API for .NETArcGIS Runtime API for AndroidArcGIS Runtime API for iOSArcGIS Runtime API for JavaArcGIS Runtime API for Qt (C++)ArcGIS Runtime API for Qt (QML)
Now display the scene using a scene view. You set the scene view's perspective of the scene by defining the scene view's camera, specifying the camera's location (including height), heading, and tilt (or pitch).
If the API supports local scenes
.NET, Android, iOS, Java and Qt APIs currently only support global scenes.
, you use the scene view to specify whether the viewing mode is local or global.
ArcGIS API for JavaScriptArcGIS Runtime API for .NETArcGIS Runtime API for AndroidArcGIS Runtime API for iOSArcGIS Runtime API for JavaArcGIS Runtime API for Qt (C++)ArcGIS Runtime API for Qt (QML)
This example displays earthquake data on a globe. The scene uses the Vintage Shaded Relief layer as a basemap. Additionally the earthquakes data layer is loaded as a CSV layer
.NET, Android, iOS, Java and Qt API examples use a hosted feature layer.
. Set the scene on a scene view along with a camera position and a global viewing mode.
ArcGIS API for JavaScriptArcGIS Runtime API for .NETArcGIS Runtime API for AndroidArcGIS Runtime API for iOSArcGIS Runtime API for JavaArcGIS Runtime API for Qt (C++)ArcGIS Runtime API for Qt (QML)
Use dark colors for code blocks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html><html><head><metacharset="utf-8" /><title>Earthquakes on a globe</title><linkrel="stylesheet"href="https://js.arcgis.com/4.23//esri/themes/light/main.css" /><scriptsrc="https://js.arcgis.com/4.23//"></script><style>html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
background-color: aliceblue;
}
.esri-legend {
background-color: rgba(255, 255, 255, 0.8);
}
</style><script>require([
"esri/config",
"esri/Map",
"esri/layers/CSVLayer",
"esri/views/SceneView",
"esri/layers/TileLayer",
"esri/Basemap" ],(esriConfig, Map, CSVLayer, SceneView, TileLayer, Basemap)=> {
// If CSV files are not on the same domain as your website, a CORS enabled server// or a proxy is required. esriConfig.apiKey = "YOUR_API_KEY";
const url =
"https://developers.arcgis.com/javascript/latest/sample-code/layers-csv/live/earthquakes.csv";
// Paste the url into a browser's address bar to download and view the attributes// in the CSV file. These attributes include:// * mag - magnitude// * type - earthquake or other event such as nuclear test// * place - location of the event// * time - the time of the eventconst template = {
title: "Earthquake Info",
content: "Magnitude {mag} {type} hit {place} on {time}." };
const csvLayer = new CSVLayer({
url: url,
copyright: "USGS Earthquakes",
popupTemplate: template
});
csvLayer.renderer = {
type: "simple", // autocasts as new SimpleRenderer()symbol: {
type: "point-3d", // autocasts as new PointSymbol3D()// for this symbol we use 2 symbol layers, one for the outer circle// and one for the inner circlesymbolLayers: [
{
type: "icon", // autocasts as new IconSymbol3DLayer()resource: { primitive: "circle" },
material: { color: [255, 84, 54, 0.6] },
size: 5 },
{
type: "icon", // autocasts as new IconSymbol3DLayer()resource: { primitive: "circle" },
material: { color: [255, 84, 54, 0] },
outline: { color: [255, 84, 54, 0.6], size: 1 },
size: 10 }
]
}
};
const map = newMap({
basemap: new Basemap({
baseLayers: [
new TileLayer({
url: "https://tiles.arcgis.com/tiles/nGt4QxSblgDfeJn9/arcgis/rest/services/VintageShadedRelief/MapServer" })
]
}),
layers: [csvLayer]
});
const view = new SceneView({
container: "viewDiv",
map: map,
// Indicates to create a global sceneviewingMode: "global",
camera: {
position: [
-63.77153412,
20.75790715,
25512548.00000 ],
heading: 0.00,
tilt: 0.10 },
constraints: {
altitude: {
min: 700000 }
},
qualityProfile: "high",
alphaCompositingEnabled: true,
highlightOptions: {
fillOpacity: 0,
color: "#ffffff" },
environment: {
background: {
type: "color",
color: [0, 0, 0, 0]
},
atmosphere: null,
starsEnabled: false }
});
});
</script></head><body><divid="viewDiv"></div></body></html>
Create a local scene
This example displays earthquakes in a clipped, local scene. The scene view displays a basemap and earthquake data that is displayed below the ground plane. Enable navigation below the ground to permit exploring the earthquakes. Additionally, the view uses a clipping extent to display only the area of interest.