Class 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 the BackgroundGrid 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).

    Since:
    100.0.0 for JavaSE and 100.1.0 for Android
    See Also:
    Layer, Basemap
    • 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 ArcGISScene
        baseSurface - the Surface to use as the base surface of this scene
        Throws:
        java.lang.IllegalArgumentException - if the basemap is null
        java.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. Use ArcGISScene.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 underlying PortalItem will be created and accessible through GeoModel.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 empty
        java.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
        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 supports GeoModel.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
        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)
      • addBasemapChangedListener

        public void addBasemapChangedListener​(ArcGISScene.BasemapChangedListener listener)
        Adds a BasemapChangedListener to this ArcGISScene 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 this ArcGISScene.
        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