Class ArcGISMapImageSublayer
- java.lang.Object
- 
- com.esri.arcgisruntime.layers.ArcGISSublayer
- 
- com.esri.arcgisruntime.layers.ArcGISMapImageSublayer
 
 
- 
- All Implemented Interfaces:
- RemoteResource,- LayerContent,- Loadable,- PopupSource
 
 public final class ArcGISMapImageSublayer extends ArcGISSublayer An ArcGIS map image sublayer.ArcGISMapImageLayerdisplays maps from an ArcGIS map server. Each layer in the underlying map service is represented by anArcGISSublayer. You can control the visibility and symbols of sublayers and filter data with layer definition expressions.You can get a list of ArcGISMapImageSublayerobjects from anArcGISMapImageLayerby usingArcGISMapImageLayer.getSublayers(). You can also create a new sublayer fromArcGISMapImageSublayer(int).The code below shows how to get ArcGISMapImageSublayerobjects from anArcGISMapImageLayerand how to change a property of a sublayer after loading.String mapServiceUSA = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer"; final ArcGISMapImageLayer mapImageLayer = new ArcGISMapImageLayer(mapServiceUSA); mapImageLayer.addDoneLoadingListener(() -> { if (mapImageLayer.getLoadStatus() == LoadStatus.LOADED) { ListenableList<ArcGISSublayer> sublayerList = mapImageLayer.getSublayers(); ArcGISMapImageSublayer mapImageSublayer = (ArcGISMapImageSublayer) sublayerList.get(0); mapImageSublayer.setName("New Name"); } }); mapImageLayer.loadAsync();Setting properties on a ArcGISMapImageSublayer before the ArcGISMapImageLayer is loaded will not overwrite those properties.- Since:
- 100.0.0
- See Also:
- ArcGISSublayer,- ArcGISSublayer.getSublayers(),- ArcGISMapImageSublayer(int)
 
- 
- 
Constructor SummaryConstructors Constructor Description ArcGISMapImageSublayer(int id)Creates a new ArcGISMapImageSublayer with the given ID.ArcGISMapImageSublayer(int id, SublayerSource sublayerSource)Creates a new ArcGISMapImageSublayer with the given ID and sublayer source.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ArcGISMapImageSublayercopy()Creates a deep copy of this ArcGISMapImageSublayer instance.java.util.List<LabelDefinition>getLabelDefinitions()Gets a modifiable list of label definitions of this sublayer.SublayerSourcegetSource()Returns the sublayer's source if available otherwise null.ServiceFeatureTablegetTable()Gets the sublayer's feature table.voidsetDefinitionExpression(java.lang.String definitionExpression)Sets the definition expression for this sublayer - can be null.voidsetLabelsEnabled(boolean labelsEnabled)Sets whether or not labels are enabled for this sublayervoidsetMaxScale(double maxScale)Sets the maximum scale for this sublayer.voidsetMinScale(double minScale)Sets the minimum scale for this sublayer.voidsetName(java.lang.String name)Sets the name property for this sublayer.voidsetOpacity(float opacity)Sets the opacity for this sublayer.voidsetRenderer(Renderer renderer)Sets the renderer for this sublayer.voidsetScaleSymbols(boolean scaleSymbols)Sets whether the text and symbols on this sublayer will change as the map scale varies.- 
Methods inherited from class com.esri.arcgisruntime.layers.ArcGISSublayeraddDoneLoadingListener, addLoadStatusChangedListener, cancelLoad, canChangeVisibility, canScaleSymbols, canShowInLegend, copyTo, fetchLegendInfosAsync, getCredential, getDefinitionExpression, getId, getLoadError, getLoadStatus, getMapServiceSublayerInfo, getMaxScale, getMinScale, getName, getOpacity, getPopupDefinition, getRenderer, getRequestConfiguration, getSubLayerContents, getSublayers, getUri, isLabelsEnabled, isPopupEnabled, isVisible, isVisibleAtScale, loadAsync, removeDoneLoadingListener, removeLoadStatusChangedListener, retryLoadAsync, setCanShowInLegend, setCredential, setPopupDefinition, setPopupEnabled, setRequestConfiguration, setVisible
 
- 
 
- 
- 
- 
Constructor Detail- 
ArcGISMapImageSublayerpublic ArcGISMapImageSublayer(int id) Creates a new ArcGISMapImageSublayer with the given ID. The ID should be zero or greater.- Parameters:
- id- the ID of the new sub layer, should be zero or greater
- Throws:
- java.lang.IllegalArgumentException- if id is less than zero
- Since:
- 100.0.0
 
 - 
