L.esri.Tasks.IdentifyImage
L.esri.Tasks.IdentifyImage is an abstraction for the Identify API that exists on Image Services. It provides a chainable API for building request parameters and executing the request.
Constructor
| Constructor |
Description |
new L.esri.Tasks.IdentifyImage(<ImageService> endpoint, <Object> options)
L.esri.Tasks.identifyImage(<ImageService> endpoint, <Object> options)
new L.esri.Tasks.IdentifyImage(<String> endpoint, <Object> options)
L.esri.Tasks.identifyImage(<String> endpoint, <Object> options)
|
The endpoint parameter is the service that you want to identify either an ArcGIS Server or ArcGIS Online service. You can also pass the URL to a service directly as a string. See service URLs for more information on how to find these URLs. |
Options
Methods
| Method |
Returns |
Description |
at(<LatLng> latlng) |
this |
Identifie the pixel value at a given LatLng |
between(<Date> from, <Date> to) |
this |
Identifies pixel values within a given time range. |
getRenderingRule() |
Object |
Returns the current rendering rule of the task. |
setRenderingRule(<Object> renderingRule) |
this |
Sets the rendering rule to apply when getting a pixel value. |
getMosaicRule() |
Object |
Returns the current mosaic rule of the task. |
setMosaicRule(<Object> mosaicRule) |
this |
Sets the mosaic rule to apply when getting a pixel value. |
setPixelSize(<Array> pixelSize or <String> pixelSize) |
this |
Sets the pixel size to use when getting a pixel value. Either an array ([x,y]) or string ('x,y'). If not set, it will use the pixel size defined by the service. |
getPixelSize() |
Object |
Returns the current pixel size of the task. |
returnCatalogItems(<Boolean> returnCatalogItems) |
this |
Indicates whether or not to return raster catalog items. Set it to false when catalog items are not needed to improve the identify operation's performance significantly. When set to false, neither the geometry nor attributes of catalog items will be returned. Default is false. |
returnGeometry(<Boolean> returnGeometry) |
this |
Return catalog footprints (geometry) with catalog item results. Default is false. |
token(<String> token) |
this |
Adds a token to this request if the service requires authentication. Will be added automatically if used with a service. |
run(<Function> callback, <Object> context) |
this |
Executes the identify request with the current parameters, identified pixel value will be passed to callback as a GeoJSON Point. Accepts an optional function context |
Example
var map = L.map('map').setView([36.230577, -118.253147], 10);
L.esri.Tasks.identifyImage('http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/CaliforniaDEM/ImageServer')
.at([36.230577, -118.253147])
.pixelSize([30,30])
.run(function(error, identifyImageResponse, rawResponse){
console.log(identifyImageResponse.pixel.properties.value);
});
Edit this page on GitHub