<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: problem creating label layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-creating-label-layer/m-p/74303#M6728</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I have troubles like this I start by printing the featureLayer.fields object to the console log of my browser so I can see what the app thinks the actual field name should be. Usually I copy and paste the name, not alias, right from this output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14176547190766010" jivemacro_uid="_14176547190766010"&gt;&lt;P&gt;console.log(districtLayer.fields);&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Dec 2014 00:59:18 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2014-12-04T00:59:18Z</dc:date>
    <item>
      <title>problem creating label layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-creating-label-layer/m-p/74302#M6727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a labelLayer before, but today I'm having problems.&amp;nbsp; This layer has an alias on the field name, which might be causing the problem.&amp;nbsp; I've tried both the name and the alias, but my feature layer still doesn't have any labels.&amp;nbsp; &lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; var countyLayer = new FeatureLayer(pathName + "/ArcGIS/rest/services/BaseMap/county_simple/MapServer/0", 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {id:'countyLayer', visible:true});&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; districtLayer = new FeatureLayer(pathName+"/ArcGIS/rest/services/DESE/Education/MapServer/3",{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id:'districtLayer', 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infoTemplate:generateInfoTemplate,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields : ['*']}); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; buildingLayer = new FeatureLayer(pathName+"/ArcGIS/rest/services/DESE/Education/MapServer/0", 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {id:'buildingLayer',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infoTemplate:generateInfoTemplate,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields : ['*']});


&amp;nbsp; var districtText = new TextSymbol();
&amp;nbsp;&amp;nbsp;&amp;nbsp; districtText.setColor(new Color("#666"));
&amp;nbsp;&amp;nbsp;&amp;nbsp; districtText.font.setSize("8pt");
&amp;nbsp;&amp;nbsp;&amp;nbsp; var districtLabelRenderer = new SimpleRenderer(districtText);
&amp;nbsp;&amp;nbsp;&amp;nbsp; var districtLabelLayer = new LabelLayer({ id: "districtLabels" });
&amp;nbsp;&amp;nbsp;&amp;nbsp; districtLabelLayer.maxScale = 1155582;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // tell the label layer to label the counties feature layer 
&amp;nbsp;&amp;nbsp;&amp;nbsp; districtLabelLayer.addFeatureLayer(districtLayer, districtLabelRenderer, "{District Name}");//the alias name
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayers([countyLayer, districtLayer, buildingLayer, districtLabelLayer]);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:53:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-creating-label-layer/m-p/74302#M6727</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2021-12-10T22:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: problem creating label layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-creating-label-layer/m-p/74303#M6728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I have troubles like this I start by printing the featureLayer.fields object to the console log of my browser so I can see what the app thinks the actual field name should be. Usually I copy and paste the name, not alias, right from this output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14176547190766010" jivemacro_uid="_14176547190766010"&gt;&lt;P&gt;console.log(districtLayer.fields);&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 00:59:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-creating-label-layer/m-p/74303#M6728</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-12-04T00:59:18Z</dc:date>
    </item>
  </channel>
</rss>

