- All Implemented Interfaces:
TimeAware,RemoteResource,LayerContent,Loadable
Web Map Service (WMS) is an Open Geospatial Consortium (OGC) standard for delivering map images from an online service. {code WMSLayer} displays data from a web service that provides maps in the form of server-rendered images. The service may be hosted in ArcGIS Enterprise or in a third party server. This API supports WMS versions 1.1.0, 1.1.1, and 1.3.0.
Functional characteristics
A WMS service can contain multiple layers in a hierarchy. A WMS layer can be constructed directly with a URL to a
service and the uniquely identifying name of the desired layer. Alternatively, a WmsService can be used to
programmatically explore the available layers and allow the user to choose layers at run time.
The maps provided by a WMS service use predefined symbology defined by the server. As a result, it is not possible to apply custom renderers or to visualize feature selection. WMS layers can have multiple style options. Your app can choose from the available styles.
Some layers can be marked as opaque, which means that they cover most of the map area and are good candidates for use as a basemap.
WMS layers support identify and time. They do not support selection or query. Note that due to the nature of WMS, it is not possible to retrieve feature geometry from WMS identify results. WMS layers support custom parameters, which can be specified for the service or an individual layer.
Performance characteristics
WMS servers render map images on demand, which can require more server resources than a similar tiled service. WMS requires a service connection at all times.
- Since:
- 100.2.0
- See Also:
-
Property Summary
Properties inherited from class com.esri.arcgisruntime.layers.Layer
loadError, loadStatus -
Constructor Summary
ConstructorsConstructorDescriptionWmsLayer(PortalItem portalItem) Creates a WMS layer from a portal item.WmsLayer(Iterable<WmsLayerInfo> layerInfos) Creates aWmsLayerfrom the specifiedWmsLayerInfoobjects.Creates a WmsLayer with the specified URL and layer names. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a listener that will fire when there is a change to the full time extent.copy()Creates a deep copy of this WmsLayer instance.Gets theCredentialthat is set on the network-enabled resource.Gets the dictionary of custom parameters to be sent with WMS requests issued by this layer.Returns the full time extent of the object.Gets a list of WmsLayerInfos for the layers included in this WmsLayer.Gets a collection of the names of the visible WMS layers.The preferred image format of this WmsLayer.longGets the refresh interval in milliseconds.Gets theRequestConfigurationused to modify the parameters of network requests made by thisRemoteResource.Gets the collection of the sublayers in this WMS layer.Returns the suggested time slider step size for this time aware object.Returns the time offset applied to this object.getUri()The WMS service endpoint URL of this WmsLayer.The version of the WMS specification used by this WmsLayer.booleanReturns whether or not the object must use the time extent defined on the owning GeoView to filter its data.booleanReturns whether or not the object supports filtering its contents by time values with the extent set on the owning GeoView.booleanRemoves a full time extent changed listener.voidsetCredential(Credential credential) Sets aCredentialto be used by the network-enabled resource in the event of an authentication challenge.voidsetIsTimeFilteringEnabled(boolean enabled) Enables or disables whether the object must use the time extent defined on the owning GeoView to filter its data.voidsetPreferredImageFormat(ArcGISMapImageLayer.ImageFormat imageFormat) Sets the preferred image format.voidsetRefreshInterval(long refreshIntervalMilliseconds) Sets the refresh interval in milliseconds.voidsetRequestConfiguration(RequestConfiguration requestConfiguration) Sets theRequestConfigurationused to modify the parameters of network requests made by thisRemoteResource.voidsetTimeOffset(TimeValue timeOffset) Sets a time offset for this object.Methods inherited from class com.esri.arcgisruntime.layers.ImageAdjustmentLayer
getBrightness, getContrast, getGamma, setBrightness, setContrast, setGammaMethods inherited from class com.esri.arcgisruntime.layers.Layer
addDoneLoadingListener, addLoadStatusChangedListener, addVisibilityChangedListener, cancelLoad, canChangeVisibility, canShowInLegend, fetchLegendInfosAsync, getAttribution, getDescription, getFullExtent, getId, getItem, getLoadError, getLoadStatus, getMaxScale, getMinScale, getName, getOpacity, getSpatialReference, getSubLayerContents, isIdentifyEnabled, isVisible, isVisibleAtScale, loadAsync, loadErrorProperty, loadStatusProperty, removeDoneLoadingListener, removeLoadStatusChangedListener, removeVisibilityChangedListener, retryLoadAsync, setCanShowInLegend, setDescription, setId, setMaxScale, setMinScale, setName, setOpacity, setVisible
-
Constructor Details
-
WmsLayer
Creates a WMS layer from a portal item.- Parameters:
portalItem- a portal item of typePortalItem.Type.WMS.- Throws:
NullPointerException- if portalItem is null- Since:
- 200.1.0
- See Also:
-
WmsLayer
Creates a WmsLayer with the specified URL and layer names.To specify a preferred WMS version, set the 'VERSION' parameter in the 'GetCapabilities' URL for the service.
- Parameters:
url- the URL of a WMS servicelayerNames- the names of layers of the service to be included in the WmsLayer- Throws:
IllegalArgumentException- if url or layerNames is null or empty- Since:
- 100.2.0
-
WmsLayer
Creates aWmsLayerfrom the specifiedWmsLayerInfoobjects.- Parameters:
layerInfos- a collection ofWmsLayerInfoobjects- Throws:
IllegalArgumentException- if layerInfos is null or empty- Since:
- 100.2.0
-
-
Method Details
-
setCredential
Description copied from interface:RemoteResourceSets aCredentialto be used by the network-enabled resource in the event of an authentication challenge. The default credential is null.Only applicable if the resource is secured.
- Specified by:
setCredentialin interfaceRemoteResource- Parameters:
credential- the Credential to be used for authentication
-
getCredential
Description copied from interface:RemoteResourceGets theCredentialthat is set on the network-enabled resource.Only applicable if the resource is secured.
- Specified by:
getCredentialin interfaceRemoteResource- Returns:
- the Credential, or null if there is none
-
setRequestConfiguration
Description copied from interface:RemoteResourceSets theRequestConfigurationused to modify the parameters of network requests made by thisRemoteResource. If not set, the globalRequestConfigurationwill be used (seeRequestConfiguration.getGlobalRequestConfiguration()).- Specified by:
setRequestConfigurationin interfaceRemoteResource- Parameters:
requestConfiguration- the RequestConfiguration used to modify network requests
-
getRequestConfiguration
Description copied from interface:RemoteResourceGets theRequestConfigurationused to modify the parameters of network requests made by thisRemoteResource.- Specified by:
getRequestConfigurationin interfaceRemoteResource- Returns:
- the
RequestConfigurationused to modify network requests
-
getUri
The WMS service endpoint URL of this WmsLayer.- Specified by:
getUriin interfaceRemoteResource- Returns:
- the URL of the WMS service
- Since:
- 100.2.0
-
getCustomParameters
Gets the dictionary of custom parameters to be sent with WMS requests issued by this layer.These parameters are appended to GetMap and GetFeatureInfo requests. If a parameter with the same name is defined in
WmsService.getCustomParameters(), then layer-specific values take precedence over service-wide values.- Returns:
- the dictionary of custom parameters to be sent with WMS requests issued by this layer
- Since:
- 100.3.0
-
getLayerNames
Gets a collection of the names of the visible WMS layers.- Returns:
- an unmodifiable list of the names of the visible WMS layers
- Since:
- 100.2.0
-
getLayerInfos
Gets a list of WmsLayerInfos for the layers included in this WmsLayer.- Returns:
- an unmodifiable list of WmsLayerInfos; this will be empty if the WmsLayer was created using the
WmsLayer(String, Iterable)constructor and has not been loaded yet - Since:
- 100.2.0
-
setPreferredImageFormat
Sets the preferred image format.- Parameters:
imageFormat- the preferred image format- Throws:
IllegalArgumentException- if imageFormat is null- Since:
- 100.2.0
-
getPreferredImageFormat
The preferred image format of this WmsLayer.If a preferred format is not specified prior to loading, then
ArcGISMapImageLayer.ImageFormat.PNGis used.- Returns:
- the preferred image format
- Since:
- 100.2.0
-
getSublayers
Gets the collection of the sublayers in this WMS layer.This is a flat, ordered list of named sublayers.
- Returns:
- the unmodifiable collection of the sublayers in this WMS layer
- Since:
- 100.2.0
-
copy
Creates a deep copy of this WmsLayer instance.- Returns:
- a deep copy of this WmsLayer instance, which means that copies of all fields of this layer are made including its loading state
- Since:
- 100.2.0
-
getRefreshInterval
public long getRefreshInterval()Gets the refresh interval in milliseconds. The refresh interval is the time between automatic data requests being sent to the server. A value of zero means the layer is never refreshed. The default value is zero.- Returns:
- the refresh interval in milliseconds
- Since:
- 100.2.1
-
setRefreshInterval
public void setRefreshInterval(long refreshIntervalMilliseconds) Sets the refresh interval in milliseconds. The refresh interval is the time between automatic data requests being sent to the server. A value of zero means the layer is never refreshed. The default value is zero.- Parameters:
refreshIntervalMilliseconds- the refresh interval in milliseconds- Throws:
IllegalArgumentException- if refreshIntervalMilliseconds is less than zero- Since:
- 100.2.1
-
getVersion
The version of the WMS specification used by this WmsLayer.This API supports the following WMS versions: 1.3.0, 1.1.1, and 1.1.0. By default this value is the latest supported WMS version.
- Returns:
- the WMS version
- Since:
- 100.2.1
-
getFullTimeExtent
Description copied from interface:TimeAwareReturns the full time extent of the object. Will be null if the object is not time aware.- Specified by:
getFullTimeExtentin interfaceTimeAware- Returns:
- the time extent, or null if the object is not time aware
-
getTimeInterval
Description copied from interface:TimeAwareReturns the suggested time slider step size for this time aware object. Can be null if no time interval is suggested for this time aware object.- Specified by:
getTimeIntervalin interfaceTimeAware- Returns:
- the time interval, or null if there is no time interval
-
getTimeOffset
Description copied from interface:TimeAwareReturns the time offset applied to this object. The offset is subtracted from the time extent set on the owningGeoView. This allows for data from different periods of time to be compared.- Specified by:
getTimeOffsetin interfaceTimeAware- Returns:
- the time offset, or null if no offset has been set
-
isTimeFilteringEnabled
public boolean isTimeFilteringEnabled()Description copied from interface:TimeAwareReturns whether or not the object must use the time extent defined on the owning GeoView to filter its data.- Specified by:
isTimeFilteringEnabledin interfaceTimeAware- Returns:
- true if time filtering is enabled; otherwise false
-
setIsTimeFilteringEnabled
public void setIsTimeFilteringEnabled(boolean enabled) Description copied from interface:TimeAwareEnables or disables whether the object must use the time extent defined on the owning GeoView to filter its data.- Specified by:
setIsTimeFilteringEnabledin interfaceTimeAware- Parameters:
enabled- true to enable time filtering; otherwise false
-
isTimeFilteringSupported
public boolean isTimeFilteringSupported()Description copied from interface:TimeAwareReturns whether or not the object supports filtering its contents by time values with the extent set on the owning GeoView.- Specified by:
isTimeFilteringSupportedin interfaceTimeAware- Returns:
- true if time filtering is supported; otherwise false
-
setTimeOffset
Description copied from interface:TimeAwareSets a time offset for this object. The time offset is subtracted from the time extent set on the owningGeoView. This allows for data from different periods of time to be compared. Can be null if there is no time offset.- Specified by:
setTimeOffsetin interfaceTimeAware- Parameters:
timeOffset- the time offset, or null if there is no time offset
-
addFullTimeExtentChangedListener
Description copied from interface:TimeAwareAdds a listener that will fire when there is a change to the full time extent.- Specified by:
addFullTimeExtentChangedListenerin interfaceTimeAware- Parameters:
listener- the listener to add
-
removeFullTimeExtentChangedListener
Description copied from interface:TimeAwareRemoves a full time extent changed listener.- Specified by:
removeFullTimeExtentChangedListenerin interfaceTimeAware- Parameters:
listener- the listener to remove- Returns:
- true if the listener was removed, otherwise false
-