Class: ArcGisMapServerImageryProvider

ArcGisMapServerImageryProvider

new ArcGisMapServerImageryProvider()

Provide tile imaging services hosted by ArcGIS MapServer. By default, if server pre cached tiles are available, they will be prioritized for accessing ArcGIS image tile services. An ArcGIS Access Token is required for authentication. To obtain secure resources, you need to first register for an ArcGIS developer account or ArcGIS online account, and obtain an access token through authentication methods.

Name Type Default Description
options.url String

The URL of ArcGIS MapServer service.

options.token String optional

ArcGIS token used for authentication with ArcGIS MapServer service.

options.tileDiscardPolicy TileDiscardPolicy optional

The strategy for determining whether tiles are invalid and should be discarded. If this value is not specified, DiscardMissingTile ImagePolicy is used by default for tile map servers, and NeverTileDiscardPolicy is used by default for non tile map servers. In the former case, we request the 0,0 tile of the highest tile level, and then check the pixel points (0,0), (200,20), (20200), (80110), and (160,130). If all these pixels are transparent, discard check is disabled and no tiles are discarded. If any of them have non transparent colors, any tiles with the same value at these pixel positions will be discarded. The final result of these default values should be the correct tile discard for standard ArcGIS servers. To ensure that no tiles are discarded, build and pass a NeverTileDiscardPolicy as this parameter.

options.proxy Proxy optional

Proxy used for requests. If necessary, the object should have a getURL function to return the proxy URL.

options.usePreCachedTilesIfAvailable Boolean true optional

If true, the server's pre cached tiles will be used (if available). If false, any pre cached tiles will be ignored and the export service will be used.

options.layers String optional

Use commas to separate the list of layers to be displayed, or set it to undefined if all layers should be displayed.

options.enablePickFeatures Boolean true optional

If true, ArcGisMapServerImageryProvider # pickFeatures will call the Identify service on MapServer and return the features included in the response. If false, ArcGisMapServerImageryProvider # pickFeatures will immediately return undefined (indicating no pickable features) without communicating with the server. If you do not want the features of this provider to be picked up, please set this property to false. You can override this setting by setting the ArcGisMapServerImageryProvider # enablePickFeatures property on the object.

options.rectangle Rectangle Rectangle.MAX_VALUE optional

The rectangular range of the layer. This parameter will be ignored when accessing tile layers.

options.tilingScheme TilingScheme new GeographicTilingScheme() optional

A slicing scheme used to divide global images into tiles. This parameter will be ignored when accessing the tile server.

options.ellipsoid Ellipsoid optional

Ellipsoid body. If a slicing scheme is specified and used, this parameter will be ignored and replaced by the ellipsoid of the slicing scheme. If neither parameter is specified, use WGS84 ellipsoid.

options.tileWidth Number 256 optional

The pixel width of each tile. This parameter will be ignored when accessing the tile server.

options.tileHeight Number 256 optional

The pixel height of each tile. This parameter will be ignored when accessing the tile server.

options.maximumLevel Number optional

The maximum tile level to be requested, or undefined if there is no maximum value. This parameter will be ignored when accessing the tile server.

See:
Example
var esri = new SuperMap3D.ArcGisMapServerImageryProvider({
    url : 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer'
});

Members

readonly creditCredit

Retrieve the copyright statement displayed when this image provider is active. Usually, this is used for the source of images. This function should not be called until ArcGisMapServerImageryProvider # ready returns true.

customRequestHeadersObject

Custom request header

enablePickFeaturesBoolean

Gets or sets a value indicating whether feature picking is enabled. If true, ArcGisMapServerImageryProvider#pickFeatures will invoke the "identify" operation on the ArcGIS server and return the features included in the response. If false, ArcGisMapServerImageryProvider#pickFeatures will immediately return undefined (indicating no pickable features) without communicating with the server.

Default Value:
true

readonly errorEventEvent

Get an event triggered when the image provider encounters an asynchronous error. By subscribing to this event, you will be notified of errors and may potentially recover from them. The event listener will receive a TileProviderError instance.

readonly hasAlphaChannelBoolean

