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?
Tim Witt Riyas Deen
Thanks! Teamwork!!
We needed this too. It just needed a small fix from Riyas' example. Here is an updated working sample, using our DEM:
http://jsfiddle.net/kevinmSAGIS/L834u2nt/4/
Identify cell value with Popup in a mapServer raster
I had to add the following line because there's a space in Pixel Value:
"Pixel Value is : " + feature.attributes[ 'Pixel Value']);
Should I use these pixel values to get the depth at particular point if so then can you please guide me on that
Hey Guys, i know this one is pretty old, but i'm basically trying to do the same thing - but i'm stuck...
I'm getting the attached error.
If i log IdentifyTask i get the thing it should be, but if i log IdentifyParameters i just get undefined.
Does anyone have a solution about this?
Greetings GIS_@IF,
I posted an example in this Idea Identifying Raster Cell values in ArcGIS Online feel free to vote for it!
You must have access to the code. In other words, it is not out-of-the-box in ArcGIS Online, yet.
Hi, Does anybody know if a custom widget for ArcGIS Online with this functionality has been created in the mean time and if so, where I could find it?
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,
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?
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.
Absolutely
This is great! I want to incorporate it into a script I'm working on. Will it work to reference the 3.17 API instead of 3.10?
Thanks!
see my reply at the bottom for the fix NM Water
Hi Audy,
I have the same problem currently, I was wondering if you ever figured out how to tackle this issue? I still get undefined when trying to find the pixel value.
Many Thanks.
Thanks Riyas. This is helpful. However, when I try to use your code I receive "undefined" as my pixel value in the pop up. My map service shows in the app and I can click to make the pop up show, but I do not receive a pixel value. Any ideas?
Thanks.
Thanks Tim and Riyas and for the reply, IdentifyParameter and IdentifyTask is the write approach.
But I ran into another problem, on my page I'm loading four different layers at a time while the IdentifyParameter object accepts only one url as a parameter. Note that the layers are not in the same map service, they are in a different urls and different locations.
When the users click on any of the layer, I want to get the pixel values from the clicked layer.
Is this some thing possible?
Hi Beakal,
Noticed that Tim's sample is displaying the pixel's attributes like colour and layer name, i understand you are interested in the value of the pixel.
I have modified find_popup sample to display the pixel value.
Edit fiddle - JSFiddle
Here you go!
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.