require(["esri/layers/ArcGISImageServiceLayer"], function(ArcGISImageServiceLayer) { /* code goes here */ });
Description
(Added at v1.2)
Allows you to work with an image map service resource exposed by the ArcGIS Server REST API.
Samples
Search for
samples that use this class.
Class hierarchy
esri/layers/Layer
|_esri/layers/DynamicMapServiceLayer
|_esri/layers/ArcGISImageServiceLayer
Constructors
Properties
attributionDataUrl | String | The URL, when available, where the layer's attribution data is stored. |
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. |
className | String | class attribute of the layer's node. |
compressionQuality | Number | Current compression quality value. |
copyrightText | String | Copyright string as defined by the image service. |
credential | Credential | Provides credential information for the layer such as userid and token if the layer represents a resource that is secured with token-based authentication. |
defaultMosaicRule | MosaicRule | Returns a MosaicRule object that defines the default mosaic properties published 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. |
format | String | The output image type. |
fullExtent | Extent | Full extent as defined by the map service. |
hasAttributionData | Boolean | When true, the layer has attribution data. |
id | String | ID assigned to the layer. |
infoTemplate | InfoTemplate | The template that defines the content to display in the map info window when the user clicks on a raster. |
initialExtent | Extent | Initial extent as defined by the map service. |
interpolation | String | Current interpolation method. |
loadError | Error | Set if the layer failed to load. |
loaded | Boolean | When the layer is loaded, the value becomes "true", and layer properties can be accessed. |
maxImageHeight | Number | The maximum image height, in pixels, that the map service will export. |
maxImageWidgth | Number | The maximum image width, in pixels, that the map service will export. |
maxRecordCount | Number | The maximum number of results that can be returned from query, identify and find operations. |
maxScale | Number | Maximum visible scale for the layer. |
minScale | Number | Minimum visible scale for the layer. |
mosaicRule | MosaicRule | Specifies the mosaic rule when defining how individual images should be mosaicked. |
opacity | Number | Opacity or transparency of layer. |
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. |
refreshInterval | Number | Refresh interval of the layer in minutes. |
renderingRule | RasterFunction | Specifies the rendering rule for how the requested image should be rendered. |
showAttribution | Boolean | When true, the layer's attribution is displayed on the map. |
spatialReference | SpatialReference | The spatial reference of the map service. |
suspended | Boolean | When true, the layer is suspended. |
timeInfo | TimeInfo | Temporal information for the layer, such as time extent. |
url | String | URL to the ArcGIS Server REST resource that represents a map service. |
useMapImage | Boolean | By default, images are exported in MIME format, and the image is streamed to the client. |
version | Number | The version of ArcGIS Server the image service is published to, such as 9.3, 9.31, 10, 10.41. |
visible | Boolean | Visibility of the layer. |
visibleAtMapScale | Boolean | When true, the layer is visible at the current map scale. |
Methods
attr(name, value) | Layer | Adds a new attribute or changes the value of an existing attribute on the layer's node. |
exportMapImage(imageServiceParameters?, callback?) | None | Exports a map using values as specified by ImageServiceParameters. |
getAttributionData() | Deferred | Asynchrously returns custom data for the layer when available. |
getDefinitionExpression() | String | Returns the current definition expression. |
getImageUrl(extent, width, height, callback) | String | Method to implement when extending DynamicMapServiceLayer. |
getKeyProperties() | Deferred | Get key properties of an ImageService including information such as the band names associated with the imagery. |
getMap() | Map | Returns reference to the map control the layer is added to. |
getNode() | HTMLElement | Returns the layer's DOM node. |
getRasterAttributeTable() | Deferred | Asynchronously returns the raster attribute table of an ImageService which returns categorical mapping of pixel values (for example a class, group, category, or membership). |
getVisibleRasters() | Graphic[] | Gets the currently visible rasters. |
hide() | None | Sets the visibility of the layer to "false". |
isVisibleAtScale(scale) | Boolean | Returns true if the layer is visible at the given scale. |
queryVisibleRasters(query, options?, callback?, errback?) | None | Returns the rasters that are visible in the area defined by the geometry (required to be point or polygon) in the query parameter. |
refresh() | None | Refreshes the map by making a new request to the server. |
resume() | None | Resumes layer drawing. |
setBandIds(bandIds, doNotRefresh?) | None | Sets the R,G,B of the exported image to the appropriate ImageService Band ID. |
setCompressionQuality(quality, doNotRefresh?) | None | Sets the compression quality of the exported image. |
setDefinitionExpression(expression, doNotRefresh) | None | Sets the definition expression for the ImageService Layer. |
setDisableClientCaching(disable) | None | Sets whether images are always requested from the server and the browser's cache is ignored. |
setImageFormat(imageFormat, doNotRefresh?) | None | Set the image format. |
setInfoTemplate(infoTemplate) | None | Specify or change the info template for a layer. |
setInterpolation(interpolation, doNotRefresh?) | None | Sets the interpolation method. |
setMaxScale(scale) | None | Set the maximum scale for the layer. |
setMinScale(scale) | None | Set the minimum scale for the layer. |
setMosaicRule(mosaicRule, doNotRefresh?) | None | Sets the mosaic rule of the layer to the specified value. |
setOpacity(opacity) | None | Sets the opacity of the layer. |
setRefreshInterval(interval) | Layer | Changes the layer's refresh interval to the given value (in minutes). |
setRenderingRule(renderingRule, doNotRefresh?) | None | Sets the rendering rule of the layer to the given value. |
setScaleRange(minScale, maxScale) | None | Set the scale range for the layer. |
setUseMapTime(update) | None | Determine if the layer will update its content based on the map's current time extent. |
setVisibility(isVisible) | None | Sets the visibility of the layer. |
show() | None | Sets the visibility of the layer to "true". |
suspend() | None | Suspends layer drawing. |
Events
[ On Style Events | Connect Style Event ]
All On Style event listeners receive a single event object. Additionally, the event object also contains a 'target' property whose value is the object which fired the event.
Events
error | {
error: <Error >
} | Fires when there is a problem retrieving a layer. |
load | {
layer: <Layer >
} | Fires after layer properties for the layer are successfully populated. |
map-image-export | {
mapImage: <MapImage >
} | Fires when the map export is completed. |
mosaic-rule-change | | Fired when the layers mosaic rule is changed. |
opacity-change | {
opacity: <Number >
} | Fires when the layer opacity has been changed, and returns an object with the opacity value. |
refresh-interval-change | | This event is fired when the layer's refreshInterval is modified. |
rendering-change | | Fired when the layers band ids are changed or if a raster function is applied. |
resume | | Fires when a layer resumes drawing. |
scale-range-change | | Fires when a layer's minScale and/or maxScale is changed. |
scale-visibility-change | | Fires when a layer's scale visibility changes. |
suspend | | Fires when a layer suspends drawing. |
update | | Fires any time a layer has finished loading or updating itself. |
update-end | {
error: <Error >
} | Fires when a layer has finished updating its content. |
update-start | | Fires when a layer begins to update its content. |
visibility-change | {
visible: <Boolean >
} | Fires when the layer visibility has been changed, and returns an object with a Boolean visible property containing the new visibility value of the layer. |
Constructor Details
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
https://www.example.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
properties:
<String > id |
Optional |
Id to assign to the layer. If not assigned, esri.Map assigns value. |
<ImageServiceParameters > imageServiceParameters |
Optional |
The image service parameter options used when exporting an Image Service layer. |
<InfoTemplate > infoTemplate |
Optional |
The template that defines the content to display in the map info window when the user clicks on a raster. |
<Number > opacity |
Optional |
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. |
<Object > resourceInfo |
Optional |
Specify the metadata of the layer. |
<Boolean > useMapImage |
Optional |
By default, images are exported in MIME format, and the image is streamed to the client. When useMapImage is set to true, the image is saved to the server, and a JSON formatted response is sent to the client with the URL location of the image. A second call is automatically made to the server to retrieve the image. This methodology is required for secure services that go through a proxy server. In this situation, a map image cannot be streamed. |
<Boolean > useMapTime |
Optional |
When true, the layer will update its content based on the map's time extent. The default values is true. |
<Boolean > visible |
Optional |
Initial visibility of the layer. Default is true. |
Property Details
The URL, when available, where the layer's attribution data is stored. (Added at v3.1)
Number of bands in ArcGISImageServiceLayer.
Array of current band selections.
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.
Sample: The array is an object of the form:
[
{
"min": <Number>,
"max": <Number>,
"mean": <Number>,
"stddev": <Number>
},
...
]
class attribute of the layer's node.
(Added at v3.7)
Current compression quality value. The compression quality controls how much loss the image will be subjected to. Only valid with JPG image types.
Copyright string as defined by the image service.
Provides credential information for the layer such as userid and token if the layer represents a resource that is secured with token-based authentication. This value is available after the layer has been loaded i.e. layer.loaded
is true. (Added at v2.5)
Returns a MosaicRule object that defines the default mosaic properties published by the image service.
(Added at v3.5)
Description as defined by the image service.
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.
Known values: true | false
Default value: false
The output image type.
Known values: png8 | png24 | jpg | bmp | gif
Default value: png8
Full extent as defined by the map service.
When true, the layer has attribution data. Use the
getAttributionData method to retrieve this data as JSON.
(Added at v3.1) Known values: true | false
Default value: false
ID assigned to the layer. If not assigned, esri.Map assigns value. By default, the ID of the layer is "layer" followed by a number. The ID can be user defined only in the layer constructor.
Sample:
- Setting the layer ID in the layer constructor.
require([
"esri/layers/ArcGISDynamicMapServiceLayer", ...
], function(ArcGISDynamicMapServiceLayer, ... ) {
var population = new ArcGISDynamicMapServiceLayer("http://myserver/arcgis/rest/population/MapServer/Layers", {id:"population"});
...
});
- Setting the layer ID after a layer is initialized.
population.id = "population";
- Retrieving the layer ID.
function getMapLayers() {
for (var j=0, jl=map.layerIds.length; j<jl; j++) {
var currentLayer = map.getLayer(map.layerIds[j]);
alert("id: " + currentLayer.id);
}
}
The template that defines the content to display in the map info window when the user clicks on a raster. (Added at v3.9)
Initial extent as defined by the map service.
Current interpolation method. The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space.
Set if the layer failed to load. (Added at v3.9)
When the layer is loaded, the value becomes "true", and layer properties can be accessed. The
onLoad event is also fired.
Known values: true | false
The maximum image height, in pixels, that the map service will export. Requires ArcGIS Server version 10.1 or greater. (Added at v2.6)
The maximum image width, in pixels, that the map service will export. Requires ArcGIS Server version 10.1 or greater. (Added at v2.6)
The maximum number of results that can be returned from query, identify and find operations. Requires ArcGIS Server version 10.1 or greater. (Added at v2.6)
Maximum visible scale for the layer. If the map is zoomed in beyond this scale, the layer will not be visible. A value of 0 means the layer does not have a maximum scale. The default value is 0. (Added at v3.1)
Minimum visible scale for the layer. If the map is zoomed out beyond this scale, the layer will not be visible. A value of 0 means the layer does not have a visible scale. The default value is 0. (Added at v3.1)
Specifies the mosaic rule when defining how individual images should be mosaicked.
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.
Known values: 0.0 - 1.0
Default value: 1.0
Size of pixel in X direction.
Size of pixel in Y direction.
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
Refresh interval of the layer in minutes. Non-zero value indicates automatic layer refresh at the specified interval. Value of 0 indicates auto refresh is not enabled. (Added at v3.7)
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.
When true, the layer's attribution is displayed on the map. (Added at v3.1)
Known values: true | false
Default value: true
When true, the layer is suspended. A layer is considered to be suspended when one of the following is true:
- The layer is hidden.
- The layer is not visible at the current map scale.
- The layer is explicitly suspended by calling the
Layer.suspend
method.
(Added at v3.1) Known values: true | false
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.
Sample:
require([
"ArcGISImageServiceLayer", ...
], function(ArcGISImageServiceLayer, ... ) {
var imageServiceLayer = new ArcGISImageServiceLayer( ... );
var timeInfo = imageServiceLayer.timeInfo;
...
});
By default, images are exported in MIME format, and the image is streamed to the client. When useMapImage is set to true, the image is saved to the server, and a JSON formatted response is sent to the client with the URL location of the image. A second call is automatically made to the server to retrieve the image. This methodology is required for secure services that go through a proxy server. In this situation, a map image cannot be streamed. (Added at v3.9)
Known values: true | false
Default value: false
The version of ArcGIS Server the image service is published to, such as 9.3, 9.31, 10, 10.41.
Visibility of the layer.
Known values: true | false
Default value: true
When true, the layer is visible at the current map scale. (Added at v3.1)
Known values: true | false
Method Details
Adds a new attribute or changes the value of an existing attribute on the layer's node. Removes the attribute if the value is null
or undefined
. (Added at v3.7)
Parameters:
<String > name |
Required |
The name of the attribute. |
<String > value |
Required |
The value of the attribute. Set this value as null to remove the attribute. |
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. |
Asynchrously returns custom data for the layer when available. (Added at v3.1)
Returns the current definition expression. (Added at v3.6)
Parameters:
<Extent > extent |
Required |
Current extent of the map. |
<Number > width |
Required |
Current width of the map in pixels. |
<Number > height |
Required |
Current height of the map in pixels. |
<Function > callback |
Required |
The function to call when the method has completed. |
Get key properties of an ImageService including information such as the band names associated with the imagery. (Added at v3.5)
Returns reference to the map control the layer is added to. Returns null
or undefined
if it is not added to a map. (Added at v3.7)
Returns the layer's DOM node. (Added at v3.7)
Asynchronously returns the raster attribute table of an ImageService
which returns categorical mapping of pixel values (for example a class, group, category, or membership). (Added at v3.6)
Gets the currently visible rasters. (Added at v3.6)
Sets the visibility of the layer to "false". The layer is not removed, but it is hidden from view.
Returns true if the layer is visible at the given scale. (Added at v3.1)
Parameters:
<Number > scale |
Required |
The scale at which to check if the layer is visible. |
Returns the rasters that are visible in the area defined by the geometry (required to be point or polygon) in the query parameter. It honors time definition, info template fields, mosaic rule and rendering rule. Options parameter is optional and can be used to describe the prefix to be used with the raster attribute table fields using the 'rasterAttributeTableFieldPrefix' property. This method is a wrapper around an
Image Service's Identify.
(Added at v3.6) Parameters:
<Query > query |
Required |
The esri.tasks.Query to be passed as the input to query visible rasters. |
<Object > options |
Optional |
Options for query. Use the rasterAttributeTableFieldPrefix property to describe the prefix to be used with the raster attribute table fields. |
<Function > callback |
Optional |
The function to call when the method has completed. |
<String > errback |
Optional |
The function to call when an error occurs. |
Refreshes the map by making a new request to the server. In order to refresh the layer in this manner, setDisableClientCaching must be true. This ensures that map images are not cached on the client. (Added at v1.2)
Resumes layer drawing. (Added at v3.1)
Sets the R,G,B of the exported image to the appropriate ImageService Band ID. BandIds are zero based.
Parameters:
<Number[] > bandIds |
Required |
Array of band IDs to use in the exported image. |
<Boolean > doNotRefresh |
Optional |
When true the layer will not refresh the map image. The default value is false. Added at version 2.2. |
Sample:
myArcGISImageServiceLayer.setBandIds([2,1,0]);
Sets the compression quality of the exported image. Only valid with JPG image format.
Parameters:
<Number > quality |
Required |
A value from 0 to 100. 100 is best quality but largest in file size. |
<Boolean > doNotRefresh |
Optional |
When true the layer will not refresh the map image. The default value is false. Added at version 2.2. |
Sets the definition expression for the ImageService
Layer. Only the rasters that match the definition expression are displayed. (Added at v3.6)
Parameters:
<String > expression |
Required |
The definition expression to be set. |
<Boolean > doNotRefresh |
Required |
Whether or not the expression definition will be refreshed. |
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.
Parameters:
<Boolean > disable |
Required |
When true, browser client side caching is disabled. |
Set the image format.
Parameters:
<String > imageFormat |
Required |
Valid values are png | png8 | png24 | jpg | pdf | bmp | gif | svg. |
<Boolean > doNotRefresh |
Optional |
When true the layer will not refresh the map image. The default value is false. Added at version 2.2. |
Sample:
imageServiceLayer.setImageFormat("png8");
Specify or change the info template for a layer. (Added at v3.6)
Parameters:
<InfoTemplate > infoTemplate |
Required |
The content for display in an InfoWindow. |
Sets the interpolation method. The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space.
Parameters:
<String > interpolation |
Required |
Interpolation value defined in ImageServiceParameters Constants Table. |
<Boolean > doNotRefresh |
Optional |
When true the layer will not refresh the map image. The default value is false. Added at version 2.2. |
Set the maximum scale for the layer. (Added at v3.1)
Parameters:
<Number > scale |
Required |
The maximum scale at which the layer is visible. |
Set the minimum scale for the layer. (Added at v3.1)
Parameters:
<Number > scale |
Required |
The minimum scale at which the layer is visible. |
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. (Added at v2.0)
Parameters:
<MosaicRule > mosaicRule |
Required |
The mosaic rule. |
<Boolean > doNotRefresh |
Optional |
When true the layer will not refresh the map image. The default value is false. Added at version 2.2. |
Sample:
require([
"esri/layers/MosaicRule", ...
], function(MosaicRule, ... ) {
var mr = new MosaicRule();
mr.method = MosaicRule.METHOD_VIEWPOINT;
mr.viewpoint = inPoint;
layer.setMosaicRule(mr);
...
});
Sets the opacity of the layer. Values range from 0.0 to 1.0, where 0.0 is 100% transparent and 1.0 has no transparency.
Parameters:
<Number > opacity |
Required |
Value from 0 to 1, where 0 is 100% transparent and 1 has no transparency. The default value is 1. |
Sample:
layer.setOpacity(0.5);
Changes the layer's refresh interval to the given value (in minutes). Non-zero value sets up automatic layer refresh at the specified interval. Value of 0 stops auto refresh. (Added at v3.7)
Parameters:
<Number > interval |
Required |
Refresh interval of the layer in minutes. Non-zero value indicates automatic layer refresh at the specified interval. Value of 0 indicates auto refresh is not enabled. |
Sets the rendering rule of the layer to the given value. Refreshes the layer to reflect the rendering rule. (Added at v2.0)
Parameters:
<RasterFunction > renderingRule |
Required |
The new rendering rule. |
<Boolean > doNotRefresh |
Optional |
When true the layer will not refresh the map image. The default value is false. Added at version 2.2. |
Sample:
require([
"esri/layers/RasterFunction", ...
], function(RasterFunction, ... ) {
var rasterFunction = new 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);
...
});
Set the scale range for the layer. If minScale
and maxScale
are set to 0 then the layer will be visible at all scales. (Added at v3.1)
Parameters:
<Number > minScale |
Required |
The minimum scale at which the layer is visible. |
<Number > maxScale |
Required |
The maximum scale at which the layer is visible. |
Determine if the layer will update its content based on the map's current time extent. Default value is true. (Added at v2.2)
Parameters:
<Boolean > update |
Required |
When false the layer will not update its content based on the map's time extent. Default value is true. |
Sets the visibility of the layer. When true, the layer is visible.
Parameters:
<Boolean > isVisible |
Required |
Set the visibility of the layer. |
Sets the visibility of the layer to "true".
Suspends layer drawing. (Added at v3.1)
Event Details
[ On Style Events | Connect Style Event ]
Fires when there is a problem retrieving a layer. Should be used in favor of onError. (Added at v3.5)
Fires after layer properties for the layer are successfully populated. This event must be successful before the layer can be added to the map. Should be used in favor of onLoad. (Added at v3.5)
Event Object Properties:
<Layer > layer |
The loaded layer. |
Fires when the map export is completed. (Added at v3.6)
Event Object Properties:
<MapImage > mapImage |
Contains the properties of a dynamically generated map image. |
Fired when the layers mosaic rule is changed. Should be used in favor of "onMosaicRuleChange". (Added at v3.6)
Fires when the layer opacity has been changed, and returns an object with the opacity value. Should be used in favor of onOpacityChange. (Added at v3.5)
Event Object Properties:
<Number > opacity |
Fires when the layer opacity (transparency) changes. A number property named opacity that indicates the new opacity. Values range from 0.0 to 1.0, where 0.0 is 100% transparent and 1.0 has no transparency. |
This event is fired when the layer's refreshInterval
is modified. (Added at v3.7)
Fired when the layers band ids are changed or if a raster function is applied. Should be used in favor of "onRenderingChange". (Added at v3.5)
Fires when a layer resumes drawing. Should be used in favor of onResume. (Added at v3.5)
Fires when a layer's minScale and/or maxScale is changed. Should be used in favor of onScaleRangeChange. (Added at v3.5)
Fires when a layer's scale visibility changes. The scale visibility changes when a layer is initially visible and becomes invisible because the map scale does not intersect the layer's scale range or vice versa. Should be used in favor of onScaleVisibilityChange. (Added at v3.5)
Fires when a layer suspends drawing. Should be used in favor of onSuspend. (Added at v3.5)
Fires when a layer has finished updating its content. It is the responsibility of the subclass to determine when this event is fired. Should be used in favor of onUpdateEnd. (Added at v3.5)
Event Object Properties:
<Error > error |
Optional argument. The error object is available when an error occurs during the update. |
Fires when a layer begins to update its content. It is the responsibility of the subclass to determine when this event is fired. Should be used in favor of onUpdateStart. (Added at v3.5)
Fires when the layer visibility has been changed, and returns an object with a Boolean visible property containing the new visibility value of the layer. Should be used in favor of onVisibilityChange. (Added at v3.5)
Event Object Properties:
<Boolean > visible |
Fires when the layer visibility changes. A boolean property named visible indicates whether or not the layer is visible after visibility changed. |
Fires when there is a problem retrieving a layer. (Added at v1.3)
Fires after layer properties for the layer are successfully populated. This event must be successful before the layer can be added to the map.
In Internet Explorer, due to resource caching, the onLoad event is fired as soon as the layer is constructed. Consequently you should check whether the layer's loaded property is true before registering a listener for the onLoad event:
Event Object Properties:
<Layer > layer |
The loaded layer. |
Sample: function init() {
//setting initial extent in constructor
var map = new esri.Map("mapDiv", { extent: new esri.geometry.Extent(...) });
//or use set extent method
var map = new esri.Map("mapDiv");
map.setExtent(new esri.geometry.Extent(...));
//add first layer
map.addLayer(...);
}
Fires when the map export is completed.
Event Object Properties:
<MapImage > mapImage |
Contains the properties of a dynamically generated map image. |
Fires when the layers mosaic rule is changed. (Added at v3.6)
Fires when the layer opacity has been changed, and returns the opacity value.
Event Object Properties:
<Number > opacity |
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. |
This event is fired when the layer's refreshInterval
is modified. (Added at v3.7)
Fires when the Image Service layers band ids are changed or if a raster function is applied. (Added at v3.5)
Fires when a layer resumes drawing. (Added at v3.1)
Fires when a layer's minScale and/or maxScale is changed. (Added at v3.1)
Fires when a layer's scale visibility changes. The scale visibility changes when a layer is initially visible and becomes invisible because the map scale does not intersect the layer's scale range or vice versa. (Added at v3.1)
Fires when a layer suspends drawing. (Added at v3.1)
Fires when a layer has finished updating its content. It is the responsibility of the subclass to determine when this event is fired.
Event Object Properties:
<Error > error |
Optional argument. The error object is available when an error occurs during the update. |
Sample: dojo.connect(layer, "onUpdateEnd", layerUpdateCompleted);
function layerUpdateCompleted(error) {
if (error) {
console.log("Update completed with error: ", error);
}
else {
console.log("Update completed");
}
}
Fires when a layer begins to update its content. It is the responsibility of the subclass to determine when this event is fired.
Sample:
dojo.connect(layer, "onUpdateStart", layerUpdateStarted);
function layerUpdateStarted() {
console.log("Update started...");
}
Fires when the layer visibility has been changed, and returns the new visibility.
Event Object Properties:
<Boolean > visbility |
Determines whether the layer is visible on the map. |