Class: ArcGISImageServiceLayer

Description

Allows you to work with an image map service resource exposed by the ArcGIS Server REST API. (As of v1.2)

Samples

Search for samples that use this class.  

Class hierarchy

esri.Layer
  |_ esri.layers.DynamicMapServiceLayer
        |_ esri.layers.ArcGISImageServiceLayer

Constructor

Constructor Description
esri.layers.ArcGISImageServiceLayer(url, options?) Creates a new ArcGISImageServiceLayer object. A URL is a required parameter. This layer also takes some optional parameters. These optional parameters can be included in any order.

Properties

Property Type Description
bandCount Number Number of bands in ArcGISImageServiceLayer.
bandIds Number[] Array of current band selections.
bands Object[] The raster bands that the raster dataset is composed of and their statistics. The length of this array gives the number of bands and the array index represents the band ID.
compressionQuality Number Current compression quality value. The compression quality controls how much loss the image will be subjected to. Only valid with JPG image types.
copyrightText String Copyright string as defined by the image service.
Description String Description as defined by the image service.
disableClientCaching Boolean When true, images are always requested from the server and the browser's cache is ignored. This should be used when the data supporting the map service changes frequently.
format String The output image type.
interpolation String Current interpolation method. The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space.
mosaicRule MosaicRule Specifies the mosaic rule when defining how individual images should be mosaicked.
pixelSizeX Number Size of pixel in X direction.
pixelSizeY Number Size of pixel in Y direction.
pixelType Number The pixel type of the image service. Pertains to the type of values stored in the raster, such as signed integer, unsigned integer, or floating point. Integers are whole numbers, whereas floating points have decimals.
renderingRule RasterFunction Specifies the rendering rule for how the requested image should be rendered. View the Raster Functions help topic in the REST help for more details.
timeInfo TimeInfo Temporal information for the layer, such as time extent. If this property is null or not specified, then the layer does not support time-related operations.
version Number The version of ArcGIS Server the image service is published to, e.g. 9.3, 9.3.1, 10, 10.01.

Methods

Method Return Value Description
exportMapImage(imageServiceParameters?, callback?) none Exports a map using values as specified by ImageServiceParameters. On completion, MapImage is returned.
setBandIds(bandIds) none Sets the R,G,B of the exported image to the appropriate ImageService Band ID. BandIds are zero based.
setCompressionQuality(quality) none Sets the compression quality of the exported image. Only valid with JPG image format.
setDisableClientCaching(disable) none Sets whether images are always requested from the server and the browser's cache is ignored. This should be used when the data supporting the map service changes frequently.
setImageFormat(imageFormat) none Set the image format.
setInterpolation(interpolation) none Sets the interpolation method. The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space.
setMosaicRule(mosaicRule) MosaicRule Sets the mosaic rule of the layer to the specified value. The mosaic rule defines how individual images should be mosaicked. Refreshes the layer to reflect the mosaic rule.
setRenderingRule(renderingRule) RasterFunction Sets the rendering rule of the layer to the given value. Refreshes the laeyr to reflect the rendering rule.

Events

Event Description
onMapImageExport(mapImage) Fires when the map export is completed.
Constructor Detail

esri.layers.ArcGISImageServiceLayer(url, options?)

Creates a new ArcGISImageServiceLayer object. A URL is a required parameter. This layer also takes some optional parameters. These optional parameters can be included in any order.
Parameters:
<String> url Required URL to the ArcGIS Server REST resource that represents a map service. An example is http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/Portland_ESRI_LandBase_AGO/MapServer. For more information on constructing a URL, see The Services Directory and the REST API.
<Object> options Optional Optional parameters. See options list.
Options:
<String> id Id to assign to the layer. If not assigned, esri.Map assigns value.
<ImageServiceParameters> imageServiceParameters The image service parameter options used when exporting an Image Service layer.
<Number> opacity Initial opacity or transparency of layer. Values range from 0.0 to 1.0, where 0.0 is 100% transparent and 1.0 has no transparency. The default value is 1.0.
<Boolean> visible Initial visibility of the layer. Default is true.
Properties Detail

<Number> bandCount

Number of bands in ArcGISImageServiceLayer.

<Number[]> bandIds

Array of current band selections.
See also:
setBandIds  

<Object[]> bands

The raster bands that the raster dataset is composed of and their statistics. The length of this array gives the number of bands and the array index represents the band ID.
Code snippets:
The array is an object of the form:
 
[
 {
   "min": <Number>,
   "max": <Number>,
   "mean": <Number>,
   "stddev": <Number>

 },
 ...
]

<Number> compressionQuality

Current compression quality value. The compression quality controls how much loss the image will be subjected to. Only valid with JPG image types.
See also:
setCompressionQuality  

<String> copyrightText

Copyright string as defined by the image service.

<String> Description

Description as defined by the image service.

<Boolean> disableClientCaching

