<?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: Adding Layers Using Javascript in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-layers-using-javascript/m-p/440312#M40579</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is useful to know Kristian.&amp;nbsp; Thank you very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jul 2016 13:36:57 GMT</pubDate>
    <dc:creator>ISP_graynic</dc:creator>
    <dc:date>2016-07-20T13:36:57Z</dc:date>
    <item>
      <title>Adding Layers Using Javascript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-layers-using-javascript/m-p/440310#M40577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Javascript, is there an advantage to adding layers in the constructor of a map using an array vs using map.add()?&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hljs-keyword" style="color: #aa0d91; font-weight: bold; font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14.45px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN class="hljs-keyword" style="color: #aa0d91; font-weight: bold; font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14.45px;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #595959; font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14.45px; background-color: #f8f8f8;"&gt; map = &lt;/SPAN&gt;&lt;SPAN class="hljs-keyword" style="color: #aa0d91; font-weight: bold; font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14.45px;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="color: #595959; font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14.45px; background-color: #f8f8f8;"&gt; &lt;/SPAN&gt;&lt;SPAN class="hljs-built_in" style="color: #5c2699; font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14.45px;"&gt;Map&lt;/SPAN&gt;&lt;SPAN style="color: #595959; font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14.45px; background-color: #f8f8f8;"&gt;({&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #f8f8f8; color: #595959; font-size: 14.45px; font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace;"&gt;layers: [housingLyr] &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #f8f8f8; color: #595959; font-size: 14.45px; font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace;"&gt; });&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #f8f8f8; color: #595959; font-size: 14.45px; font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace;"&gt;map.add(housingLyr);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2016 19:35:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-layers-using-javascript/m-p/440310#M40577</guid>
      <dc:creator>ISP_graynic</dc:creator>
      <dc:date>2016-07-15T19:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Layers Using Javascript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-layers-using-javascript/m-p/440311#M40578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a matter of preference. I feel adding the layers in the constructor is more convenient if you want them added to the map when the view is ready. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, there is an advantage to loading a &lt;STRONG&gt;WebMap&lt;/STRONG&gt; with predefined layers, versus doing everything programmatically with the &lt;STRONG&gt;Map&lt;/STRONG&gt; class. All you have to do is pass the item id of the webmap to the WebMap constructor. This loads all the layers, their renderers, and popups as defined and configured in the WebMap in ArcGIS Online, Portal for ArcGIS, or ArcGIS Desktop. You can save yourself time from writing many extra lines of code doing this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 20:55:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-layers-using-javascript/m-p/440311#M40578</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2016-07-19T20:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Layers Using Javascript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-layers-using-javascript/m-p/440312#M40579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is useful to know Kristian.&amp;nbsp; Thank you very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2016 13:36:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-layers-using-javascript/m-p/440312#M40579</guid>
      <dc:creator>ISP_graynic</dc:creator>
      <dc:date>2016-07-20T13:36:57Z</dc:date>
    </item>
  </channel>
</rss>

