Class ArcGISMapServiceSublayerInfo

java.lang.Object
com.esri.arcgisruntime.arcgisservices.ArcGISMapServiceSublayerInfo
All Implemented Interfaces:
JsonSerializable

public final class ArcGISMapServiceSublayerInfo extends Object implements JsonSerializable
The metadata of an ArcGIS map service sublayer.

ArcGISMapServiceSublayerInfo provides basic information about an individual map image sublayer (or map service sublayer), such as the description, geometry type, drawing information, fields, extent, capabilities, and layer type. You can obtain a collection of map image sublayers from ArcGISMapImageLayer.getSublayers() and obtain the ArcGISMapServiceSublayerInfo using ArcGISSublayer.getMapServiceSublayerInfo().

The getServiceType() specifies if the map image sublayer is a feature layer, table, raster layer, or group layer. If the sublayer type is GROUP_LAYER, it will have its own collection of sublayers that you can access using ArcGISSublayer.getSublayers(). If one of these sublayers is a group layer it will also contain a collection of sublayers, and so on.

Certain properties of a sublayer can be changed programmatically by calling methods on the parent ArcGISMapImageSublayer class, or the root ArcGISMapImageLayer; for example hasDefaultVisibility() indicates the initial, default visibility, which can then be changed at runtime using ArcGISMapImageLayer.setVisible(boolean) or ArcGISMapImageSublayer.setVisible(boolean), depending on the value of LayerContent.canChangeVisibility().

