public class

WebMapLayer

extends Object
java.lang.Object
   ↳ com.esri.core.portal.WebMapLayer

Class Overview

This class represents a layer within a WebMap.

Summary

Nested Classes
enum WebMapLayer.Mode The operational mode of an ArcGIS feature layer in a WebMap. 
enum WebMapLayer.Type The type of layer in a WebMap. 
Fields
public boolean mIsBaseLayer
Protected Constructors
WebMapLayer()
Constructs an empty WebMapLayer.
WebMapLayer(String title, String url)
Constructs a WebMapLayer with the specified title and the URL.
Public Methods
int[] getBandIds()
Returns an array of band IDs.
String getCapabilitiesOverride()
Gets the capabilities override.
String getColumnDelimiter()
Gets the column delimiter.
String getCopyright()
Gets the copyright text for this layer.
int[] getDisplayLevels()
Returns an array of display levels.
Envelope getExtent()
Gets the extent of this layer.
FeatureCollection getFeatureCollection()
This method returns a FeatureCollection if the features are persisted directly in the WebMap as map notes and the WebMapLayer is of type ERROR(/Type.FEATURE_COLLECTION).
String getFormat()
This method is deprecated. at 10.2.4 please use getImageFormat()
String getID()
Gets the string ID of this web map layer.
int getImageCompressionQuality()
Returns how much loss the image will be subjected to by the compression algorithm.
ImageServiceParameters.IMAGE_FORMAT getImageFormat()
Returns an image format.
ImageServiceParameters.RSP getImageInterpolation()
Gets the resampling process of extrapolating the pixel values while transforming the raster dataset when it undergoes warping or when it changes coordinate space.
ImageServiceParameters.NoDataInterpretation getImageNoDataInterpretation()
Gets the interpretation of the noData setting (see getImageNoDataPixelValue()).
String getImageNoDataPixelValue()
Gets the pixel value representing no information.
int[] getInvisibleLegendLayers()
Returns a list of ID numbers whose legend is not shown.
String getItemId()
Returns the item id of the data represented by this operational layer in the WebMap.
String getLatitudeFieldName()
Gets the latitude field name.
String getLayerDefinitionOverride()
Gets the 'layerDefinition' property for this layer (can be null), for example drawing info to override the default style of the layer.
ArrayList<String> getLayerDefinitions()
This method is deprecated. at 10.2.4, Please use getLayerDefinition().
List<WebMapSubLayer> getLayers()
Returns a list of WebMapSubLayer objects which represents the sub-layers of this layer.
String getLocationType()
Gets the location type.
String getLongitudeFieldName()
Gets the longitude field name.
String getMapUrl()
Gets the map URL string for a WMS service.
double getMaxScale()
Returns the maximum scale.
double getMinScale()
Returns the minimum scale.
WebMapLayer.Mode getMode()
Returns the mode that an ArcGIS Feature Layer is configured to work in, if the web map layer represents an ArcGIS Feature Layer.
MosaicRule getMosaicRule()
Returns a mosaic rule.
float getOpacity()
Returns the opacity for this layer specified in the WebMap.
String getPortalUrl()
Gets the 'portalUrl' property of the layer (can be null).
RasterFunction getRenderingRule()
Returns a rendering rule.
List<SpatialReference> getSpatialRefs()
Gets the spatial references.
TileInfo getTileInfo()
String getTitle()
Returns the title of this operational layer.
WebMapLayer.Type getType()
Returns the type of this Web Map layer.
String getUrl()
Returns the URL of a GIS Service layer.
int[] getVisibleFolders()
Gets the IDs of the visible folders.
int[] getVisibleLayers()
Returns the visible layers of this layer by ID, if the layer's URL (obtained through getUrl()) represents a Dynamic Map Service Layer.
WebMapPopupInfo getWebMapPopupInfo()
Gets the WebMapPopupInfo object.
String getWmsVersion()
Gets the WMS version (if applicable).
List<String> getWmsVisibleLayers()
Returns a list of visible WMS layers.
String getWmtsLayerId()
Gets the ID of the WMTS layer referenced by this Web Map layer.
String getWmtsTemplateUrl()
Gets a url with replaceable tokens that can be used to access tiles in a WMTS service.
String getWmtsTileMatrixSetId()
Gets the ID of the tile matrix set used by the WMTS layer referenced by this Web Map layer.
boolean isDisablePopup()
Indicates whether the popups defined by the service item for a feature layer should be disabled.
boolean isFederated(String portalUrl)
Checks if this WebMapLayer is federated by the portal.
boolean isReference()
Tells if this layer is a reference layer.
boolean isShowLegend()
Indicates whether the webmap should show the features from this service in the legend.
boolean isVisible()
Returns the default visibility of this layer.
Protected Methods
static WebMapLayer fromJson(JsonParser parser)
Constructs and sets the internal state of this WebMapLayer from a response received from the server.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public boolean mIsBaseLayer

