Extends L.esri.
L.esri.
is an abstraction for the Identify API found in Image Services. It provides a chainable API for building request parameters and executing the request.
Constructor
Constructor | Description |
---|---|
L.esri.identifyImage(<ImageService>endpoint) L.esri.identifyImage(<Object>options) | Accepts either an |
Options
Option | Type | Default | Description |
---|---|---|---|
url | String | '' | URL of the ArcGIS service you would like to consume. |
proxy | String | false | URL of an ArcGIS API for JavaScript proxy or ArcGIS Resource Proxy to use for proxying POST requests. |
use | Boolean | true | If this task should use CORS when making GET requests. |
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 ( |
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 |
returnGeometry(<Boolean>returnGeometry) | this | Return catalog footprints (geometry) with catalog item results. Default is |
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 |
Example
L.map('map').setView([36.230577, -118.253147], 10);
L.esri.identifyImage({
url: 'https://tiledimageservices3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/US_Annual_Temperature/ImageServer'
})
.at([36.230577, -118.253147])
.pixelSize([30, 30])
.run(function (error, identifyImageResponse, rawResponse) {
if (error) {
console.log(error);
return;
}
console.log(identifyImageResponse.pixel.properties.value);
});