Class ArcGISScene
- java.lang.Object
-
- com.esri.arcgisruntime.mapping.GeoModel
-
- com.esri.arcgisruntime.mapping.ArcGISScene
-
- All Implemented Interfaces:
Loadable
public final class ArcGISScene extends GeoModel
An ArcGISScene contains the layers of mapping data which are visualized in a SceneView.In an MVC architecture, an ArcGISScene represents the model and a SceneView represents the view.
An ArcGISScene specifies how the geographic data is organized, and a SceneView renders the data on the screen and allows users to interact with it.
An ArcGISScene contains a BaseMap, a Surface, usually one or more operational layers, and potentially tables:
- A Basemap is a map layer that helps orient the user of the map. Typically it sits behind operational layers and shows features, such as roads and parcel boundaries, to give context to operational layers. Basemaps can also contain layers which are drawn over the top operational layers such as label layers.
- A Surface is a collection of
ElevationSource
that determines how elevation is handled in the scene. It also contains theBackgroundGrid
for the ArcGISScene. - An operational layer provides content that is of unique interest to the app and the task at hand, such as data about earthquakes, traffic, or weather for example. Its content might change frequently.
- A table contains data potentially related to the Scene or one of the operational layers within the scene.
An ArcGISScene can be manually created by adding layers or it can be derived from a web scene stored an an ArcGIS Portal. It can also be created from a JSON string with
fromJson(String)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ArcGISScene.BasemapChangedEvent
An event which indicates that the Basemap of the source has changed.static interface
ArcGISScene.BasemapChangedListener
The listener interface to get notified when the Basemap of the ArcGISScene changes.static class
ArcGISScene.SceneViewTilingScheme
Defines types of tiling scheme used for tiled layers.
-
Constructor Summary
Constructors Constructor Description ArcGISScene()
Creates an empty ArcGISScene instance.ArcGISScene(ArcGISScene.SceneViewTilingScheme sceneViewTilingScheme)
Creates an ArcGISScene instance which will use the specified tiling scheme for tiled layers.ArcGISScene(Basemap basemap)
Creates an ArcGISScene instance which will contain just a basemap.ArcGISScene(Basemap.Type basemapType)
Deprecated.100.14.0.ArcGISScene(Basemap basemap, Surface baseSurface)
Creates an ArcGISScene instance which will contain a basemap and a base surface.ArcGISScene(BasemapStyle basemapStyle)
Creates an ArcGISScene from a basemap style.ArcGISScene(PortalItem portalItem)
Creates an ArcGISScene instance based on a PortalItem.ArcGISScene(java.lang.String webSceneUrl)
Creates an ArcGISScene instance from a web scene URL.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBasemapChangedListener(ArcGISScene.BasemapChangedListener listener)
Adds a BasemapChangedListener to thisArcGISScene
that gets invoked when the Basemap has changed.ArcGISScene
copy()
Creates a copy of this ArcGISScene instance.static ArcGISScene
fromJson(java.lang.String json)
Creates an ArcGISScene instance from a JSON string.Surface
getBaseSurface()
Gets the base surface of this ArcGISScene with a new surface.ArcGISScene.SceneViewTilingScheme
getSceneViewTilingScheme()
Gets thegetSceneViewTilingScheme()
used to render tile based data.java.util.Map<java.lang.String,java.lang.Object>
getUnknownJson()
If this object was created from JSON, this method gets unknown data from the source JSON.java.util.Map<java.lang.String,java.lang.Object>
getUnsupportedJson()
If this object was created from JSON, this method gets unsupported data from the source JSON.boolean
removeBasemapChangedListener(ArcGISScene.BasemapChangedListener listener)
Removes a BasemapChangedListener from thisArcGISScene
.void
setBaseSurface(Surface baseSurface)
Sets the base surface of this ArcGISScene with a new surface.-
Methods inherited from class com.esri.arcgisruntime.mapping.GeoModel
addDoneLoadingListener, addLoadStatusChangedListener, cancelLoad, getBasemap, getBookmarks, getFloorDefinition, getFloorManager, getGeotriggersInfo, getInitialViewpoint, getItem, getLoadError, getLoadSettings, getLoadStatus, getOperationalLayers, getSpatialReference, getTables, getTransportationNetworks, getVersion, loadAsync, removeDoneLoadingListener, removeLoadStatusChangedListener, retryLoadAsync, setBasemap, setFloorDefinition, setInitialViewpoint, setItem, setLoadSettings
-
-
-
-
Constructor Detail
-
ArcGISScene
public ArcGISScene()
Creates an empty ArcGISScene instance.- Since:
- 100.0.0 for JavaSE and 100.1.0 for Android
- See Also:
GeoModel.loadAsync()
,GeoModel
-
ArcGISScene
public ArcGISScene(Basemap basemap)
Creates an ArcGISScene instance which will contain just a basemap.- Parameters:
basemap
- the Basemap used with this ArcGISScene- Throws:
java.lang.IllegalArgumentException
- if the basemap is null- Since:
- 100.0.0 for JavaSE and 100.1.0 for Android
- See Also:
Basemap
-
ArcGISScene
public ArcGISScene(Basemap basemap, Surface baseSurface)
Creates an ArcGISScene instance which will contain a basemap and a base surface.- Parameters:
basemap
- the Basemap used with this ArcGISScenebaseSurface
- the Surface to use as the base surface of this scene- Throws:
java.lang.IllegalArgumentException
- if the basemap is nulljava.lang.IllegalArgumentException
- if the base surface is null- Since:
- 100.0.0 for JavaSE and 100.1.0 for Android
- See Also:
Basemap
,Surface
-
ArcGISScene
@Deprecated public ArcGISScene(Basemap.Type basemapType)
Deprecated.100.14.0. UseArcGISScene.ArcGISScene(BasemapStyle)
.Creates an ArcGISScene instance which will contain just a basemap.In order to take advantage of geographically load balanced services and monitor usage with API keys or named users, use
ArcGISScene(BasemapStyle)
.- Parameters:
basemapType
- the type of Basemap used with this ArcGISScene- Throws:
java.lang.IllegalArgumentException
- if the basemapType is null- Since:
- 100.0.0 for JavaSE and 100.1.0 for Android
- See Also:
Basemap.Type
-
ArcGISScene
public ArcGISScene(ArcGISScene.SceneViewTilingScheme sceneViewTilingScheme)
Creates an ArcGISScene instance which will use the specified tiling scheme for tiled layers.- Parameters:
sceneViewTilingScheme
- the tiling scheme for tiled layers- Throws:
java.lang.IllegalArgumentException
- if the sceneViewTilingScheme is null- Since:
- 100.2.1
-
ArcGISScene
public ArcGISScene(PortalItem portalItem)
Creates an ArcGISScene instance based on a PortalItem.If the portal item is not in
LoadStatus.LOADED
state it will be loaded automatically when this ArcGISScene instance is loaded.If the loaded portalItem is not of type
PortalItem.Type.WEB_SCENE
the ArcGISScene will fail to load.- Parameters:
portalItem
- the PortalItem associated with this ArcGISScene instance- Throws:
java.lang.IllegalArgumentException
- if the portalItem is null- Since:
- 100.3.0
- See Also:
PortalItem
-
ArcGISScene
public ArcGISScene(java.lang.String webSceneUrl)
Creates an ArcGISScene instance from a web scene URL.If the specified URI is a portal item URL (see
PortalItem(Portal, String)
for the supported URL formats), the underlyingPortalItem
will be created and accessible throughGeoModel.getItem()
.Example URLs:
http://www.arcgis.com/home/item.html?id=[web_scene_id]
http://www.arcgis.com/home/webscene/viewer.html?webscene=[web_scene_id]
http://www.arcgis.com/sharing/rest/content/items/[web_scene_id]/data
http://www.arcgis.com/sharing/rest/content/items/[web_scene_id]?f=pjson
- Parameters:
webSceneUrl
- the URL of the web scene on ArcGIS Online or an on-premises portal- Throws:
java.lang.IllegalArgumentException
- if the URL is null or emptyjava.lang.IllegalArgumentException
- if the URL does not match the basic URL types- Since:
- 100.3.0
- See Also:
PortalItem
,PortalItem(Portal, String)
,GeoModel.getItem()
-
ArcGISScene
public ArcGISScene(BasemapStyle basemapStyle)
Creates an ArcGISScene from a basemap style.These basemaps are secured and access requires either an
ArcGISRuntimeEnvironment.setApiKey(String)
or a named user.- Parameters:
basemapStyle
- a basemap style- Throws:
java.lang.IllegalArgumentException
- if basemapStyle is null- Since:
- 100.10.0
- See Also:
BasemapStyle
-
-
Method Detail
-
copy
public ArcGISScene copy()
Creates a copy of this ArcGISScene instance.- Returns:
- a deep copy of this ArcGISScene instance, which means that copies of all fields of this scene are made including its loading state.
- Since:
- 100.13.0
-
fromJson
public static ArcGISScene fromJson(java.lang.String json)
Creates an ArcGISScene instance from a JSON string.- Parameters:
json
- the JSON representation of an ArcGISScene- Returns:
- an ArcGISScene instance deserialized from the JSON string
- Throws:
java.lang.IllegalArgumentException
- if json is null or empty- Since:
- 100.3.0
-
getUnknownJson
public java.util.Map<java.lang.String,java.lang.Object> getUnknownJson()
If this object was created from JSON, this method gets unknown data from the source JSON. Unknown JSON is a Map of values that were in the source JSON but are not known by the Runtime and therefore not exposed in the API.- Returns:
- an unmodifiable Map containing unknown JSON data. The keys are Strings containing names. The types of
the values depend on the types of tokens within the JSON as follows:
- a
Map<String, Object>
represents an object in the JSON - a
List<Object>
represents an array in the JSON - a
String
represents a string in the JSON - a
Double
represents a number in the JSON - a
Boolean
represents true or false in the JSON null
represents null in the JSON
- a
- Since:
- 100.3.0
-
getUnsupportedJson
public java.util.Map<java.lang.String,java.lang.Object> getUnsupportedJson()
If this object was created from JSON, this method gets unsupported data from the source JSON. Unsupported JSON is a Map of values that are supported by webscenes and known to the version of the webscene specification the API supportsGeoModel.getVersion()
, but are not explicitly exposed through the Runtime API.- Returns:
- an unmodifiable Map containing unsupported JSON data. The keys are Strings containing names. The types of
the values depend on the types of tokens within the JSON as follows:
- a
Map<String, Object>
represents an object in the JSON - a
List<Object>
represents an array in the JSON - a
String
represents a string in the JSON - a
Double
represents a number in the JSON - a
Boolean
represents true or false in the JSON null
represents null in the JSON
- a
- Since:
- 100.3.0
-
setBaseSurface
public void setBaseSurface(Surface baseSurface)
Sets the base surface of this ArcGISScene with a new surface.The base surface is the default surface on which layers are draped or from which relative layers are offset.
- Parameters:
baseSurface
- the base surface of this ArcGISScene- Throws:
java.lang.IllegalArgumentException
- if baseSurface is null- Since:
- 100.0.0 for JavaSE and 100.1.0 for Android
- See Also:
Surface
,getBaseSurface()
-
getBaseSurface
public Surface getBaseSurface()
Gets the base surface of this ArcGISScene with a new surface.The base surface is the default surface on which layers are draped or from which relative layers are offset.
- Returns:
- the scene's base surface with a new surface
- Since:
- 100.0.0 for JavaSE and 100.1.0 for Android
- See Also:
Surface
,setBaseSurface(Surface)
-
getSceneViewTilingScheme
public ArcGISScene.SceneViewTilingScheme getSceneViewTilingScheme()
Gets thegetSceneViewTilingScheme()
used to render tile based data. The default value isArcGISScene.SceneViewTilingScheme.WEB_MERCATOR
. The tiling scheme property is used by theSceneView
to determine how to render tiled data. If this property was not set in advance of loading the scene, it will be determined duringGeoModel.loadAsync()
. This will examine theSpatialReference
of the first tiled elevation source (seeArcGISTiledElevationSource
) or tiled layer in the basemap or operational layers (seeArcGISTiledLayer
) to choose eitherArcGISScene.SceneViewTilingScheme.GEOGRAPHIC
orArcGISScene.SceneViewTilingScheme.WEB_MERCATOR
values. TheSceneViewTilingScheme
must correspond to theSceneViewTilingScheme
for those layers to render correctly.- Returns:
- the tiling scheme to use for tiled layers
- Since:
- 100.2.1
-
addBasemapChangedListener
public void addBasemapChangedListener(ArcGISScene.BasemapChangedListener listener)
Adds a BasemapChangedListener to thisArcGISScene
that gets invoked when the Basemap has changed.Adding this listener on the UI thread will cause it to be invoked on the UI thread, otherwise it is not guaranteed on which thread the listener is invoked.
- Parameters:
listener
- a BasemapChangedListener that gets invoked when the Basemap has changed- Throws:
java.lang.IllegalArgumentException
- if the listener is null- Since:
- 100.0.0 for JavaSE and 100.1.0 for Android
-
removeBasemapChangedListener
public boolean removeBasemapChangedListener(ArcGISScene.BasemapChangedListener listener)
Removes a BasemapChangedListener from thisArcGISScene
.- Parameters:
listener
- the BasemapChangedListener to remove- Returns:
- true if the BasemapChangedListener has been removed, otherwise false
- Throws:
java.lang.IllegalArgumentException
- if the listener is null- Since:
- 100.0.0 for JavaSE and 100.1.0 for Android
-
-