AnsweredAssumed Answered

problem creating label layer

Question asked by schlot on Nov 26, 2014
Latest reply on Dec 3, 2014 by sarahclark

I have created a labelLayer before, but today I'm having problems.  This layer has an alias on the field name, which might be causing the problem.  I've tried both the name and the alias, but my feature layer still doesn't have any labels. 

  var countyLayer = new FeatureLayer(pathName + "/ArcGIS/rest/services/BaseMap/county_simple/MapServer/0", 
     {id:'countyLayer', visible:true});     
      districtLayer = new FeatureLayer(pathName+"/ArcGIS/rest/services/DESE/Education/MapServer/3",{
        outFields : ['*']}); 
     buildingLayer = new FeatureLayer(pathName+"/ArcGIS/rest/services/DESE/Education/MapServer/0", 
      outFields : ['*']});

  var districtText = new TextSymbol();
    districtText.setColor(new Color("#666"));
    var districtLabelRenderer = new SimpleRenderer(districtText);
    var districtLabelLayer = new LabelLayer({ id: "districtLabels" });
    districtLabelLayer.maxScale = 1155582;
    // tell the label layer to label the counties feature layer 
    districtLabelLayer.addFeatureLayer(districtLayer, districtLabelRenderer, "{District Name}");//the alias name
    map.addLayers([countyLayer, districtLayer, buildingLayer, districtLabelLayer]);