<?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: Add multiple graphic layers to map without for loop iteration in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473130#M43866</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;try this code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;BR /&gt;&amp;lt;html&amp;gt;&lt;BR /&gt; &amp;lt;head&amp;gt;&lt;BR /&gt; &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;&lt;BR /&gt; &amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/&amp;gt;&lt;BR /&gt; &amp;lt;title&amp;gt;Simple Map&amp;lt;/title&amp;gt;&lt;BR /&gt;&lt;SPAN&gt; &amp;lt;link rel="stylesheet" href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fjs.arcgis.com%2F3.20%2Fesri%2Fcss%2Fesri.css" rel="nofollow" target="_blank"&gt;https://js.arcgis.com/3.20/esri/css/esri.css&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &amp;lt;style&amp;gt;&lt;BR /&gt; html, body, #map {&lt;BR /&gt; height: 100%;&lt;BR /&gt; margin: 0;&lt;BR /&gt; padding: 0;&lt;BR /&gt; }&lt;BR /&gt; &amp;lt;/style&amp;gt;&lt;BR /&gt;&lt;SPAN&gt; &amp;lt;script src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fjs.arcgis.com%2F3.20%2F" rel="nofollow" target="_blank"&gt;https://js.arcgis.com/3.20/&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &amp;lt;script&amp;gt;&lt;BR /&gt; var map;&lt;BR /&gt; &lt;BR /&gt; require(["dojo/dom",&lt;BR /&gt; "dojo/dom-attr",&lt;BR /&gt; "dojo/_base/array",&lt;BR /&gt; "esri/Color",&lt;BR /&gt; "dojo/number",&lt;BR /&gt; "dojo/parser",&lt;BR /&gt; "dijit/registry",&lt;/P&gt;&lt;P&gt;"esri/config","esri/map", "esri/geometry/Point","esri/layers/GraphicsLayer","esri/symbols/TextSymbol","esri/graphic","esri/SpatialReference","esri/Color", "esri/symbols/Font", "dojo/parser","dojo/domReady!"], &lt;BR /&gt; function(dom, domAttr, array, Color, number, parser, registry, esriConfig,Map,Point,GraphicsLayer,TextSymbol,Graphic,SpatialReference,Color,Font) {&lt;BR /&gt; parser.parse();&lt;BR /&gt; map = new Map("map", {&lt;BR /&gt;&lt;SPAN&gt; basemap: "gray", //For full list of pre-defined basemaps, navigate to &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Farcg.is%2F1JVo6Wd" rel="nofollow" target="_blank"&gt;http://arcg.is/1JVo6Wd&lt;/A&gt;&lt;BR /&gt; center: [23, 39], // longitude, latitude&lt;BR /&gt; zoom: 6&lt;BR /&gt; });&lt;BR /&gt; map.on("load", initOperationalLayer);&lt;BR /&gt; &lt;BR /&gt; function initOperationalLayer(){ &lt;BR /&gt; var cLayer = new GraphicsLayer();&lt;BR /&gt; map.addLayer(cLayer);&lt;BR /&gt; &lt;BR /&gt; for(var i=0; i &amp;lt;= 1000;i++)&lt;BR /&gt; {&lt;BR /&gt;&lt;BR /&gt; var font = new Font("22px", Font.STYLE_NORMAL, Font.VARIANT_NORMAL, Font.WEIGHT_BOLDER);&lt;BR /&gt; var textSymbol = new TextSymbol("n"+i,font, new Color([0, 0, 0]));&lt;BR /&gt; var lon=23+(i/100);&lt;BR /&gt; var lat=39+(i/100);&lt;BR /&gt; var graphic = new Graphic(new Point(lon,lat, new SpatialReference({wkid: 4326})), textSymbol);&lt;/P&gt;&lt;P&gt;cLayer.add(graphic);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;BR /&gt; });&lt;BR /&gt; &amp;lt;/script&amp;gt;&lt;BR /&gt; &amp;lt;/head&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;body&amp;gt;&lt;BR /&gt; &amp;lt;div id="map"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/body&amp;gt;&lt;BR /&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Jun 2017 08:58:43 GMT</pubDate>
    <dc:creator>PanagiotisPapadopoulos</dc:creator>
    <dc:date>2017-06-20T08:58:43Z</dc:date>
    <item>
      <title>Add multiple graphic layers to map without for loop iteration</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473125#M43861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Labelarray is having graphic layer. This is taking very long time for execution when more than 100 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for ( var j = 0; j &amp;lt; labelArray.length; j++) { &lt;BR /&gt; map.addLayer(labelArray&lt;J&gt;);&lt;BR /&gt; }&lt;/J&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jun 2017 09:15:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473125#M43861</guid>
      <dc:creator>vanarajranjit</dc:creator>
      <dc:date>2017-06-19T09:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Add multiple graphic layers to map without for loop iteration</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473126#M43862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can simply use &lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;addLayers&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;labelArray&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jun 2017 12:47:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473126#M43862</guid>
      <dc:creator>thejuskambi</dc:creator>
      <dc:date>2017-06-19T12:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Add multiple graphic layers to map without for loop iteration</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473127#M43863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am getting performance issue on this , in array morethan 1000 records means it takes 10 min for execution and displaying in map and while execution the browser also hangs. I need a better solution for this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2017 04:56:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473127#M43863</guid>
      <dc:creator>vanarajranjit</dc:creator>
      <dc:date>2017-06-20T04:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Add multiple graphic layers to map without for loop iteration</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473128#M43864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What kind of graphics you have? geometry type?&lt;/P&gt;&lt;P&gt;from where those graphics are coming? example query on a service and draw the results.....?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2017 07:01:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473128#M43864</guid>
      <dc:creator>PanagiotisPapadopoulos</dc:creator>
      <dc:date>2017-06-20T07:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Add multiple graphic layers to map without for loop iteration</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473129#M43865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The below example explains first i am creating textsymbol property, setting text (number),using graphic setting the text label.Then add that graphic to graphic layer. graphic layer are pushing into array list&lt;/P&gt;&lt;P&gt;for(var i=0; i &amp;lt;= mappoint.length;i++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;var &lt;SPAN&gt;Textsymbol&lt;/SPAN&gt;= new TextSymbol();&lt;BR /&gt;&lt;SPAN&gt;Textsymbol&lt;/SPAN&gt;.setAlign(TextSymbol.ALIGN_MIDDLE);&lt;BR /&gt;&lt;SPAN&gt;Textsymbol&lt;/SPAN&gt;.setOffset(0, 13);&lt;BR /&gt;&lt;SPAN&gt;Textsymbol&lt;/SPAN&gt;.setText(number);&lt;/P&gt;&lt;P&gt;var graphic&amp;nbsp;= new Graphic(new Point(parseFloat(lat),&lt;BR /&gt; parseFloat(lat), wgs), Textsymbol);&lt;BR /&gt; var cLayer = new GraphicsLayer();&lt;BR /&gt;&lt;SPAN&gt;cLayer &lt;/SPAN&gt;.add(&lt;SPAN&gt;graphic&lt;/SPAN&gt;);&lt;BR /&gt;&lt;SPAN&gt;cLayer &lt;/SPAN&gt;.setMaxScale(0);&lt;BR /&gt;&lt;SPAN&gt;cLayer &lt;/SPAN&gt;.setMinScale(288895.277144);&lt;/P&gt;&lt;P&gt;labelArray.push(&lt;SPAN&gt;cLayer &lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;then adding the label array to map using map.addlayers(&lt;SPAN&gt;labelArray&lt;/SPAN&gt;) here i am getting performance issue.for adding into map it takes so long time for execution and displaying into map. If i used for loop iteration for &lt;SPAN&gt;map.addlayer(&lt;/SPAN&gt;&lt;SPAN&gt;labelArray&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&amp;nbsp;also taking same time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2017 07:13:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473129#M43865</guid>
      <dc:creator>vanarajranjit</dc:creator>
      <dc:date>2017-06-20T07:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Add multiple graphic layers to map without for loop iteration</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473130#M43866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;try this code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;BR /&gt;&amp;lt;html&amp;gt;&lt;BR /&gt; &amp;lt;head&amp;gt;&lt;BR /&gt; &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;&lt;BR /&gt; &amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/&amp;gt;&lt;BR /&gt; &amp;lt;title&amp;gt;Simple Map&amp;lt;/title&amp;gt;&lt;BR /&gt;&lt;SPAN&gt; &amp;lt;link rel="stylesheet" href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fjs.arcgis.com%2F3.20%2Fesri%2Fcss%2Fesri.css" rel="nofollow" target="_blank"&gt;https://js.arcgis.com/3.20/esri/css/esri.css&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &amp;lt;style&amp;gt;&lt;BR /&gt; html, body, #map {&lt;BR /&gt; height: 100%;&lt;BR /&gt; margin: 0;&lt;BR /&gt; padding: 0;&lt;BR /&gt; }&lt;BR /&gt; &amp;lt;/style&amp;gt;&lt;BR /&gt;&lt;SPAN&gt; &amp;lt;script src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fjs.arcgis.com%2F3.20%2F" rel="nofollow" target="_blank"&gt;https://js.arcgis.com/3.20/&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &amp;lt;script&amp;gt;&lt;BR /&gt; var map;&lt;BR /&gt; &lt;BR /&gt; require(["dojo/dom",&lt;BR /&gt; "dojo/dom-attr",&lt;BR /&gt; "dojo/_base/array",&lt;BR /&gt; "esri/Color",&lt;BR /&gt; "dojo/number",&lt;BR /&gt; "dojo/parser",&lt;BR /&gt; "dijit/registry",&lt;/P&gt;&lt;P&gt;"esri/config","esri/map", "esri/geometry/Point","esri/layers/GraphicsLayer","esri/symbols/TextSymbol","esri/graphic","esri/SpatialReference","esri/Color", "esri/symbols/Font", "dojo/parser","dojo/domReady!"], &lt;BR /&gt; function(dom, domAttr, array, Color, number, parser, registry, esriConfig,Map,Point,GraphicsLayer,TextSymbol,Graphic,SpatialReference,Color,Font) {&lt;BR /&gt; parser.parse();&lt;BR /&gt; map = new Map("map", {&lt;BR /&gt;&lt;SPAN&gt; basemap: "gray", //For full list of pre-defined basemaps, navigate to &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Farcg.is%2F1JVo6Wd" rel="nofollow" target="_blank"&gt;http://arcg.is/1JVo6Wd&lt;/A&gt;&lt;BR /&gt; center: [23, 39], // longitude, latitude&lt;BR /&gt; zoom: 6&lt;BR /&gt; });&lt;BR /&gt; map.on("load", initOperationalLayer);&lt;BR /&gt; &lt;BR /&gt; function initOperationalLayer(){ &lt;BR /&gt; var cLayer = new GraphicsLayer();&lt;BR /&gt; map.addLayer(cLayer);&lt;BR /&gt; &lt;BR /&gt; for(var i=0; i &amp;lt;= 1000;i++)&lt;BR /&gt; {&lt;BR /&gt;&lt;BR /&gt; var font = new Font("22px", Font.STYLE_NORMAL, Font.VARIANT_NORMAL, Font.WEIGHT_BOLDER);&lt;BR /&gt; var textSymbol = new TextSymbol("n"+i,font, new Color([0, 0, 0]));&lt;BR /&gt; var lon=23+(i/100);&lt;BR /&gt; var lat=39+(i/100);&lt;BR /&gt; var graphic = new Graphic(new Point(lon,lat, new SpatialReference({wkid: 4326})), textSymbol);&lt;/P&gt;&lt;P&gt;cLayer.add(graphic);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;BR /&gt; });&lt;BR /&gt; &amp;lt;/script&amp;gt;&lt;BR /&gt; &amp;lt;/head&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;body&amp;gt;&lt;BR /&gt; &amp;lt;div id="map"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/body&amp;gt;&lt;BR /&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2017 08:58:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473130#M43866</guid>
      <dc:creator>PanagiotisPapadopoulos</dc:creator>
      <dc:date>2017-06-20T08:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Add multiple graphic layers to map without for loop iteration</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473131#M43867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;also see this sample here&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://jsfiddle.net/ew8VY/13/" title="http://jsfiddle.net/ew8VY/13/"&gt;Edit fiddle - JSFiddle&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you will see that there is no problem to draw 1000 text symbols.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2017 09:00:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473131#M43867</guid>
      <dc:creator>PanagiotisPapadopoulos</dc:creator>
      <dc:date>2017-06-20T09:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Add multiple graphic layers to map without for loop iteration</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473132#M43868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is difference between initializing the below graphics layer if outside for loop &amp;amp; inside for loop?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;var cLayer = new GraphicsLayer();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The below clayer to map how it is being reflected before for loop processing ?&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;map.addLayer(cLayer);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2017 11:18:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473132#M43868</guid>
      <dc:creator>vanarajranjit</dc:creator>
      <dc:date>2017-06-20T11:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Add multiple graphic layers to map without for loop iteration</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473133#M43869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why are you creating a GraphicLayer for each graphic/Text label? If you move the Layer part out side the loop you can have one GraphicLayer with multiple graphics. Then you will have only one Layer to add.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;GraphicsLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; i&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; i &lt;SPAN class="operator token"&gt;&amp;lt;=&lt;/SPAN&gt; mappoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;length&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;i&lt;SPAN class="operator token"&gt;++&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; Textsymbol&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;TextSymbol&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Textsymbol&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setAlign&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;TextSymbol&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ALIGN_MIDDLE&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Textsymbol&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setOffset&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;13&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Textsymbol&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setText&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;number&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; graphic &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Graphic&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Point&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;parseFloat&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lat&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token function"&gt;parseFloat&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lat&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; wgs&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Textsymbol&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; cLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;add&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

cLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setMaxScale&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
cLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setMinScale&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;288895.277144&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

labelArray&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;push&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cLayer &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// Or add it directly&amp;nbsp; to map&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:55:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473133#M43869</guid>
      <dc:creator>thejuskambi</dc:creator>
      <dc:date>2021-12-11T20:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Add multiple graphic layers to map without for loop iteration</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473134#M43870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;working with Graphic Layer the common way you are working is to add an empty Graphic Layer on the map and latter add the graphics on it.&lt;/P&gt;&lt;P&gt;you are creating new Graphic Layer in case the graphics you want to store belong on different layer group.&lt;/P&gt;&lt;P&gt;for example you can have a Graphic Layer to store the results from a query, and an another to store the results from a geoprocessing tool.&lt;/P&gt;&lt;P&gt;in your case all &lt;STRONG&gt;textsymbol&lt;/STRONG&gt; graphics belong on the same layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2017 07:50:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-multiple-graphic-layers-to-map-without-for/m-p/473134#M43870</guid>
      <dc:creator>PanagiotisPapadopoulos</dc:creator>
      <dc:date>2017-06-21T07:50:03Z</dc:date>
    </item>
  </channel>
</rss>

