I have map with a raster image loaded on it. The raster image is in my server as a dynamic service. My question is how or what function can I use so when a user clicks on any point on the map, an actual pixel value would show up in a popup?
Many thanks.
Solved! Go to Solution.
Robert,
I finally got it working.
The following method worked:
result.feature.attributes['Pixel Value']);
Thanks for all your help!
Francisco
NM Water,
The way I know to do that is to use the IdentifyTask to get the pixel value.
Hi Robert,
I tried using this method but I keep getting this result. I attached a picture of it. Do you have any idea what could be going wrong?
Here is my code:
Thanks!
Francisco
Francisco,
Put a console.log in the array to see what the value of the result object is. It is normally the case that you are not access the right object property.
Hi Robert,
I did the following and it returned this.
I believe that I have a syntax error when I use result.PixelValue? Any ideas on what the proper syntax is?
Thanks so much!
Francisco
Francisco,
it would be
result.feature.attributes.PixelValue
Hey Robert,
I'm still getting the same error. Could the space in Pixel Value, as shown in the console log have anything to do with it?
I'm still getting undefined.
Best,
Francisco
Robert,
I finally got it working.
The following method worked:
result.feature.attributes['Pixel Value']);
Thanks for all your help!
Francisco
Francisco,
Don't forget to mark this question as answered.