ArcGISMapImageSublayerpublic ArcGISMapImageSublayer(int id, SublayerSource sublayerSource)Creates a new ArcGISMapImageSublayer with the given ID and sublayer source. The ID should be zero or greater and the sublayer source cannot be null. For sublayer sources other than rasters, aRenderermust be set usingsetRenderer(Renderer).- Parameters:
- id- the ID of the new sub layer, should be zero or greater
- sublayerSource- the source of the new sublayer
- Throws:
- java.lang.IllegalArgumentException- if id is less than zero
- java.lang.IllegalArgumentException- if sublayer source is null
- Since:
- 100.1.0
 
 
- 
 - 
Method Detail- 
setRendererpublic void setRenderer(Renderer renderer) Sets the renderer for this sublayer.- Overrides:
- setRendererin class- ArcGISSublayer
- Parameters:
- renderer- the renderer to set
- Throws:
- java.lang.IllegalArgumentException- if the renderer is null
- Since:
- 100.1.0
- See Also:
- ArcGISSublayer.getRenderer(),- ArcGISMapServiceSublayerInfo.canModifyLayer()
 
 - 
setOpacitypublic void setOpacity(float opacity) Sets the opacity for this sublayer.- Parameters:
- opacity- the opacity of this layer, which needs to be a value in the range of 0.0 - 1.0, 1.0 being fully opaque
- Throws:
- java.lang.IllegalArgumentException- if the opacity is out of range
- Since:
- 100.1.0
- See Also:
- ArcGISSublayer.getOpacity()
 
 - 
setScaleSymbolspublic void setScaleSymbols(boolean scaleSymbols) Sets whether the text and symbols on this sublayer will change as the map scale varies.- Parameters:
- scaleSymbols- true if the text and symbols should change as the map scale varies, false otherwise
- Since:
- 100.1.0
- See Also:
- ArcGISSublayer.canScaleSymbols()
 
 - 
setMaxScalepublic void setMaxScale(double maxScale) Sets the maximum scale for this sublayer.- Parameters:
- maxScale- the maximum scale
- Since:
- 100.1.0
- See Also:
- ArcGISSublayer.getMaxScale()
 
 - 
setMinScalepublic void setMinScale(double minScale) Sets the minimum scale for this sublayer.- Parameters:
- minScale- the minimum scale
- Since:
- 100.1.0
- See Also:
- ArcGISSublayer.getMinScale()
 
 - 
setLabelsEnabledpublic void setLabelsEnabled(boolean labelsEnabled) Sets whether or not labels are enabled for this sublayer- Parameters:
- labelsEnabled- true to enable labels, false otherwise
- Since:
- 100.1.0
- See Also:
- ArcGISSublayer.isLabelsEnabled()
 
 - 
setDefinitionExpressionpublic void setDefinitionExpression(java.lang.String definitionExpression) Sets the definition expression for this sublayer - can be null. The definition expression is an SQL statement where clause to filter out the features to be displayed.- Parameters:
- definitionExpression- the definition expression
- Since:
- 100.1.0
- See Also:
- ArcGISSublayer.getDefinitionExpression()
 
 - 
getSourcepublic SublayerSource getSource() Returns the sublayer's source if available otherwise null.- Returns:
- the sublayer's source
- Since:
- 100.1.0
 
 - 
setNamepublic void setName(java.lang.String name) Sets the name property for this sublayer.- Parameters:
- name- the new name for this sublayer, can be null
- Since:
- 100.0.0
 
 - 
copypublic ArcGISMapImageSublayer copy() Creates a deep copy of this ArcGISMapImageSublayer instance.- Specified by:
- copyin class- ArcGISSublayer
- Returns:
- a deep copy of this ArcGISMapImageSublayer instance, which means that copies of all fields of this layer are made including its loading state
- Since:
- 100.1.0
 
 - 
getLabelDefinitionspublic java.util.List<LabelDefinition> getLabelDefinitions() Gets a modifiable list of label definitions of this sublayer.- Returns:
- a modifiable list of label definitions
- Since:
- 100.1.0
 
 - 
getTablepublic ServiceFeatureTable getTable() Gets the sublayer's feature table.This only applies to sublayers of type ArcGISMapServiceSublayerInfo.ServiceType.FEATURE_LAYERorArcGISMapServiceSublayerInfo.ServiceType.TABLE. This method returns null if the sublayer has not been loaded.- Returns:
- the sublayer's feature table, or null if none
- Since:
- 100.3.0
 
 
- 
 
-