When true, images are always requested from the server and the browser's cache is ignored. This should be used when the data supporting the map service changes frequently. (As of v1.2)
Known values: true | false
Default value: false

<String> format

The output image type.
Known values: png8 | png24 | jpg | bmp | gif
Default value: png8
See also:
setImageFormat  

<String> interpolation

Current interpolation method. The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space.
See also:
setInterpolation  

<MosaicRule> mosaicRule

Specifies the mosaic rule when defining how individual images should be mosaicked.

<Number> pixelSizeX

Size of pixel in X direction.

<Number> pixelSizeY

Size of pixel in Y direction.

<Number> pixelType

The pixel type of the image service. Pertains to the type of values stored in the raster, such as signed integer, unsigned integer, or floating point. Integers are whole numbers, whereas floating points have decimals.
Known values: C64 | C128 | F32 | F64 | S8 | S16 | S32 | U1 | U2 | U4 | U8 | U16 | U32 | UNKNOWN

<RasterFunction> renderingRule

Specifies the rendering rule for how the requested image should be rendered. View the Raster Functions help topic in the REST help for more details.

<TimeInfo> timeInfo

Temporal information for the layer, such as time extent. If this property is null or not specified, then the layer does not support time-related operations.
Code snippets:
  var timeInfo = imageServiceLayer.timeInfo;

<Number> version

The version of ArcGIS Server the image service is published to, e.g. 9.3, 9.3.1, 10, 10.01.
Methods Detail

exportMapImage(imageServiceParameters?, callback?)

Exports a map using values as specified by ImageServiceParameters. On completion, MapImage is returned.
Return value: none
Input Parameters:
<ImageServiceParameters> imageServiceParameters Optional Input parameters assigned before exporting the map image.
<Function> callback Optional The function to call when the method has completed. The arguments in the function are the same as the onMapImageExport event.
See also:
onMapImageExport  

setBandIds(bandIds)

Sets the R,G,B of the exported image to the appropriate ImageService Band ID. BandIds are zero based.
Return value: none
Input Parameters:
<Number[]> bandIds Required Array of band IDs to use in the exported image.
Code snippets:
  myArcGISImageServiceLayer.setBandIds([2,1,0]);

See also:
bandIds  

setCompressionQuality(quality)

Sets the compression quality of the exported image. Only valid with JPG image format.
Return value: none
Input Parameters:
<Number> quality Required A value from 0 to 100. 100 is best quality but largest in file size.
See also:
compressionQuality  

setDisableClientCaching(disable)

Sets whether images are always requested from the server and the browser's cache is ignored. This should be used when the data supporting the map service changes frequently.
Return value: none
Input Parameters:
<Boolean> disable Required When true, browser client side caching is disabled.

setImageFormat(imageFormat)

Set the image format.
Return value: none
Input Parameters:
<String> imageFormat Required Valid values are png | png8 | png24 | jpg | pdf | bmp | gif | svg.
Code snippets:
imageServiceLayer.setImageFormat("png8");

See also:
format  

setInterpolation(interpolation)

Sets the interpolation method. The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space.
Return value: none
Input Parameters:
<String> interpolation Required Interpolation value defined in ImageServiceParameters Constants Table.
See also:
interpolation  

setMosaicRule(mosaicRule)

Sets the mosaic rule of the layer to the specified value. The mosaic rule defines how individual images should be mosaicked. Refreshes the layer to reflect the mosaic rule. (As of v2.0)
Return value: MosaicRule
Input Parameters:
<MosaicRule> mosaicRule Required The mosaic rule.
Code snippets:
var mr = new esri.layers.MosaicRule();
mr.method = esri.layers.MosaicRule.METHOD_VIEWPOINT;
mr.viewpoint = inPoint;
layer.setMosaicRule(mr);

setRenderingRule(renderingRule)

Sets the rendering rule of the layer to the given value. Refreshes the laeyr to reflect the rendering rule. (As of v2.0)
Return value: RasterFunction
Input Parameters:
<RasterFunction> renderingRule Required The new rendering rule.
Code snippets:
  var rasterFunction = new esri.layers.RasterFunction();
  rasterFunction.functionName = "Stretch";
  var arguments = {};
  arguments.StretchType= stretch;
  arguments.NumberOfStandardDeviations = parseFloat(dojo.byId('txtSD').value);
  arguments.Gamma =[1.25,2,3.95];
  arguments.Statistics = [[0.2, 222.46, 99.35, 1.64],[ 5.56, 100.345, 45.4, 3.96],[0, 352.37, 172.284, 2]];
  rasterFunction.arguments = arguments; 
  rasterFunction.variableName = "Raster";
  imageServiceLayer.setRenderingRule(rasterFunction);

Events Detail

onMapImageExport(mapImage)

Fires when the map export is completed.
Arguments:
<MapImage> mapImage Contains the properties of a dynamically generated map image.
See also:
exportMapImage