Protected Constructors

protected WebMapLayer ()

Constructs an empty WebMapLayer. Users will never explicitly create an instance of a WebMapLayer.

protected WebMapLayer (String title, String url)

Constructs a WebMapLayer with the specified title and the URL. This constructor is invoked when a Web Map does not contain any layers and the base layer is specified in the Item info.

Parameters
title String: the layer title
url String: the layer URL

Public Methods

public int[] getBandIds ()

Returns an array of band IDs. This property is applicable only when the URL obtained through getUrl() represents an Image Service Layer.

Returns
int[] an array of band IDs

public String getCapabilitiesOverride ()

Gets the capabilities override.

Returns
String the capabilities override

public String getColumnDelimiter ()

Gets the column delimiter.

Returns
String the column delimiter

public String getCopyright ()

Gets the copyright text for this layer.

Returns
String the copyright text

public int[] getDisplayLevels ()

Returns an array of display levels. This property is applicable only when the URL obtained through getUrl() represents a Tiled Map Service Layer.

Returns
int[] an array of display levels

public Envelope getExtent ()

Gets the extent of this layer.

Returns
Envelope the extent

public FeatureCollection getFeatureCollection ()

This method returns a FeatureCollection if the features are persisted directly in the WebMap as map notes and the WebMapLayer is of type ERROR(/Type.FEATURE_COLLECTION). Returns null if the feature collection is referenced as a webmap item on ArcGIS Online. In this case getItemId() returns an id for the webmap item.

Returns
FeatureCollection the feature collection

public String getFormat ()

This method is deprecated.
at 10.2.4 please use getImageFormat()

Gets the format.

Returns
String the image format

public String getID ()

Gets the string ID of this web map layer.

Returns
String the ID of this web map layer

public int getImageCompressionQuality ()

Returns how much loss the image will be subjected to by the compression algorithm. This property is applicable only when the URL obtained through getUrl() represents a ERROR(/ArcGISImageServiceLayer). Valid value ranges of compression quality are from 0 to 100. The compression quality works for the JPEG format, JPGPNG (if the result is a JPG), and TIFF with JPEG compression.

Returns
int an integer representing the image compression quality.

public ImageServiceParameters.IMAGE_FORMAT getImageFormat ()

Returns an image format. This property is applicable only when the URL obtained through getUrl() represents a ERROR(/ArcGISImageServiceLayer).

Returns
ImageServiceParameters.IMAGE_FORMAT a ImageServiceParameters.IMAGE_FORMAT object.

public ImageServiceParameters.RSP getImageInterpolation ()

Gets the resampling process of extrapolating the pixel values while transforming the raster dataset when it undergoes warping or when it changes coordinate space. This property is applicable only when the URL obtained through getUrl() represents a ERROR(/ArcGISImageServiceLayer).

Returns
ImageServiceParameters.RSP a resampling process value.

public ImageServiceParameters.NoDataInterpretation getImageNoDataInterpretation ()

Gets the interpretation of the noData setting (see getImageNoDataPixelValue()). This property is applicable only when the URL obtained through getUrl() represents a ERROR(/ArcGISImageServiceLayer).

Returns
ImageServiceParameters.NoDataInterpretation a NoDataInterpretation value.

public String getImageNoDataPixelValue ()

Gets the pixel value representing no information. This property is applicable only when the URL obtained through getUrl() represents a ERROR(/ArcGISImageServiceLayer).

Returns
String the pixel value representing no information.

public int[] getInvisibleLegendLayers ()

Returns a list of ID numbers whose legend is not shown.

Returns
int[] an array of IDs of layers whose legend is not shown

public String getItemId ()

Returns the item id of the data represented by this operational layer in the WebMap.

Returns
String the item id

public String getLatitudeFieldName ()

Gets the latitude field name.

Returns
String the latitude field name

public String getLayerDefinitionOverride ()

Gets the 'layerDefinition' property for this layer (can be null), for example drawing info to override the default style of the layer.

Returns
String the layer definition string

public ArrayList<String> getLayerDefinitions ()

This method is deprecated.
at 10.2.4, Please use getLayerDefinition().

Returns the layer definitions of a feature collection.

Returns
ArrayList<String> an ArrayList of layer definitions for a feature collection

public List<WebMapSubLayer> getLayers ()

Returns a list of WebMapSubLayer objects which represents the sub-layers of this layer. For example, if the layer is a tiled map service layer, a sub-layer may have a layer ID and optional popup information. If the layer is a feature collection, a sub-layer may have a layer ID, layer definition and feature set.

Returns
List<WebMapSubLayer> a list of sub-layers

public String getLocationType ()

Gets the location type.

Returns
String the location type

public String getLongitudeFieldName ()

Gets the longitude field name.

Returns
String the longitude field name

public String getMapUrl ()

Gets the map URL string for a WMS service.

