<?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: new GraphicsLayer(null) fails in 3.9 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/new-graphicslayer-null-fails-in-3-9/m-p/95041#M8670</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's way back &lt;SPAN style="background-color: #ffffff;"&gt;Jérôme but I did dig up some old code (see attached).&amp;nbsp; I don't think this is in use in any of our applications anymore so I'm not sure of its viability.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Also, since v4 was a complete rewrite from v3 I'm not sure how applicable it is to your problem - but here it is anyway, hope it helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Tom&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Apr 2019 16:04:27 GMT</pubDate>
    <dc:creator>TomTyndall1</dc:creator>
    <dc:date>2019-04-15T16:04:27Z</dc:date>
    <item>
      <title>new GraphicsLayer(null) fails in 3.9</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/new-graphicslayer-null-fails-in-3-9/m-p/95036#M8665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When running this code in 3.9:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
var l = new GraphicsLayer(null)
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In 3.9 you get this error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
TypeError {stack: "TypeError: Cannot read property 'plugins' of undef???esolve (http://js.arcgis.com/3.9/init.js:197:441)", message: "Cannot read property 'plugins' of undefined"}
 "TypeError: Cannot read property 'plugins' of undefined
&amp;nbsp;&amp;nbsp;&amp;nbsp; at http://js.arcgis.com/3.9/init.js:1005:336
&amp;nbsp;&amp;nbsp;&amp;nbsp; at Object.some (http://js.arcgis.com/3.9/init.js:224:133)
&amp;nbsp;&amp;nbsp;&amp;nbsp; at g._pluginsHandler (http://js.arcgis.com/3.9/init.js:1005:305)
&amp;nbsp;&amp;nbsp;&amp;nbsp; at h.(anonymous function).g (http://js.arcgis.com/3.9/init.js:239:390)
&amp;nbsp;&amp;nbsp;&amp;nbsp; at new &amp;lt;anonymous&amp;gt; (http://js.arcgis.com/3.9/init.js:105:288)
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In 3.8 this worked just fine. Solving this is easy of course (don't pass null to the GraphicsLayer).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Apr 2014 06:54:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/new-graphicslayer-null-fails-in-3-9/m-p/95036#M8665</guid>
      <dc:creator>ThomasCoopman</dc:creator>
      <dc:date>2014-04-10T06:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: new GraphicsLayer(null) fails in 3.9</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/new-graphicslayer-null-fails-in-3-9/m-p/95037#M8666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the feedback!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;According to the documentation, GraphicsLayer accepts an object that contains optional parameters. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Although 'null' is an object according to typeof(), there are obviously no properties, but perhaps GraphicsLayer does not account for this particular use-case. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any particular reason you were passing null to GraphicsLayer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Otherwise, like you said, just don't pass null and follow the documentation. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// No optional params example
var graphicsLayer1 = new GraphicsLayer();

// Optional param example; opacity
var graphicsLayer2 = new GraphicsLayer({opacity:0.20});
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:38:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/new-graphicslayer-null-fails-in-3-9/m-p/95037#M8666</guid>
      <dc:creator>JonathanUihlein</dc:creator>
      <dc:date>2021-12-10T23:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: new GraphicsLayer(null) fails in 3.9</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/new-graphicslayer-null-fails-in-3-9/m-p/95038#M8667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Is there any particular reason you were passing null to GraphicsLayer?&lt;BR /&gt;Otherwise, like you said, just don't pass null and follow the documentation. &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No reason, I just validate it now. This was code that worked in 3.8 so this was something that I needed to fix to update.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 06:04:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/new-graphicslayer-null-fails-in-3-9/m-p/95038#M8667</guid>
      <dc:creator>ThomasCoopman</dc:creator>
      <dc:date>2014-04-14T06:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: new GraphicsLayer(null) fails in 3.9</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/new-graphicslayer-null-fails-in-3-9/m-p/95039#M8668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm encountering this issue also. In my code I'm extending esri/layers/GraphicsLayer as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in a file my/GL.js&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;define(["dojo/_base/declare", "esri/layers/GraphicsLayer"], function (declare, esriGL) {
&amp;nbsp;&amp;nbsp; return declare(esriGL, {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constructor: function (options, graphics, symbol) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // graphics &amp;amp; symbol arguments optional
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // if present, do something interesting with them
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; });
});&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;then sometimes my GL gets called like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;require(["my/GL"], function (myGL) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var gl = new myGL({id: "someId"}, null, null);
});&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code runs successfully in 3.8 but fails in 3.9.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I suspect that at @ 3.9 esri/layers/GraphicsLayer is looking for some newly introduced, undocumented 2nd parameter in its constructor (or some other dojo declare lifecycle function), is finding null and throwing a "plugins" error similar to what tcoopman describes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, even when I augment my custom layer with a dojo preamble function, which should result in the null arguments not getting passed along to the superclass's constructor, I still get the error. So I'm not really sure what's going on??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;define(["dojo/_base/declare", "esri/layers/GraphicsLayer"], function (declare, esriGL) {
&amp;nbsp;&amp;nbsp; return declare(esriGL, {

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; preamble: function (options, graphics, symbol) { return [options]; },

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constructor: function (options, graphics, symbol) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // graphics &amp;amp; symbol arguments optional
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // if present, do something interesting with them
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; });
});&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Az Dept. of Transportation&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:38:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/new-graphicslayer-null-fails-in-3-9/m-p/95039#M8668</guid>
      <dc:creator>TomTyndall</dc:creator>
      <dc:date>2021-12-10T23:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: new GraphicsLayer(null) fails in 3.9</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/new-graphicslayer-null-fails-in-3-9/m-p/95040#M8669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you find something to solve your problem ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Arcgis 4.x&amp;nbsp; when I try to inherit of GraphicsLayer I receive :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Uncaught TypeError: Cannot read property 'properties' of undefined&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jérôme.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2019 10:55:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/new-graphicslayer-null-fails-in-3-9/m-p/95040#M8669</guid>
      <dc:creator>JérômeDuckers</dc:creator>
      <dc:date>2019-04-12T10:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: new GraphicsLayer(null) fails in 3.9</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/new-graphicslayer-null-fails-in-3-9/m-p/95041#M8670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's way back &lt;SPAN style="background-color: #ffffff;"&gt;Jérôme but I did dig up some old code (see attached).&amp;nbsp; I don't think this is in use in any of our applications anymore so I'm not sure of its viability.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Also, since v4 was a complete rewrite from v3 I'm not sure how applicable it is to your problem - but here it is anyway, hope it helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Tom&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Apr 2019 16:04:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/new-graphicslayer-null-fails-in-3-9/m-p/95041#M8670</guid>
      <dc:creator>TomTyndall1</dc:creator>
      <dc:date>2019-04-15T16:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: new GraphicsLayer(null) fails in 3.9</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/new-graphicslayer-null-fails-in-3-9/m-p/95042#M8671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, I rewrite my code in TypeScript.&lt;/P&gt;&lt;P&gt;The inheritance is easier to implement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regard,&lt;/P&gt;&lt;P&gt;Jérôme.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Apr 2019 20:44:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/new-graphicslayer-null-fails-in-3-9/m-p/95042#M8671</guid>
      <dc:creator>JérômeDuckers</dc:creator>
      <dc:date>2019-04-17T20:44:21Z</dc:date>
    </item>
  </channel>
</rss>

