ESM: import WMSSublayer from "@arcgis/core/layers/support/WMSSublayer.js";
CDN: const WMSSublayer = await $arcgis.import("@arcgis/core/layers/support/WMSSublayer.js");
Class: @arcgis/core/layers/support/WMSSublayer
Since: ArcGIS Maps SDK for JavaScript 4.4
Represents a sublayer in a WMSLayer.
Constructors new WMSSublayer(properties)
Parameter
optionalSee the properties for a list of all the properties that may be passed into the constructor.
Show inherited properties Hide inherited properties
Property DetailsInherited
Property declaredClass Stringreadonly
Since: ArcGIS Maps SDK for JavaScript 4.7 Accessor since 4.0, declaredClass added at 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 Maps SDK for JavaScript 4.20 WMSSublayer since 4.4, dimensions added at 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
}
})
The full extent of the layer.
The id for the WMS sublayer.
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.
A string url pointing to a legend image for the layer.
maxScale Number
Since: ArcGIS Maps SDK for JavaScript 4.14 WMSSublayer since 4.4, maxScale added at 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.
minScale Number
Since: ArcGIS Maps SDK for JavaScript 4.14 WMSSublayer since 4.4, minScale added at 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.
Name of the WMS sublayer. This defaults to the value of the Name property from the WMS GetCapabilities request.
Since: ArcGIS Maps SDK for JavaScript 4.17 WMSSublayer since 4.4, parent added at 4.17.
Returns a reference to the parent WMS sublayer or layer.
Example
// Display the title and description for the WMS sublayer named "RADAR_1KM_RDBR".
const wmsLayer = new WMSLayer({
url: "https://geo.weather.gc.ca/geomet"
});
wmsLayer.load().then(() => {
const subLayer = layer.findSublayerByName("RADAR_1KM_RDBR");
let parent = wmsSubLayer.parent;
while(parent) {
parent.visible = true;
parent = parent.parent;
}
});
popupEnabled Boolean
Indicates whether to display popups when features in the layer are clicked.
queryable Boolean
Indicates if the layer can be queried, i.e. the service supports GetFeatureInfo with either text/html or text/plain formats.
List of spatialReferences (WKID) derived from the CRS elements of the first layer in the GetCapabilities request.
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.
uid Stringreadonly
Since: ArcGIS Maps SDK for JavaScript 4.33 WMSSublayer since 4.4, uid added at 4.33.
An automatically generated unique identifier assigned to the instance. The unique id is generated each time the application is loaded.
Indicates if the layer is visible in the view.
Show inherited methods Hide inherited methods
Method DetailsInherited
Method addHandles(handleOrHandles, groupKey)
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, addHandles added at 4.25.
Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.
// Manually manage handles
const handle = reactiveUtils.when(
() => !view.updating,
() => {
wkidSelect.disabled = false;
},
{ once: true }
);
this.addHandles(handle);
// Destroy the object
this.destroy();
Parameters
Handles marked for removal once the object is destroyed.
groupKey *
optionalKey identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.
Creates a deep clone of the WMS sublayer.
Returns
Type Description WMSSublayer A deep clone of the WMS sublayer instance that invoked this method.Inherited
Method hasHandles(groupKey){Boolean}
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, hasHandles added at 4.25.
Returns true if a named group of handles exist.
Parameter
groupKey *
optionalA group key.
Returns
Type Description Boolean Returnstrue
if a named group of handles exist.
Example
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
obj.removeHandles("watch-view-updates");
}
Inherited
Method removeHandles(groupKey)
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, removeHandles added at 4.25.
Removes a group of handles owned by the object.
Parameter
groupKey *
optionalA group key or an array or collection of group keys to remove.
Example
obj.removeHandles(); // removes handles from default group
obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");
ElevationDimension Object
Elevation dimension information.
Name of dimensional axis.
The value is always "elevation".
GenericDimension Object
Generic dimension information.
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.
Name of dimensional axis.
The value is always "time".
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.
Indicates whether multiple values of the dimension may be requested.
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.
Start of interval.
End of interval.
Interval duration defined by the following properties.
Number of years.
Number of months.
Number of days.
Number of hours.
Number of minutes.
Number of seconds.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4