Returns
String Map URL string

public double getMaxScale ()

Returns the maximum scale.

Returns
double the maximum scale

public double getMinScale ()

Returns the minimum scale.

Returns
double the minimum scale

public WebMapLayer.Mode getMode ()

Returns the mode that an ArcGIS Feature Layer is configured to work in, if the web map layer represents an ArcGIS Feature Layer.

Returns
WebMapLayer.Mode the WebMapLayer.Mode

public MosaicRule getMosaicRule ()

Returns a mosaic rule. This property is applicable only when the URL obtained through getUrl() represents a ERROR(/ArcGISImageServiceLayer).

Returns
MosaicRule a MosaicRule object

public float getOpacity ()

Returns the opacity for this layer specified in the WebMap.

Returns
float the opacity. 0 meaning fully transparent, 1 meaning opaque.

public String getPortalUrl ()

Gets the 'portalUrl' property of the layer (can be null).

Returns
String the portalUrl as a string

public RasterFunction getRenderingRule ()

Returns a rendering rule. This property is applicable only when the URL obtained through getUrl() represents a ERROR(/ArcGISImageServiceLayer).

Returns
RasterFunction a RasterFunction object

public List<SpatialReference> getSpatialRefs ()

Gets the spatial references.

Returns
List<SpatialReference> the spatial references

public TileInfo getTileInfo ()

Returns
TileInfo

public String getTitle ()

Returns the title of this operational layer.

Returns
String the title

public WebMapLayer.Type getType ()

Returns the type of this Web Map layer.

Returns
WebMapLayer.Type the WebMapLayer.Type

public String getUrl ()

Returns the URL of a GIS Service layer. It is the responsibility of the application to infer the type of service (Dynamic Map Service layer, Tiled Map Service layer, etc) the URL represents. If the Service is either BingMaps or OpenStreetMap then the URL string is the name of the layer.

Returns
String the URL string of a GIS Service layer

public int[] getVisibleFolders ()

Gets the IDs of the visible folders. Only applicable to the KML Layer type.

Returns
int[] array of IDs of visible folders

public int[] getVisibleLayers ()

Returns the visible layers of this layer by ID, if the layer's URL (obtained through getUrl()) represents a Dynamic Map Service Layer. The layer IDs returned are integers and come from the map service (not to be confused with web map layer IDs, defined in the web map JSON as Strings).

Returns
int[] an array of IDs of visible layers

public WebMapPopupInfo getWebMapPopupInfo ()

Gets the WebMapPopupInfo object. Only applicable to feature layer.

Returns
WebMapPopupInfo WebMapPopupInfo object, or null if popups disabled

public String getWmsVersion ()

Gets the WMS version (if applicable).

Returns
String the WMS version

public List<String> getWmsVisibleLayers ()

Returns a list of visible WMS layers. The getLayers() method returns all layers regardless of visibility. Use this method to get a list of the layers that are initially visible. If this returns null then all of the layers will be visible.

Returns
List<String> an array of visible WMS layers, or null if all layers visible

public String getWmtsLayerId ()

Gets the ID of the WMTS layer referenced by this Web Map layer.

Returns
String ID of the WMTS layer referenced by this Web Map layer

public String getWmtsTemplateUrl ()

Gets a url with replaceable tokens that can be used to access tiles in a WMTS service.

Returns
String url with replaceable tokens that can be used to access tiles in a WMTS service

public String getWmtsTileMatrixSetId ()

Gets the ID of the tile matrix set used by the WMTS layer referenced by this Web Map layer.

Returns
String ID of the tile matrix set used by the WMTS layer referenced by this Web Map layer

public boolean isDisablePopup ()

Indicates whether the popups defined by the service item for a feature layer should be disabled.

Returns
boolean true if client should ignore the popups defined by the service item

public boolean isFederated (String portalUrl)

Checks if this WebMapLayer is federated by the portal. This is done by checking the owning system URL from the WebMapLayer. If this URL is in the same domain as the portal URL, then it is considered federated by the portal.

Parameters
portalUrl String: URL of the portal to check against
Returns
boolean true if this is federated by the portal

public boolean isReference ()

Tells if this layer is a reference layer. This property is applicable only to base map layers within a WebMap.

Returns
boolean true if this layer is a reference layer, false otherwise

public boolean isShowLegend ()

Indicates whether the webmap should show the features from this service in the legend.

Returns
boolean true if legend should be shown

public boolean isVisible ()

Returns the default visibility of this layer.

Returns
boolean true if this layer is visible, false otherwise

Protected Methods

protected static WebMapLayer fromJson (JsonParser parser)

Constructs and sets the internal state of this WebMapLayer from a response received from the server.

Parameters
parser JsonParser: contains the JSON to parse
Returns
WebMapLayer an initialized WebMapLayer, or null if the JSON is invalid
Throws
PortalException if the action cannot be completed.