Since:
100.1.0
See Also:
  • Method Details

    • fromJson

      public static ArcGISMapServiceSublayerInfo fromJson(String json)
      Creates an ArcGISMapServiceSublayerInfo instance from a JSON string.
      Parameters:
      json - a JSON string that represents an ArcGISMapServiceSublayerInfo
      Returns:
      an ArcGISMapServiceSublayerInfo instance
      Throws:
      IllegalArgumentException - if json is null or empty
      Since:
      100.1.0
    • toJson

      public String toJson()
      Serializes an ArcGISMapServiceSublayerInfo to a JSON string.
      Specified by:
      toJson in interface JsonSerializable
      Returns:
      a JSON string
      Since:
      100.1.0
    • getUnknownJson

      public Map<String,Object> getUnknownJson()
      Description copied from interface: JsonSerializable
      Gets unknown data from the source JSON.

      Unknown JSON is a Map of values not defined in the ArcGIS specification used to create this object but found in the source JSON. If the object is written back to JSON, any unknown JSON data is not persisted. The ArcGIS specification may be for a web map, web scene, REST API, and so on.

      Specified by:
      getUnknownJson in interface JsonSerializable
      Returns:
      an unmodifiable Map containing unknown data from the source JSON
    • getUnsupportedJson

      public Map<String,Object> getUnsupportedJson()
      Description copied from interface: JsonSerializable
      Gets unsupported data from the source JSON.

      Unsupported JSON is a Map of values defined in the ArcGIS specification used to create this object but not currently used in this API. If the object is written back to JSON, any unsupported JSON data is persisted. The ArcGIS specification may be from a web map, web scene, REST API, and so on.

      Specified by:
      getUnsupportedJson in interface JsonSerializable
      Returns:
      an unmodifiable Map containing unsupported data from the source JSON
    • getAttribution

      public String getAttribution()
      Gets the attribution text of the sublayer.
      Returns:
      the attribution text
      Since:
      100.1.0
    • getCapabilities

      public MapServiceCapabilities getCapabilities()
      Gets the capabilities supported by the sublayer.
      Returns:
      the capabilities
      Since:
      100.1.0
    • getDefinitionExpression

      public String getDefinitionExpression()
      Gets the definition expression for the sublayer by which data in the layer is filtered.

      The definition expression string uses the SQL-92 where clause syntax. Be sure to escape special characters in the expression string as required for your platform. The DATE keyword expects the date format yyyy-mm-dd and the TIMESTAMP keyword expects the time stamp format yyyy-mm-dd hh:mm:ss. See the ArcGIS Blog article Querying Feature Services Date-Time Queries.

      Returns:
      the definition expression
      Since:
      100.1.0
    • getDescription

      public String getDescription()
      Gets the description of the sublayer.
      Returns:
      the description
      Since:
      100.1.0
    • getDisplayFieldName

      public String getDisplayFieldName()
      Gets the name of the display field for the sublayer.
      Returns:
      the display field name
      Since:
      100.1.0
    • getDrawingInfo

      public DrawingInfo getDrawingInfo()
      Gets the drawing information for the sublayer.
      Returns:
      the drawing information
      Since:
      100.1.0
    • getEffectiveMaxScale

      public double getEffectiveMaxScale()
      Gets the maximum scale at which the sublayer is visible, taking into account the visible scale range of this sublayer's ancestors. If the map is zoomed in beyond this scale (the MapView.getMapScale() is smaller than this number), the sublayer will not be visible.
      Returns:
      the effective maximum scale, or Double.NaN if this is not specified
      Since:
      100.1.0
    • getEffectiveMinScale

      public double getEffectiveMinScale()
      Gets the minimum scale at which the sublayer is visible, taking into account the visible scale range of this sublayer's ancestors. If the map is zoomed out beyond this scale (the MapView.getMapScale() is larger than this number) this sublayer will not be visible.
      Returns:
      the effective minimum scale, or Double.NaN if this is not specified
      Since:
      100.1.0
    • getExtent

      public Envelope getExtent()
      Gets the geographic extent that the sublayer covers.
      Returns:
      the extent
      Since:
      100.1.0
    • getFeatureTypes

      public List<FeatureType> getFeatureTypes()
      Gets an unmodifiable list of FeatureType objects representing feature subtypes in the sublayer. For example, a roads layer may contain 2 feature subtypes: highways and streets.
      Returns:
      an unmodifiable list of the feature subtypes
      Since:
      100.1.0
    • getField

      public Field getField(String fieldNameOrAlias)
      Gets the definition of the field with a given name or alias.
      Parameters:
      fieldNameOrAlias - the field name or alias
      Returns:
      the field definition
      Throws:
      IllegalArgumentException - if fieldNameOrAlias is null or empty
      Since:
      100.1.0
    • getFields

      public List<Field> getFields()
      Gets an unmodifiable list of Field objects representing the fields in the sublayer.
      Returns:
      an unmodifiable list of the fields
      Since:
      100.1.0
    • getGeometryType

      public GeometryType getGeometryType()
      Gets the type of geometry contained by features in the sublayer.
      Returns:
      the geometry type
      Since:
      100.1.0
    • getMaxRecordCount

      public long getMaxRecordCount()
      Gets the maximum record count set on the sublayer. This represents the maximum number of records that can be returned from a query.
      Returns:
      the maximum record count, or -1 if this is not specified
      Since:
      100.1.0
    • getMaxScale

      public double getMaxScale()
      Gets the maximum scale at which the sublayer is visible. If the map is zoomed in beyond this scale, the sublayer will not be visible.
      Returns:
      the maximum scale
      Since:
      100.1.0
      See Also:
    • getMinScale

      public double getMinScale()
      Gets the minimum scale at which the sublayer is visible. If the map is zoomed out beyond this scale, the sublayer will not be visible.
      Returns:
      the minimum scale
      Since:
      100.1.0
      See Also:
    • getOwnershipBasedAccessControl

      public OwnershipBasedAccessControlInfo getOwnershipBasedAccessControl()
      Gets the information about ownership-based access control governing who can edit, delete, and query features.
      Returns:
      the ownership based access control information, or null if not enabled on the service
      Since:
      100.1.0
    • getParentLayerInfo

      public IdInfo getParentLayerInfo()
      Gets information that identifies the sublayer's parent layer.
      Returns:
      an IdInfo that identifies the parent layer, or null if there is no parent layer
      Since:
      100.1.0
    • getServiceLayerId

      public long getServiceLayerId()
      Gets the service layer ID of the sublayer.
      Returns:
      the service layer ID
      Since:
      100.1.0
    • getServiceLayerName

      public String getServiceLayerName()
      Gets the service layer name of the sublayer.
      Returns:
      the service layer name
      Since:
      100.1.0
    • getServiceType

      Gets the type of sublayer in the ArcGIS map service.
      Returns:
      the service type
      Since:
      100.1.0
      See Also:
    • getSublayerInfos

      public List<IdInfo> getSublayerInfos()
      Gets information that identifies the sublayers of this sublayer.
      Returns:
      an unmodifiable list of IdInfo objects for the sublayers of this sublayer
      Since:
      100.1.0
    • getRelationshipInfos

      public List<RelationshipInfo> getRelationshipInfos()
      Gets an unmodifiable collection of RelationshipInfo objects that describe this layer/table's relationship with another layer or table in the service.
      Returns:
      an unmodifiable list of the relationship infos
      Since:
      100.1.0
    • getTimeInfo

      public LayerTimeInfo getTimeInfo()
      Gets the time information for the sublayer. Only applicable if the sublayer is time aware.
      Returns:
      the time information, or null if the sublayer is not time aware
      Since:
      100.1.0
    • getTypeIdFieldName

      public String getTypeIdFieldName()
      Gets the name of the field containing the Type ID.
      Returns:
      the type ID field name
      Since:
      100.1.0
    • getUrl

      public String getUrl()
      Gets the URL of the sublayer.
      Returns:
      the URL
      Since:
      100.1.0
    • getVersion

      public String getVersion()
      Gets the version of the sublayer.
      Returns:
      the version
      Since:
      100.1.0
      See Also:
    • canModifyLayer

      public boolean canModifyLayer()
      Indicates whether the sublayer supports modifying its renderer and/or its data source.
      Returns:
      true if the sublayer can be modified, false otherwise
      Since:
      100.1.0
      See Also:
    • canScaleSymbols

      public boolean canScaleSymbols()
      Returns whether the text and symbols on the sublayer will change as the map scale varies.
      Returns:
      true if the text and symbols will change as the map scale varies, false otherwise
      Since:
      100.1.0
    • hasAttachments

      public boolean hasAttachments()
      Indicates whether the features in the sublayer can have attachments.
      Returns:
      true if the features can have attachments, false otherwise
      Since:
      100.1.0
      See Also:
    • hasDefaultVisibility

      public boolean hasDefaultVisibility()
      Indicates whether the sublayer is visible by default.
      Returns:
      true if the sublayer is visible by default, false otherwise
      Since:
      100.1.0
      See Also:
    • hasLabels

      public boolean hasLabels()
      Indicates whether the sublayer has labels defined on it.
      Returns:
      true if the sublayer has labels, false otherwise
      Since:
      100.1.0
    • hasM

      public boolean hasM()
      Indicates whether the sublayer geometry contains m-values.
      Returns:
      true if the geometry contains m-values, false otherwise
      Since:
      100.1.0
      See Also:
    • hasZ

      public boolean hasZ()
      Indicates whether the sublayer geometry contains z-values.
      Returns:
      true if the geometry contains z-values, false otherwise
      Since:
      100.1.0
      See Also:
    • isDataVersioned

      public boolean isDataVersioned()
      Indicates whether data in the sublayer is versioned.
      Returns:
      true if the data is versioned, false otherwise
      Since:
      100.1.0
      See Also:
    • isSupportsAdvancedQueries

      public boolean isSupportsAdvancedQueries()
      Indicates whether the sublayer supports advanced query operations (such as ordering results, or returning distinct results).
      Returns:
      true if the sublayer supports advanced queries, false otherwise
      Since:
      100.1.0
    • isSupportsStatistics

      public boolean isSupportsStatistics()
      Indicates whether the sublayer supports statistical functions in query operations.
      Returns:
      true if the sublayer supports statistics, false otherwise
      Since:
      100.1.0
    • isUseStandardizedQueries

      public boolean isUseStandardizedQueries()
      Indicates whether the sublayer requires the use of standardized queries.
      Returns:
      true if standardized queries are required, false otherwise
      Since:
      100.1.0
    • getSubtypeField

      public String getSubtypeField()
      Gets the name of the sublayer's subtype field.
      Returns:
      the name of the sublayer's subtype field or an empty string if the feature subtype is not defined
      Since:
      100.3.0
    • getDefaultSubtypeCode

      public Object getDefaultSubtypeCode()
      Gets the sublayer's default subtype code.

      Subtypes are implemented by coded values, which are integers. Those integer values each represent a feature in the subtype. For example, the following codes in a subtype named RoadClass could represent valid classes in a feature class for streets:

      • 0 - Local Streets
      • 1 - Secondary Streets
      • 2 - Main Streets
      If the Main Streets feature subtype is defined as the default, the Integer 2 will be returned as the default code.
      Returns:
      the sublayer's default subtype code or null if no default subtype feature is defined
      Since:
      100.3.0
    • getFeatureSubtypes

      public List<FeatureSubtype> getFeatureSubtypes()
      Gets an unmodifiable list of FeatureSubtype for this sublayer.
      Returns:
      an unmodifiable list of FeatureSubtype for this sublayer
      Since:
      100.3.0