Get a value indicating whether the image provided by this image provider contains an alpha channel. If this attribute is false, even if there is an alpha channel, it will be ignored. If this property is true, any image without an alpha channel will be considered to have an alpha value of 1.0 everywhere. When this attribute is false, both memory usage and texture upload time will decrease.

Default Value:
true

layersString

Get a comma separated list of layer IDs to display.

readonly maximumLevelNumber

Obtain the level of granularity that can be requested. This function should not be called until ArcGisMapServerImageryProvider # ready returns true.

readonly minimumLevelNumber

Obtain the minimum level of granularity that can be requested. This function should not be called until ArcGisMapServerImageryProvider # ready returns true.

readonly proxyProxy

Get the proxy used by the provider.

readonly readyBoolean

Get a value indicating whether the provider is ready for use.

readonly readyPromisePromise.<Boolean>

Get a promise that is true when the provider is ready for use.

readonly rectangleRectangle

Obtain the rectangular range of the image provided by this instance, measured in radians. This function should not be called until ArcGisMapServerImageryProvider # ready returns true.

readonly tileDiscardPolicyTileDiscardPolicy

Obtain tile discard strategy. If there is no definition, the discard strategy 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 ArcGisMapServerImageryProvider # ready returns true.

readonly tileHeightNumber

Get the height of each tile in pixels. This function should not be called until ArcGisMapServerImageryProvider # ready returns true.

readonly tileWidthNumber

Get the width of each tile in pixels. This function should not be called until ArcGisMapServerImageryProvider # ready returns true.

readonly tilingSchemeTilingScheme

Obtain the tile scheme used by this provider. This function should not be called until ArcGisMapServerImageryProvider # ready returns true.

readonly tokenString

Obtain ArcGIS tokens for verifying the ArcGis MapServer service.

readonly urlString

Get the URL of ArcGIS MapServer.

readonly usingPrecachedTilesBoolean

Get a value indicating whether this image provider is using pre cached tiles from ArcGIS MapServer. If the image provider is not ready (ArcGisMapServerImageryProvider # ready), even if MapServer does not have pre cached tiles, this function will return the value of options.usePreCachedTilesIfAvailable.

Default Value:
true

Methods

getTileCredits(x, y, level){Array.<Credit>}

Retrieve the copyright information to be displayed when displaying a given tile.

Name Type Description
x Number

The X-coordinate of the tile.

y Number

The Y coordinate of the tile.

level Number

The level of tiles.

Throws:

GetTileCredits cannot be called until the image provider is ready.

Type
DeveloperError
Returns:
Type Description
Array.<Credit> The copyright information that needs to be displayed when tiles are displayed.

pickFeatures(x, y, level, longitude, latitude){Promise.<Array.<ImageryLayerFeatureInfo>>|undefined}

/**Asynchronous determination of whether there are any features within the tile at a given longitude and latitude. This function should not be called until ImageryProvider # ready returns true.

Name Type Description
x Number

The X-coordinate of the tile.

y Number

The Y coordinate of the tile.

level Number

The level of tiles.

longitude Number

Select the longitude of the feature.

latitude Number

Select the latitude of the feature.

Throws:

PickFeatures cannot be called until the image provider is ready.

Type
DeveloperError
Returns:
Type Description
Promise.<Array.<ImageryLayerFeatureInfo>> | undefined A promise for the selected feature that will be resolved when asynchronous picking is completed. The solved value is an ImageryLayerElementInfo instance array. If no features are found at a given location, the array may be empty.

requestImage(x, y, level, request){Promise.<(Image|Canvas)>|undefined}

Request the image of the given tile. This function should not be called until ArcGisMapServerImageryProvider # ready returns true.

Name Type Description
x Number

The X-coordinate of the tile.

y Number

The Y coordinate of the tile.

level Number

The level of tiles.

request Request optional

Request object. For internal use only.

Throws:

RequesttImage cannot be called until the image provider is ready.

Type
DeveloperError
Returns:
Type Description
Promise.<(Image|Canvas)> | undefined A promise for an image that will be resolved when the image is available, or if there are too many active requests to the server and the requests should be retried later, it is undefined. The solved image can be an Image or Canvas DOM object.