I'm working with a multidimensional CRF raster being pulled from an image server REST endpoint. I would like to allow users to click on the raster and have the computer return all the pixel values, in chronological order, for that certain spot. Ideally I'll then allow them to export these values but at this point I'd just like to get the values to log in the console so I know I'm correctly grabbing them.
my current code for the identification looks like this:
view.on("click", (event) => {
layer.identify(url, {
geometry: event.mapPoint,
mosaicRule: {
ascending: true,
},
processAsMultidimensional: true,
returnPixelValues: true,
returnCatalogItems: false,
returnGeometry: false,
timeExtent: {
start: dates[0],
end: dates[dates.length - 1]
},
})
.then((results) => {
alert("values: ", results.value)
})
.catch((err) => console.log(err));
});
The console throws back an error:
I'm not sure what I am doing wrong here.
Any help is much appreciated! If anyone has any examples of how they have used imageService Identify in the past I'd also be very apprciative, as I'm new to this and examples work wonders on my understanding of things.
Thanks!
Solved! Go to Solution.
I solved it. I just had to remove the url from the arguments. I guess because I was already performing the method on an image service layer the url was redundant. I also changed the alert to a console.log.
I solved it. I just had to remove the url from the arguments. I guess because I was already performing the method on an image service layer the url was redundant. I also changed the alert to a console.log.