<?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: Labels with KML Polygons in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labels-with-kml-polygons/m-p/235227#M21930</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the speedy reply!&amp;nbsp; I don't think I am using the template syntax...&amp;nbsp; I noticed in the ESRI Sample that the labels had "$" before them on the map so I took the "$" out of my code.&amp;nbsp; There aren't any errors, but the labels aren't shown either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Sep 2014 15:49:00 GMT</pubDate>
    <dc:creator>SamuelHenderson</dc:creator>
    <dc:date>2014-09-10T15:49:00Z</dc:date>
    <item>
      <title>Labels with KML Polygons</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labels-with-kml-polygons/m-p/235225#M21928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using a kml file that was generated by ArcMap.&amp;nbsp; I'd like to have the polygons in the KML labeled with a value from a field.&amp;nbsp; What's the best way to do this?&amp;nbsp; I've followed the sample for labeling things here: &lt;A href="https://developers.arcgis.com/javascript/jssamples/layers_label.html"&gt;https://developers.arcgis.com/javascript/jssamples/layers_label.html&lt;/A&gt; and replaced the FeatureLayer with a featureLayer returned from kml.getLayers().&amp;nbsp; The following Javascript doesn't generate any errors, but unfortunately the labels are still not present.&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_14103631773788117" jivemacro_uid="_14103631773788117" modifiedtitle="true"&gt;
&lt;P&gt;function LoadKMZ(kmlURL) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var kml = new KMLLayer(kmlURL, { id: "kml" });&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; kml.setOpacity(0.5);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(kml);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; kml.on("load", function () {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("KML Loaded");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var layers = kml.getLayers();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var fl = layers[0];&amp;nbsp; // There is only 1 FeatureLayer in the KML&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var censusLabel = new TextSymbol().setColor("#666");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; censusLabel.font.setSize("14pt");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; censusLabel.font.setFamily("arial");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; censusLabelRenderer = new SimpleRenderer(censusLabel);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var labels = new LabelLayer({ id: "labels" });&lt;/P&gt;
&lt;P&gt; &lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; labels.addFeatureLayer(fl, censusLabelRenderer, "{" + "LABELNAME"+ "}");&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // add the label layer to the map&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(labels);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the polygons are clicked in the Map a balloon window with the attribute data pops up.&amp;nbsp; The name I would like to appear in the label layer is a field of this attribute data... but I think what is happening is that on like 15 of the above code when I'm adding the feature layer to my label layer it's not finding the field name.&amp;nbsp; It's odd that it doesn't give an error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 15:39:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labels-with-kml-polygons/m-p/235225#M21928</guid>
      <dc:creator>SamuelHenderson</dc:creator>
      <dc:date>2014-09-10T15:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Labels with KML Polygons</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labels-with-kml-polygons/m-p/235226#M21929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Samuel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;labeling has changed with the latest update, please read here &lt;A href="https://developers.arcgis.com/javascript/jshelp/whats_new.html" title="https://developers.arcgis.com/javascript/jshelp/whats_new.html"&gt;What's new in Version 3.10 | Guide | ArcGIS API for JavaScript&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Labeling expressions no longer use &lt;CODE style="font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; padding: 0.3125em; font-size: 1.1em; background: transparent;"&gt;${field}&lt;/CODE&gt; syntax but now use &lt;CODE style="font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; padding: 0.3125em; font-size: 1.1em; background: transparent;"&gt;{field}&lt;/CODE&gt;. In other words, popup template syntax instead of info template syntax.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 15:41:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labels-with-kml-polygons/m-p/235226#M21929</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2014-09-10T15:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Labels with KML Polygons</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labels-with-kml-polygons/m-p/235227#M21930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the speedy reply!&amp;nbsp; I don't think I am using the template syntax...&amp;nbsp; I noticed in the ESRI Sample that the labels had "$" before them on the map so I took the "$" out of my code.&amp;nbsp; There aren't any errors, but the labels aren't shown either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 15:49:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labels-with-kml-polygons/m-p/235227#M21930</guid>
      <dc:creator>SamuelHenderson</dc:creator>
      <dc:date>2014-09-10T15:49:00Z</dc:date>
    </item>
  </channel>
</rss>

