# Heat Maps only for feature layer (why not for dynamic layer ?) in ArcGIS Java script API 3.0/3.2

I am referring this link to generate the heat map. In this example they used feature layer and I tried using dynamic layer but getting an error (that no map is displaying).

I researched on Google regarding this but not able to find such information .

So is there any specific requirement/purpose to use feature layer instead of dynamic layer??

If anyone know this please let me know….

Thanks…

Software platform : ArcGIS 10.1 (Server & Desktop), ArcGIS JSAPI 3.0/3.2

-

You should be able to use an ArcGISDynamicLayer, but you instantiate as a feature layer. Not sure what mode you would use...MODE_SNAPSHOT, MODE_ONDEMAND

 //Create a feature layer for map
featureLayer = new esri.layers.FeatureLayer("http://yourserver/arcgis/rest/services/folder/servicename/MapServer/0", {
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
outFields: ["STN_CASGEM_STATION_ID", "WLM_GROUND_SURFACE_ELEVATION"], //all would be ["*"]
});


http://help.arcgis.com/en/webapi/javascript/arcgis/jshelp/#inside_feature_layers

Feature layers can be created by referencing a layer from either a map service or a feature service or by specifying a feature colleciton object.

• Use a map service if you just want to retrieve geometries and attributes from the server and symbolize them yourself. (In the final release, the map service will be able to return its symbols.)

• Use a feature service if you want to take advantage of symbols from the service's source map document. Also use a feature service if you
plan on doing editing with the feature layer. Feature layers honor
any feature templates configured in the source map document.

• Feature collection objects are used to create a feature layer based on the supplied definition.

-
thanks for the reply..nice explanation..the reason to use dynamic layer is that it takes less time to display 800 points on the map..If I convert as feature layer then it takes little bit extra time for rendering and getting warning in the console.. I will soon put the code on JS fiddle. –  Sunil Feb 1 '13 at 7:14
I have changed mode that is mode_selection still its not working and debugging the code..I will post the code may be today evening or tomorrow morning.. thanks once again : ) –  Sunil Feb 4 '13 at 6:31