new WebMapTileServiceImageryProvider()
Used to load WMTS (Web Map Tile Service) standard map tile classes that provide image tiles provided by WMTS 1.0.0 compatible servers. This provider supports HTTP KVP encoding and RESTful Get File requests, but does not yet support SOAP encoding.
| Name | Type | Default | Description |
|---|---|---|---|
options.url |
String |
The basic URL for WMTS Get File operation (for KVP encoded requests) or tile URL template (for RESTful requests). The tile URL template should include the following variables: {style}, {TileMatrixSet}, {TileMatrix}, {TileRow}, {TileCol}. If the actual value is hard coded or not required by the server, the first two values are optional. {s} Keywords can be used to specify subdomains. |
|
options.format |
String | 'image/jpeg' |
optional
Retrieve the MIME type of the image from the server. |
options.layer |
String |
The layer name requested by WMTS. |
|
options.style |
String |
The style name requested by WMTS. |
|
options.tileMatrixSetID |
String |
The identifier for TileMatrixSet used for WMTS requests. |
|
options.tileMatrixLabels |
Array |
optional
The identifier list used for WMTS requests in the tile matrix, with one identifier per tile matrix level. |
|
options.clock |
Clock |
optional
Clock instance, used to determine the value of the time dimension. Must be used when specifying options. times. |
|
options.times |
TimeIntervalCollection |
optional
The data property of TimeIntervalCollection is an object that contains the dynamic dimension of time and its values. |
|
options.dimensions |
Object |
optional
An object that contains static dimensions and their values. |
|
options.tileWidth |
Number | 256 |
optional
Tile width, measured in pixels. |
options.tileHeight |
Number | 256 |
optional
Tile height, measured in pixels. |
options.tilingScheme |
TilingScheme |
optional
The slicing scheme corresponding to the tile organization in TileMatrixSet. |
|
options.proxy |
Object |
optional
Proxy used for requests. The object should have a getURL function to return the proxy URL. |
|
options.rectangle |
Rectangle | Rectangle.MAX_VALUE |
optional
The rectangular area covered by the layer. |
options.minimumLevel |
Number | 0 |
optional
The minimum level of detail supported by the image provider. |
options.maximumLevel |
Number |
optional
The maximum level of detail supported by the image provider is undefined if there is no limit. |
|
options.ellipsoid |
Ellipsoid |
optional
Ellipsoid. If not specified, use WGS84 ellipsoid. |
|
options.credit |
Credit | String |
optional
The copyright statement of the data source is displayed on the canvas. |
|
options.subdomains |
String | Array.<String> | 'abc' |
optional
The subdomain to be used for the {s} placeholder in the URL template. If it is a single string, each character in the string represents a subdomain. If it is an array, then each element in the array is a subdomain. |
- See:
Examples
// Example 1. USGS shaded relief tiles (KVP)
var shadedRelief1 = new SuperMap3D.WebMapTileServiceImageryProvider({
url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS',
layer : 'USGSShadedReliefOnly',
style : 'default',
format : 'image/jpeg',
tileMatrixSetID : 'default028mm',
// tileMatrixLabels : ['default028mm:0', 'default028mm:1', 'default028mm:2' ...],
maximumLevel: 19,
credit : new SuperMap3D.Credit('U. S. Geological Survey')
});
viewer.imageryLayers.addImageryProvider(shadedRelief1);
// Example 2. USGS shaded relief tiles (RESTful)
var shadedRelief2 = new SuperMap3D.WebMapTileServiceImageryProvider({
url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg',
layer : 'USGSShadedReliefOnly',
style : 'default',
format : 'image/jpeg',
tileMatrixSetID : 'default028mm',
maximumLevel: 19,
credit : new SuperMap3D.Credit('U. S. Geological Survey')
});
viewer.imageryLayers.addImageryProvider(shadedRelief2);
// Example 3. NASA time dynamic weather data (RESTful)
var times = SuperMap3D.TimeIntervalCollection.fromIso8601({
iso8601: '2015-07-30/2017-06-16/P1D',
dataCallback: function dataCallback(interval, index) {
return {
Time: SuperMap3D.JulianDate.toIso8601(interval.start)
};
}
});
var weather = new SuperMap3D.WebMapTileServiceImageryProvider({
url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png',
layer : 'AMSR2_Snow_Water_Equivalent',
style : 'default',
tileMatrixSetID : '2km',
maximumLevel : 5,
format : 'image/png',
clock: clock,
times: times,
credit : new SuperMap3D.Credit('NASA Global Imagery Browse Services for EOSDIS')
});
viewer.imageryLayers.addImageryProvider(weather);
Members
-
clockClock
-
Get or set the clock used to maintain the time dynamic parameter.
-
readonly creditCredit
-
Obtain the copyright statement to be displayed when activating the image provider. Usually, this will be used to indicate the source of the image. This function should not be called before WebMapTileServiceImageryProvider # ready returns true.
-
dimensionsObject
-
Get or set an object that contains static dimensions and their values.
-
readonly errorEventEvent
-
Retrieve the event triggered when the image provider encounters an asynchronous error. By subscribing to events, you will receive error notifications and may potentially recover from them. The event listener is passed an instance of TileProviderError.
-
readonly formatString
-
Retrieve the mime type of the image returned by the image provider.
-
readonly hasAlphaChannelBoolean
-
Obtain a value indicating whether the image provided by the image provider contains an alpha channel. If the attribute is false, the existing alpha channel will be ignored. If this attribute is true, any image that does not contain an alpha channel will be considered as an image with an alpha value of 1.0. When this attribute is false, both memory usage and texture upload time will be reduced.
-
readonly maximumLevelNumber
-
Obtain the minimum level of granularity that can be requested. This function should not be called before WebMapTileService ImageryProvider # ready returns true.
-
readonly minimumLevelTilingScheme
-
Get the slice mode used by this provider. This function should not be called before WebMapTileService ImageryProvider # ready returns true.
-
readonly proxyNumber
-
Get the width of each tile in pixels. This function should not be called before WebMapTileService ImageryProvider # ready returns true.
-
readonly readyBoolean
-
Get a value indicating whether the provider can use it.
-
readonly readyPromisePromise.<Boolean>
-
Get the Promise that parses to true when the provider is ready.
-
readonly rectangleRectangle
-
Obtain the rectangular range of the image provided by this instance, measured in radians. This function should not be called until WebMapTileService ImageryProvider # ready returns true.
-
readonly tileDiscardPolicyTileDiscardPolicy
-
Obtain tile discard strategy. If not defined, the discard policy is responsible for filtering out "missing" tiles through its should DiscardImage function. If this function returns undefined, then no tiles are filtered. This function should not be called until WebMapTileService ImageryProvider # ready returns true.
-
readonly tileHeightNumber
-
Obtain the maximum level of granularity that can be requested. This function should not be called before WebMapTileService ImageryProvider # ready returns true.
-
readonly tileWidthNumber
-
Get the height of each tile in pixels. This function should not be called before WebMapTileService ImageryProvider # ready returns true.
-
readonly tilingSchemeTilingScheme
-
Get the slice mode used by this provider. This function should not be called before WebMapTileService ImageryProvider # ready returns true.
-
timesTimeIntervalCollection
-
Get or set the set of time intervals used to obtain dynamic time parameters. Each TimeInterval data is an object that contains the key and value of the attribute used in the following situations. tile requests.
-
readonly urlString
-
Obtain the URL of the service that carries the image.
Methods
-
getTileCredits(x, y, level){Array.<Credit>}
-
Obtain the copyright statement to be displayed when displaying a given tile.
Name Type Description xNumber The X-coordinate of the tile.
yNumber The Y coordinate of the tile.
levelNumber The level of tiles.
Throws:
-
GetTileCredits must not be called before the video provider is ready.
- Type
- DeveloperError
Returns:
Type Description Array.<Credit> The copyright statement to be displayed when displaying tiles. -
-
pickFeatures(x, y, level, longitude, latitude){Promise.<Array.<ImageryLayerFeatureInfo>>|undefined}
-
The image provider currently does not support feature selection, so this function returns undefined.
Name Type Description xNumber The X-coordinate of the tile.
yNumber The Y coordinate of the tile.
levelNumber The level of tiles.
longitudeNumber Select the longitude of the feature.
latitudeNumber Select the latitude of the feature.
Returns:
Type Description Promise.<Array.<ImageryLayerFeatureInfo>> | undefined When asynchronous collection is completed, the Promise of the collected features will be parsed. The parsed value is an array composed of ImageryLayerElementInfo instances. If no features are found at a given location, the array may be empty. If extraction is not supported, the array may also be undefined. -
requestImage(x, y, level, request){Promise.<(Image|Canvas)>|undefined}
-
Request to specify the image of the tile. This function should not be called before WebMapTileServiceImageryProvider # ready returns true.
Name Type Description xNumber The X-coordinate of the tile.
yNumber The Y coordinate of the tile.
levelNumber The level of tiles.
requestRequest optional Request object. For internal use only.
Throws:
-
RequestImage must not be called before the image provider is ready.
- Type
- DeveloperError
Returns:
Type Description Promise.<(Image|Canvas)> | undefined Promise of the image, which will parse the image when it is available; If there are too many active requests on the server, the Promise is not defined and the request should be retried later. The parsed image can be an image or a Canvas DOM object. -