Class ArcGISSceneLayer

  • All Implemented Interfaces:
    RemoteResource, LayerContent, Loadable

    public final class ArcGISSceneLayer
    extends Layer
    implements RemoteResource
    Defines an ArcGISSceneLayer, which is a Layer that displays 3D features published on a scene service.

    Features loaded from an ArcGISSceneLayer are rendered according to their distance from the Camera; thus, features closer to the Camera are more detailed.

    An ArcGISSceneLayer is referenced by a URL from a scene service. Some 3D layers can be found at http://scene.arcgis.com/arcgis/rest/services/Hosted.

    Example of how to add an ArcGISSceneLayer to a SceneView:

     ArcGISScene scene = new ArcGISScene(Basemap.createImagery());
    
     //creating a layer using a URL from a scene service
     ArcGISSceneLayer sceneLayer = new ArcGISSceneLayer(
       "http://scene.arcgis.com/arcgis/rest/services/Hosted/Buildings_San_Francisco/SceneServer/layers/0");
     scene.getOperationalLayers().add(sceneLayer);
    
     SceneView view = new SceneView();
     view.setArcGISScene(scene);
     
    Since:
    100.0.0 for JavaSE and 100.1.0 for Android
    See Also:
    ArcGISScene, SceneView
    • Constructor Detail

      • ArcGISSceneLayer

        public ArcGISSceneLayer​(String dataSourceUri)
        Creates a Layer from an ArcGIS scene service at the given URL or absolute file path to local scene package file.

        Scene services allow for sharing of 3D features from a scene server.

        To use a credential, call setCredential(Credential) after this constructor and before loading or using this layer.

        Parameters:
        dataSourceUri - the url of the scene service, or the path to local scene package (.slpk)
        Throws:
        IllegalArgumentException - if dataSourceUri is null or empty
        Since:
        100.0.0 for JavaSE and 100.1.0 for Android
      • ArcGISSceneLayer

        public ArcGISSceneLayer​(PortalItem portalItem)
        Creates an ArcGISSceneLayer instance based on a PortalItem.

        If the portal item is not in LoadStatus.LOADED state it will be loaded automatically when this ArcGISSceneLayer instance is loaded.

        If the loaded portalItem is not of type PortalItem.Type.SCENE_SERVICE the layer will fail to load.

        Parameters:
        portalItem - PortalItem from which this ArcGISSceneLayer will be created
        Throws:
        IllegalArgumentException - if the portalItem is null
        Since:
        100.0.0 for JavaSE and 100.1.0 for Android
    • Method Detail

      • selectFeature

        public void selectFeature​(Feature feature)
        Selects the given feature and adds it to the current list of selected features.
        Parameters:
        feature - the feature to be added to selection
        Throws:
        IllegalArgumentException - if feature is null
        Since:
        100.3.0
      • selectFeatures

        public void selectFeatures​(Iterable<Feature> features)
        Selects the features in the list and adds them to the current list of selected features.
        Parameters:
        features - the features to be added to selection
        Throws:
        IllegalArgumentException - if features is null
        Since:
        100.3.0
      • getSelectedFeaturesAsync

        public ListenableFuture<FeatureQueryResult> getSelectedFeaturesAsync()
        Gets all the selected features.
        Returns:
        a future that represents the selected features
        Since:
        100.3.0
      • unselectFeature

        public void unselectFeature​(Feature feature)
        Removes a feature from selection.
        Parameters:
        feature - the feature to be unselected
        Throws:
        IllegalArgumentException - if feature is null
        Since:
        100.3.0
      • unselectFeatures

        public void unselectFeatures​(Iterable<Feature> features)
        Removes multiple features from selection.
        Parameters:
        features - the features to be unselected
        Throws:
        IllegalArgumentException - if features is null
        Since:
        100.3.0
      • clearSelection

        public void clearSelection()
        Clears all the selected features.
        Since:
        100.3.0
      • copy

        public ArcGISSceneLayer copy()
        Creates a deep copy of this ArcGISSceneLayer instance.
        Returns:
        a deep copy of this ArcGISSceneLayer instance, which means that copies of all fields of this layer are made including its loading state
        Since:
        100.1.0
      • getFeatureTable

        public FeatureTable getFeatureTable()
        Gets the feature table associated with this layer.
        Returns:
        the feature table, or null if there is no associated feature table
        Since:
        100.3.0
      • setSurfacePlacement

        public void setSurfacePlacement​(LayerSceneProperties.SurfacePlacement surfacePlacement)
        Sets the surface placement for the ArcGISSceneLayer.
        Parameters:
        surfacePlacement - the surface placement to apply to the scene layer
        Throws:
        IllegalArgumentException - if surfacePlacement is null
        Since:
        100.6.0
      • getSurfacePlacement

        public LayerSceneProperties.SurfacePlacement getSurfacePlacement()
        Gets the surface placement for the ArcGISSceneLayer.
        Returns:
        the surface placement of the scene layer
        Since:
        100.6.0
      • setAltitudeOffset

        public void setAltitudeOffset​(double altitudeOffset)
        Sets the layer altitude offset.
        Parameters:
        altitudeOffset - the layer altitude offset
        Since:
        100.6.0
      • getAltitudeOffset

        public double getAltitudeOffset()
        Gets the layer altitude offset.
        Returns:
        the layer altitude offset
        Since:
        100.6.0
      • getCredential

        public Credential getCredential()
        Gets the credential used to authenticate the user with the scene service.
        Specified by:
        getCredential in interface RemoteResource
        Returns:
        the credential used for authentication
        Since:
        100.0.0 for JavaSE and 100.1.0 for Android
      • setCredential

        public void setCredential​(Credential credential)
        Sets the credential used to authenticate the user with the scene service.
        Specified by:
        setCredential in interface RemoteResource
        Parameters:
        credential - the credential used for authentication
        Since:
        100.0.0 for JavaSE and 100.1.0 for Android
      • setRequestConfiguration

        public void setRequestConfiguration​(RequestConfiguration requestConfiguration)
        Sets the configuration parameters used for sending a network request using this Layer object. The global RequestConfiguration is used if no RequestConfiguration is set which contains the default values from the getter/setter methods.
        Specified by:
        setRequestConfiguration in interface RemoteResource
        Parameters:
        requestConfiguration - contains the parameters to use
        Since:
        100.0.0 for JavaSE and 100.1.0 for Android
        See Also:
        RequestConfiguration
      • getUri

        public String getUri()
        Description copied from interface: RemoteResource
        Gets the URI of this RemoteResource. Typically this is the URI used to instantiate the object.
        Specified by:
        getUri in interface RemoteResource
        Returns:
        the URI of this RemoteResource
      • getName

        public String getName()
        Description copied from class: Layer
        Gets the name of this layer.
        Specified by:
        getName in interface LayerContent
        Overrides:
        getName in class Layer
        Returns:
        the name of this layer