Aravind Sivasailam,
I added "esri/layers/FeatureLayer" to your script, found:FeatureLayer | API Reference
Try this:
<!DOCTYPE html>
<html>
<head>
<title>Create a Web Map</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<link rel="stylesheet" href="http://js.arcgis.com/3.13/esri/css/esri.css">
<style>
html,body,#mapDiv,.map.container{
padding:0;
margin:0;
height:100%;
}
#layerList{
background-color: #fff;
position: absolute !important;
z-index: 99;
padding:10px;
top:10px;
right:20px;
}
</style>
<script>var dojoConfig = { parseOnLoad:true };</script>
<script src="http://js.arcgis.com/3.13/"></script>
<script>
var map;
require([
"esri/map",
"esri/arcgis/utils",
"dojo/_base/array",
"dojo/dom-construct",
"dojo/on", "esri/layers/FeatureLayer" ,
"dojo/domReady!"
], function (
Map,
arcgisUtils,
array,
domConstruct,
on, FeatureLayer
) {
arcgisUtils.createMap("d73cf988e0e04e19af01c91b9c7d62fe", "mapDiv").then(function (response) {
map = response.map; //Get the layers in the map.
var operationalLayers = response.itemInfo.itemData.operationalLayers;
array.forEach(operationalLayers , function(layer){
//create a checkbox and label for each layer in the map
var cbox = domConstruct.create("input",{
type: "checkbox",
name: layer.title,
value: layer.id,
checked: layer.visibility
},"layerList");
var cbox_label = domConstruct.create("label",{
htmlFor: layer.title,
innerHTML: layer.title + "</br>"
},"layerList");
//When the checkbox is clicked change the layer visibility
on(cbox, "click", function(evt){
//Find the layer based on the layer id
var layerid = evt.target.value;
var layer = map.getLayer(layerid);
layer.setVisibility(evt.srcElement.checked);
});
})
});
});
</script>
</head>
<body>
<div id="mapDiv"></div>
<div id="layerList"></div>
</body>
</html>
EDIT:
Never mind You see to have found the solution.