<?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: Layer order in a legend in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-order-in-a-legend/m-p/312628#M28771</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;this is a sample code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;......&lt;BR /&gt; //add the legend&lt;BR /&gt; map.on("layers-add-result", function (evt) {&lt;BR /&gt; var layerInfoLines = [];&lt;BR /&gt; arrayUtils.map(evt.layers, function (layer, index) {&lt;BR /&gt; if (layer.layer.geometryType === "esriGeometryPolyline"){&lt;BR /&gt; layerInfoLines.push({layer:layer.layer, title:layer.layer.name});&lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt; var layerInfoPolygons = [];&lt;BR /&gt; arrayUtils.map(evt.layers, function (layer, index) {&lt;BR /&gt; if (layer.layer.geometryType === "esriGeometryPolygon"){&lt;BR /&gt; layerInfoPolygons.push({layer:layer.layer, title:layer.layer.name});&lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt; var layerInfo = layerInfoPolygons.concat(layerInfoLines);&lt;BR /&gt; &lt;BR /&gt; if (layerInfo.length &amp;gt; 0) {&lt;BR /&gt; var legendDijit = new Legend({&lt;BR /&gt; map: map,&lt;BR /&gt; layerInfos: layerInfo&lt;BR /&gt; }, "legendDiv");&lt;BR /&gt; legendDijit.startup();&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and here see a live sample&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://jsfiddle.net/ew8VY/11/" title="http://jsfiddle.net/ew8VY/11/"&gt;Edit fiddle - JSFiddle&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Nov 2016 08:52:24 GMT</pubDate>
    <dc:creator>PanagiotisPapadopoulos</dc:creator>
    <dc:date>2016-11-23T08:52:24Z</dc:date>
    <item>
      <title>Layer order in a legend</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-order-in-a-legend/m-p/312626#M28769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;There is no order by geometry type in a legend created with a legend widget.&lt;/P&gt;&lt;P&gt;How &amp;nbsp;layers can be ordered? Generally, we need to implement the rule:&lt;/P&gt;&lt;P&gt;- points&lt;/P&gt;&lt;P&gt;- lines&lt;/P&gt;&lt;P&gt;- polygons&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bottom - polygons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 06:31:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-order-in-a-legend/m-p/312626#M28769</guid>
      <dc:creator>PitersonPaulgek</dc:creator>
      <dc:date>2016-11-23T06:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Layer order in a legend</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-order-in-a-legend/m-p/312627#M28770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the property define the layer order on Legend Widget according to the Javascript Help is the&lt;STRONG&gt; LayerInfos&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;see below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE style="color: #4d4d4d; background-color: #fafafa; border-width: 1px 1px 0px; border-style: solid; border-color: #d9d9d9; font-size: 14px; margin: 0.1em 0px 0.3em;"&gt;&lt;TBODY&gt;&lt;TR style="border-bottom: 1px solid #ededed;"&gt;&lt;TD class="" style="background-color: #ffffff; border-width: 0px 0px 1px; border-style: solid; border-color: #d9d9d9; padding: 4px 1px 4px 5px;"&gt;&amp;lt;&lt;CODE style="background: transparent;"&gt;&lt;SPAN class=""&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" style="color: #00629b;"&gt;Object[]&lt;/A&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&amp;gt; layerInfos&lt;/TD&gt;&lt;TD class="" style="background-color: #ffffff; border-width: 0px 0px 1px; border-style: solid; border-color: #d9d9d9; padding: 4px 1px 4px 5px;"&gt;Optional&lt;/TD&gt;&lt;TD class="" style="background-color: #ffffff; border-width: 0px 0px 1px; border-style: solid; border-color: #d9d9d9; padding: 4px 1px 4px 5px;"&gt;Specify a subset of the layers in the map to display in the legend. If not set, all layers in the map will display in the legend.&lt;EM&gt;&lt;STRONG&gt; The order of the layers in the legend depends on the layerInfo array&lt;/STRONG&gt;&lt;/EM&gt;. See the &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/legend-amd.html#layerinfos" style="color: #00629b;"&gt;&lt;CODE style="background: transparent;"&gt;layerInfos&lt;/CODE&gt;&lt;/A&gt; property description for a description of its object properties.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So during the layer load on the map change the layer order.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 08:26:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-order-in-a-legend/m-p/312627#M28770</guid>
      <dc:creator>PanagiotisPapadopoulos</dc:creator>
      <dc:date>2016-11-23T08:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Layer order in a legend</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-order-in-a-legend/m-p/312628#M28771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;this is a sample code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;......&lt;BR /&gt; //add the legend&lt;BR /&gt; map.on("layers-add-result", function (evt) {&lt;BR /&gt; var layerInfoLines = [];&lt;BR /&gt; arrayUtils.map(evt.layers, function (layer, index) {&lt;BR /&gt; if (layer.layer.geometryType === "esriGeometryPolyline"){&lt;BR /&gt; layerInfoLines.push({layer:layer.layer, title:layer.layer.name});&lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt; var layerInfoPolygons = [];&lt;BR /&gt; arrayUtils.map(evt.layers, function (layer, index) {&lt;BR /&gt; if (layer.layer.geometryType === "esriGeometryPolygon"){&lt;BR /&gt; layerInfoPolygons.push({layer:layer.layer, title:layer.layer.name});&lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt; var layerInfo = layerInfoPolygons.concat(layerInfoLines);&lt;BR /&gt; &lt;BR /&gt; if (layerInfo.length &amp;gt; 0) {&lt;BR /&gt; var legendDijit = new Legend({&lt;BR /&gt; map: map,&lt;BR /&gt; layerInfos: layerInfo&lt;BR /&gt; }, "legendDiv");&lt;BR /&gt; legendDijit.startup();&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and here see a live sample&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://jsfiddle.net/ew8VY/11/" title="http://jsfiddle.net/ew8VY/11/"&gt;Edit fiddle - JSFiddle&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 08:52:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-order-in-a-legend/m-p/312628#M28771</guid>
      <dc:creator>PanagiotisPapadopoulos</dc:creator>
      <dc:date>2016-11-23T08:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Layer order in a legend</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-order-in-a-legend/m-p/312629#M28772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for response,&amp;nbsp;Panagiotis Papadopoulos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, we have no geometry type when working with&amp;nbsp;ArcGISDynamicMapServiceLayer.&lt;/P&gt;&lt;P&gt;So, how we obtain that&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;geometryType?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Nov 2016 00:21:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-order-in-a-legend/m-p/312629#M28772</guid>
      <dc:creator>PitersonPaulgek</dc:creator>
      <dc:date>2016-11-25T00:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Layer order in a legend</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-order-in-a-legend/m-p/312630#M28773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See this discussion: &lt;A href="https://community.esri.com/message/80485"&gt;https://community.esri.com/message/80485&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Nov 2016 14:15:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-order-in-a-legend/m-p/312630#M28773</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2016-11-25T14:15:54Z</dc:date>
    </item>
  </channel>
</rss>

