Could you edit your post and wrap the code in code tags, it will help with readability!
define(["dojo/_base/declare", "esri/map", "esri/layers/FeatureLayer", "dojo/_base/connect","dojo/topic", "dojo/_base/lang"],
function (declare, esriLib, featureLib,connect,topic,lang) {
return declare (null, {
mapDivName : null,
constructor: function (mapDiv,args) {
topic.subscribe('dimension/changed', lang.hitch(this, this.resizeMap));
topic.subscribe('zoom/end', lang.hitch(this, this.zoomEnd));
this.mapDivName = mapDiv;
},
initialize: function() {
//var initialExtent = new esri.geometry.Extent({"xmin":-13050590.679808607,"ymin":3848824.1306140213,"xmax":-13033430.566958608,"ymax":3863366.2752452563,"spatialReference":{"wkid":102100}});
this.map = new esri.Map(this.mapDivName);
var baseLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://xxx/xxx/rest/services/VECTOR_BASEMAPS/xxx/MapServer");
var opLayer1 = new esri.layers.ArcGISDynamicMapServiceLayer("http://xxx/xxx/rest/services/VECTOR_BASEMAPS/xxx/MapServer", { opacity: 0.8 });
var opLayer2 = new esri.layers.ArcGISDynamicMapServiceLayer("http://xxx/xxx/rest/services/xxx/xxx/MapServer", { opacity: 0.8 });
var opLayer3 = new esri.layers.ArcGISDynamicMapServiceLayer("http://xxx/xxx/rest/services/xxx/MapServer", { opacity: 0.8 });
this.map.addLayers([baseLayer,opLayer1,opLayer2,opLayer3]);
this.featureLayer = this.addFeatureLayer();
this.map.resize();
this.map.addLayer(this.featureLayer);
},
resizeMap: function() {
this.map.resize();
this.map.reposition();
},
zoomEnd: function() {
var s = dojo.byId("rightDiv");
s.innerHTML = this.map.getScale();
},
addFeatureLayer: function() {
var info_content = "<table><tr><td><b>Band Number:</b></td><td style='text-align:right'>${BAND_NUMBER}</td></tr>"
+ "<tr><td><b>Service Center:</b></td><td style='text-align:right'>${SERVICE_CENTER}</td></tr>"
+ "<tr><td><b>Registered Population:</b></td><td style='text-align:right'>${REGISTERED_POPULATION}</td></tr></table>";
var infoTemplate1 = new esri.InfoTemplate("${BAND_NAME}", info_content);
var featureLayer1 = new esri.layers.FeatureLayer("http://xxx/xxx/rest/services/xxx/xxx/MapServer/1",{
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
infoTemplate: infoTemplate1,
id: "OBJECTID",
outFields: ["*"]
});
return featureLayer1;
}
});
});
Out of time today, will try to have a look tomorrow...someone else might be able to help you in the meantime.P.S. there are several samples that use multiple feature layers also I posted some code the other day for another member concerning toggling of multiple feature layers, maybe that's worth finding...