Legend for Raster

1034
7
Jump to solution
01-21-2014 08:50 AM
StephenFricke
New Contributor III
Hello, I published a raster dataset as a map service.  I then want to be able to use this raster in a mobile app, and view it's legend. When I try to view it's legend, I just get a box that says no legend.  I am basing my script off of this esri example:

http://developers.arcgis.com/en/javascript/samples/mobile_soilmap/

Instead of using the soil survey as the layer to create the legend, I am trying to use a raster of temperature data.  When I look at the capabilities of this map service in the ArcGIS server manager, you can not seem to allow feature access, which I think might be the problem.  Could anyone let me know how I can create a legend for my raster in this situation?  Thanks!
0 Kudos
1 Solution

Accepted Solutions
StephenFricke
New Contributor III
Hmm, is the URL of the raster dataset publicy accessible?

Looking at the Geoprocessing with result map service sample, it looks like raster data can be included in a legend.


Thanks for your help Noah.  I figured out that I was needing to define the raster as a ArcGISDynamicServiceLayer instead of a FeatureLayer.

View solution in original post

0 Kudos
7 Replies
Noah-Sager
Esri Regular Contributor
Hi Peter,

Not sure exactly, but one good thing to check would be the Legend in the Map Service at REST.

The soil survey sample you indicated has a legend that is visible at REST. Is this the same for your raster dataset?

-Noah
0 Kudos
StephenFricke
New Contributor III
Hi Peter,

Not sure exactly, but one good thing to check would be the Legend in the Map Service at REST.

The soil survey sample you indicated has a legend that is visible at REST. Is this the same for your raster dataset?

-Noah


Hey Noah,

Thanks for the reply.  Yes, I am able to view the legend at REST.
0 Kudos
Noah-Sager
Esri Regular Contributor
Alright then. And what happens if you swap in your service into a different sample, like the Legend sample?

Can you see the Legend now?
0 Kudos
StephenFricke
New Contributor III
Alright then. And what happens if you swap in your service into a different sample, like the Legend sample?

Can you see the Legend now?


I swapped out both waterbodies and rivers with my raster, and nothing appears in the legend.  I think it has something to do with it being a raster dataset, and not a polygon...
0 Kudos
Noah-Sager
Esri Regular Contributor
Hmm, is the URL of the raster dataset publicy accessible?

Looking at the Geoprocessing with result map service sample, it looks like raster data can be included in a legend.
0 Kudos
StephenFricke
New Contributor III
Hmm, is the URL of the raster dataset publicy accessible?

Looking at the Geoprocessing with result map service sample, it looks like raster data can be included in a legend.


Thanks for your help Noah.  I figured out that I was needing to define the raster as a ArcGISDynamicServiceLayer instead of a FeatureLayer.
0 Kudos
Noah-Sager
Esri Regular Contributor
No worries, glad to you got it figured out!
0 Kudos