Display Raster Layer using ArcGIS Javascript API

4503
3
Jump to solution
01-08-2014 07:45 PM
BeakalGobena
New Contributor II
I Want to display a raster layer on to my page using ArcGIS javascript API. Loading Feature layer is easy and pretty forward but the raster layer is giving me hard time.

Here is the the MapService: http://ags.servirlabs.net/ArcGIS/rest/services/ReferenceNode/TRMM_30DAY/MapServer/0 which is Raster layer not featureLayer or imageService.

Do you have any ideas on how to do this?
0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor
You can add this as an ArcGISDynamicMapServiceLayer.  For Dynamic Map Service Layers, you do not want to specify the index of the layer in the URL.  Take a look at an example.

View solution in original post

0 Kudos
3 Replies
JakeSkinner
Esri Esteemed Contributor
You can add this as an ArcGISDynamicMapServiceLayer.  For Dynamic Map Service Layers, you do not want to specify the index of the layer in the URL.  Take a look at an example.
0 Kudos
BeakalGobena
New Contributor II
Thank you so much for the example, and works perfectly. I was also able to load raster layer using the DynamicLayer class, is that an effective way of loading the service, since dynamicLayer is no cached?

Any ways both ArcGISDynamicMapServiceLayer and Dynamic layer works for raster layer. Which one do you think is more efficient?
0 Kudos
JakeSkinner
Esri Esteemed Contributor
If you cache your service, you should load it using the ArcGISTiledMapServiceLayer.  As for DynamicMapServiceLayer vs ArcGISDynamicMapServiceLayer, I would recommend the ArcGISDynamicMapServiceLayer since this gives you more Properties/Methods/Events to use.
0 Kudos