WMSSublayer

AMD: require(["esri/layers/support/WMSSublayer"], (WMSSublayer) => { /* code goes here */ });
ESM: import WMSSublayer from "@arcgis/core/layers/support/WMSSublayer";
Class: esri/layers/support/WMSSublayer
Inheritance: WMSSublayer Accessor
Since: ArcGIS API for JavaScript 4.4

Represents a sublayer in a WMSLayer.

Constructors

new WMSSublayer(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Show inherited properties Hide inherited properties
Name Type Summary Class
Stringmore details

The name of the class.

more detailsAccessor
Stringmore details

Description for the WMS sublayer.

more detailsWMSSublayer
Array<(TimeDimension|ElevationDimension|GenericDimension)>more details

An array of time, elevation and other dimensions for the sublayer.

more detailsWMSSublayer
Extentmore details

The full extent of the layer.

more detailsWMSSublayer
Numbermore details

The id for the WMS sublayer.

more detailsWMSSublayer
WMSLayermore details

The WMSLayer to which the sublayer belongs.

more detailsWMSSublayer
Booleanmore details

Indicates whether the layer will be included in the legend.

more detailsWMSSublayer
Stringmore details

A string url pointing to a legend image for the layer.

more detailsWMSSublayer
Numbermore details

The maximum scale (most zoomed in) at which the layer is visible in the view.

more detailsWMSSublayer
Numbermore details

The minimum scale (most zoomed out) at which the layer is visible in the view.

more detailsWMSSublayer
Stringmore details

Name of the WMS sublayer.

more detailsWMSSublayer
Booleanmore details

Indicates whether to display popups when features in the layer are clicked.

more detailsWMSSublayer
Booleanmore details

Indicates if the layer can be queried, i.e.

more detailsWMSSublayer
Number[]more details

List of spatialReferences (WKID) derived from the CRS elements of the first layer in the GetCapabilities request.

more detailsWMSSublayer
Collection<WMSSublayer>more details

A collection of WMSSublayers.

more detailsWMSSublayer
Stringmore details

The title of the WMS sublayer used to identify it in places such as the LayerList and Legend widgets.

more detailsWMSSublayer
Booleanmore details

Indicates if the layer is visible in the view.

more detailsWMSSublayer

Property Details

declaredClass Stringreadonly inherited
Since: ArcGIS API for JavaScript 4.7

The name of the class. The declared class name is formatted as esri.folder.className.

description String

Description for the WMS sublayer. This defaults to the value of the Abstract property from the WMS GetCapabilities request.

Since: ArcGIS API for JavaScript 4.20

An array of time, elevation and other dimensions for the sublayer. Information from a TimeDimension can be used to update View.timeExtent, WMSLayer.timeExtent, or to configure a TimeSlider widget.

A WMSLayer or WMSSublayer can only have one time dimension. The following example shows how to find the time dimension (if any) for the base layer.

const layer = new WMSLayer({
  url: "https://public-wms.met.no/verportal/verportal.map?request=GetCapabilities&service=WMS&version=1.3.0"
});
await layer.load();
const precipitation = layer.allSublayers.find((sl) => sl.name === "precipitation_3h_global");
layer.sublayers = [precipitation];
const timeDimension = precipitation.dimensions.find((dimension) => dimension.name === "time");

Data can exist at specific times or time ranges. We can access this information from the extent property of the TimeDimension as either an array of discrete dates or TimeDimensionIntervals. For example, continuing from the previous example, a TimeSlider is configured using the extent from a TimeDimension.

const dates = timeDimension.extent; // This time dimension is expressed as an array of dates.
const start = dates[0]; // Get the first and earliest date
const end = dates[dates.length -1]; // Get last date
const timeSlider = new TimeSlider({
  container: "timeSliderDiv",
  view: view,
  mode: "instant",
  timeVisible: true,
  loop: true,
  fullTimeExtent: { // The TimeSlider UI will span all dates
    start,
    end
  },
  stops: {
    dates // The TimeSlider thumb will snap exactly to each valid date
  }
})
fullExtent Extent

The full extent of the layer.

id Number

The id for the WMS sublayer.

layer WMSLayer

The WMSLayer to which the sublayer belongs.

legendEnabled Boolean

Indicates whether the layer will be included in the legend. When false, the layer will be excluded from the legend.

Default Value:true
legendUrl String

A string url pointing to a legend image for the layer.

maxScale Number
Since: ArcGIS API for JavaScript 4.14

The maximum scale (most zoomed in) at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of zero means the layer does not have a maximum scale.

Default Value:0
minScale Number
Since: ArcGIS API for JavaScript 4.14

The minimum scale (most zoomed out) at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of zero means the layer does not have a minimum scale.

Default Value:0
name String

Name of the WMS sublayer. This defaults to the value of the Name property from the WMS GetCapabilities request.

popupEnabled Boolean

Indicates whether to display popups when features in the layer are clicked.

Default Value:false
queryable Boolean

Indicates if the layer can be queried, i.e. the service supports GetFeatureInfo with either text/html or text/plain formats.

Default Value:false
spatialReferences Number[]

List of spatialReferences (WKID) derived from the CRS elements of the first layer in the GetCapabilities request.

sublayers Collection<WMSSublayer>

A collection of WMSSublayers.

title String

The title of the WMS sublayer used to identify it in places such as the LayerList and Legend widgets. This defaults to the value of the Title property from the WMS GetCapabilities request.

visible Boolean

Indicates if the layer is visible in the view.

Method Overview

Name Return Type Summary Class
WMSSublayermore details

Creates a deep clone of the WMS sublayer.

more detailsWMSSublayer

Method Details

clone(){WMSSublayer}

Creates a deep clone of the WMS sublayer.

Returns:
Type Description
WMSSublayer A deep clone of the WMS sublayer instance that invoked this method.

Type Definitions

ElevationDimension Object

Elevation dimension information.

Property:
name String

Name of dimensional axis.

The value is always "elevation".

GenericDimension Object

Generic dimension information.

Property:
name String

Name of dimensional axis.

TimeDimension Object

Time dimension information. For example, the WMS service might be published to show hourly weather information. The TimeDimension can be used to update View.timeExtent, WMSLayer.timeExtent, or to configure a TimeSlider widget.

Properties:
name String

Name of dimensional axis.

The value is always "time".

units String

Units of dimensional axis.

The value is always "ISO8601".

Available value(s) for the time dimension.

Default value(s) for the time dimension. The default value will be used if the request does not include a value for the time dimension.

multipleValues Boolean

Indicates whether multiple values of the dimension may be requested.

nearestValue Boolean

Indicates whether the nearest value of the dimension will be returned in response to a request for a nearby value.

TimeDimensionInterval Object

The time dimension interval.

Properties:
min Date

Start of interval.

max Date

End of interval.

resolution Object

Interval duration defined by the following properties.

Specification:
years Number

Number of years.

months Number

Number of months.

days Number

Number of days.

hours Number

Number of hours.

minutes Number

Number of minutes.

seconds Number

Number of seconds.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.