Beakal Beakal - 1 month ago 14x
Javascript Question

Display Raster Layer using ArcGIS Javascript API

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:
which is Raster layer.

Do you have any ideas on how to do this?


You can add raster layers to your map using the ArcGISTiledMapService layer, for example:

// assuming 'map' is a reference to your map
map.addLayer(new esri.layers.ArcGISTiledMapServiceLayer(""));

There are some good examples on the ArcGIS JavaScript API site here:

One thing to be aware of with tiled layers is that you can only add tiled layers to your map if they are using the same spatial reference. You can't add a layer as a tiled layer with a different spatial reference as it's cache of tiles have already been produced using it's spatial reference. You can add a layer as a Dynamic layer to re-project it.