Javascript Api Identify Raster pixel value

11971
22
Jump to solution
08-20-2014 07:02 AM
BeakalGobena
New Contributor II

I have this map loaded using the ArcGIS API

http://ags.servirlabs.net/ArcGIS/rest/services/ReferenceNode/TRMM_30DAY/MapServer

I want to let the user click on the raster layer and display the pixel value at that specific x,y location in a pop up window. While googling I found this example

https://developers.arcgis.com/javascript/jssamples/find_popup.html

explaining how to use IdentifyTask. Can I use this feature for a raster layer plus the data is already loaded do I need to make an extra request to get the values every time the user clicks on the layer?

0 Kudos
22 Replies
LloydBronn
Occasional Contributor II

When I switch the reference to 3.17, the map gets all screwed up (only certain tiles show up) and the identify widget becomes a line of text way up in the left corner of the map. 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Did you change the CSS references too?

0 Kudos
LloydBronn
Occasional Contributor II

I did. There is only one CSS reference in the example script. <link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css">. 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lloyd,

   What did you update that url to? 

It was:

<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css">

you should change it to:
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.17/esri/css/esri.css">

0 Kudos
LloydBronn
Occasional Contributor II

I changed both to 3.17. It works perfectly with 3.10, but goes crazy with 3.17. The only other thing I changed was the center and zoom of the map. 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lloyd,


  Pay very close attention to the CSS URL the URL you are trying to use is incorrect. If you copy the CSS link I provided you will not have an issue.

0 Kudos
LloydBronn
Occasional Contributor II

That works, thanks!!

0 Kudos
HarshP
by
New Contributor

Should I use these pixel values to get the depth at particular point if so then can you please guide me on that 

0 Kudos
by Anonymous User
Not applicable

GreetingsDerek Law‌ This would be an excellent feature to support in ArcGIS Online webmaps for identifying raster pixels in popups.  If webmaps support it natively we can use it for creating fully online Esri-cloud hosted WebApp Builder sites. Any thought if this might be implemented at some time in the future?  

0 Kudos
DerekLaw
Esri Esteemed Contributor

Hi Kevin,

I see you've already submitted your enhancement suggestion on the ArcGIS Ideas threads,

https://community.esri.com/ideas/12329 

And I can't comment on if and when this enhancement would be implemented at this time, sorry. It could probably use some more votes to make it a higher priority.

Hope this helps and happy holidays,