Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Class: ImageParameters

require(["esri/layers/ImageParameters"], function(ImageParameters) { /* code goes here */ });

Description

(Added at v1.0)
Represents the image parameter options used when calling ArcGISDynamicMapServiceLayer.exportMapImage, Geoprocessor.getResultImage, and Geoprocessor.getResultImageLayer.

Samples

Search for samples that use this class.

Constructors

NameSummary
new ImageParameters()Creates a new ImageParameters object.

Constants

NameDescription
LAYER_OPTION_EXCLUDEShows all layers visible by default except the specified layer ID's.
LAYER_OPTION_HIDEShows all layers except the specified layer ID's.
LAYER_OPTION_INCLUDEShows specified layer ID's in addition to layers visible by default.
LAYER_OPTION_SHOWShows only the specified layer ID's.

Properties

NameTypeSummary
bboxExtentExtent of map to be exported.
dpiNumberDots per inch setting for an ArcGISDynamicMapServiceLayer.
formatStringMap image format.
heightNumberRequested image height in pixels.
imageSpatialReferenceSpatialReferenceSpatial reference of exported map.
layerDefinitionsString[]Array of layer definition expressions that allows you to filter the features of individual layers in the exported map image.
layerIdsNumber[]A list of layer ID's, that represent which layers to include in the exported map.
layerOptionStringThe option for displaying or hiding the layer.
layerTimeOptionsLayerTimeOptions[]Array of LayerTimeOptions objects that allow you to override how a layer is exported in reference to the map's time extent.
timeExtentTimeExtentThe time extent for the map image.
transparentBooleanWhether or not background of dynamic image is transparent.
widthNumberRequested image width in pixels.
Constructor Details

new ImageParameters()

Creates a new ImageParameters object. The constructor takes no parameters.
Sample:
require([
  "esri/layers/ImageParameters", ... 
], function(ImageParameters, ... ) {
  var imageParameters = new ImageParameters();
  ...
});
Property Details

<Extent> bbox

Extent of map to be exported.

<Number> dpi

Dots per inch setting for an ArcGISDynamicMapServiceLayer.
Default value: 96

<String> format

Map image format.
Known values: png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg
Default value: png8
Sample:
imageParameters.format = "jpeg";

<Number> height

Requested image height in pixels.

<SpatialReference> imageSpatialReference

Spatial reference of exported map. See Projected Coordinate Systems and Geographic Coordinate Systems for the list of supported spatial references.

<String[]> layerDefinitions

Array of layer definition expressions that allows you to filter the features of individual layers in the exported map image. Layer definitions with semicolons or colons are supported if using a map service published using ArcGIS Server 10.
Sample:

var layerDefs = [];

layerDefs[5] = "STATE_NAME='Kansas'";

layerDefs[4] = "STATE_NAME='Kansas' and POP2007>25000";

layerDefs[3] = "STATE_NAME='Kansas' and POP2007>25000";

imageParameters.layerDefinitions = layerDefs;

<Number[]> layerIds

A list of layer ID's, that represent which layers to include in the exported map. Use in combination with layerOption to specify how layer visibility is handled.
Sample:
require([
  "esri/layers/ImageParameters", ... 
], function(ImageParameters, ... ) {
  var imageParameters = new ImageParameters();
 imageParameters.layerIds = [3,4,5];
 imageParameters.layerOption = ImageParameters.LAYER_OPTION_SHOW;
  ...
});

<String> layerOption

The option for displaying or hiding the layer. See the Constants table for valid values.
Sample:
require([
  "esri/layers/ImageParameters", ... 
], function(ImageParameters, ... ) {
  var imageParameters = new ImageParameters();
  imageParameters.layerOption = ImageParameters.LAYER_OPTION_SHOW;
  ...
});

<LayerTimeOptions[]> layerTimeOptions

Array of LayerTimeOptions objects that allow you to override how a layer is exported in reference to the map's time extent. There is one object per sub-layer. (Added at v2.0)
Sample:

In the following example, array indices 2 and 5 are valid sub-layer IDs.

require([
  "esri/layers/ImageParameters", "esri/layers/LayerTimeOptions", "esri/layers/TimeInfo", ... 
], function(ImageParameters, LayerTimeOptions, TimeInfo, ... ) {
  var imageParameters = new ImageParameters();
  var timeOption1 = new LayerTimeOptions();
  timeOption1.timeOffset = 4;
  timeOption1.timeOffsetUnits = TimeInfo.UNIT_YEARS;

  var options = [];
  options[2]= timeOption1;
  options[5] = timeOption2;
  imageParameters.layerTimeOptions = options;
  ...
});

<TimeExtent> timeExtent

The time extent for the map image. (Added at v2.0)

<Boolean> transparent

Whether or not background of dynamic image is transparent.
Known values: true | false
Default value: true

<Number> width

Requested image width in pixels.
Show Modal