Select to view content in your preferred language

How do I identify pixel values in a Dynamic Service?

2033
8
Jump to solution
05-05-2016 08:59 AM
NMWater
Regular Contributor


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.

0 Kudos
1 Solution

Accepted Solutions
NMWater
Regular Contributor

Robert,

I finally got it working.

The following method worked:

result.feature.attributes['Pixel Value']);

Thanks for all your help!

Francisco

View solution in original post

0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus

NM Water,

  The way I know to do that is to use the IdentifyTask to get the pixel value.

0 Kudos
NMWater
Regular Contributor

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

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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.

0 Kudos
NMWater
Regular Contributor

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

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Francisco,

  it would be

result.feature.attributes.PixelValue

0 Kudos
NMWater
Regular Contributor

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

0 Kudos
NMWater
Regular Contributor

Robert,

I finally got it working.

The following method worked:

result.feature.attributes['Pixel Value']);

Thanks for all your help!

Francisco

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Francisco,

  Don't forget to mark this question as answered.

0 Kudos