<?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: Legacy code vs AMD code in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571597#M53320</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi GIS folks,&lt;BR /&gt;I am really confused with the legacy code vs AMD code. Although, I switched to AMD style of coding&amp;nbsp; in my application and some of the sample/example codes in the ARCGIS javascript api are still in legacy code, because of which I am struggling to run my application as most of the time i end up getting errors. can anyone recommend which style of coding should we follow with v3.6 api.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Ganesh&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AMD.&amp;nbsp; legacy is deprecated at dojo 2.&amp;nbsp; we are rapidly approaching that.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Aug 2013 13:37:21 GMT</pubDate>
    <dc:creator>JeffPace</dc:creator>
    <dc:date>2013-08-29T13:37:21Z</dc:date>
    <item>
      <title>Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571596#M53319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi GIS folks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am really confused with the legacy code vs AMD code. Although, I switched to AMD style of coding&amp;nbsp; in my application and some of the sample/example codes in the ARCGIS javascript api are still in legacy code, because of which I am struggling to run my application as most of the time i end up getting errors. can anyone recommend which style of coding should we follow with v3.6 api.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ganesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 13:24:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571596#M53319</guid>
      <dc:creator>GaneshSolai_Sambandam</dc:creator>
      <dc:date>2013-08-29T13:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571597#M53320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi GIS folks,&lt;BR /&gt;I am really confused with the legacy code vs AMD code. Although, I switched to AMD style of coding&amp;nbsp; in my application and some of the sample/example codes in the ARCGIS javascript api are still in legacy code, because of which I am struggling to run my application as most of the time i end up getting errors. can anyone recommend which style of coding should we follow with v3.6 api.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Ganesh&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AMD.&amp;nbsp; legacy is deprecated at dojo 2.&amp;nbsp; we are rapidly approaching that.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 13:37:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571597#M53320</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2013-08-29T13:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571598#M53321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I started one of my major projects using AMD, and I would highly recommend to use AMD if using v3.6 api with the following reasons.&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;With AMD style which will load the modules asynchronously, the initial loading performance will be greatly increased.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;All JSAPI events are following dojo/on event mechanism now.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;AMD will be enforced since dojo 2.0. Dojo is reaching v1.9 now, one more release away from 2.0!&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;The issue that your module may not work since one of the dependecies is not loaded won't exist if using AMD.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Minimize global variable usage.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;and much more...&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;I can tell ESRI JSAPI team is working hard to make the conversion including the samples. There are some work for the improvement though for the JSAPI team especially on the documentation. I found out that when clicking any event handler (onLayerAddResult) link on AMD style, it won't work. I will have to switch to legacy event style to access the description.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here are some references:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jshelp/inside_dojo_amd.html"&gt;https://developers.arcgis.com/en/javascript/jshelp/inside_dojo_amd.html&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://dojotoolkit.org/documentation/tutorials/1.9/modules/"&gt;http://dojotoolkit.org/documentation/tutorials/1.9/modules/&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://addyosmani.com/writing-modular-js/"&gt;http://addyosmani.com/writing-modular-js/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 13:44:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571598#M53321</guid>
      <dc:creator>JasonZou</dc:creator>
      <dc:date>2013-08-29T13:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571599#M53322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Once you know what AMD is and how it works, you'll fall in love with it.:)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here are a few tutorials that can help you grasp it in a short time:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://dojotoolkit.org/documentation/tutorials/1.9/modern_dojo/"&gt;http://dojotoolkit.org/documentation/tutorials/1.9/modern_dojo/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://dojotoolkit.org/documentation/tutorials/1.9/declare/"&gt;http://dojotoolkit.org/documentation/tutorials/1.9/declare/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://dojotoolkit.org/documentation/tutorials/1.9/modules/"&gt;http://dojotoolkit.org/documentation/tutorials/1.9/modules/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://dojotoolkit.org/documentation/tutorials/1.9/modules_advanced/"&gt;&lt;BR /&gt;http://dojotoolkit.org/documentation/tutorials/1.9/modules_advanced/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 13:48:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571599#M53322</guid>
      <dc:creator>ZachLiu1</dc:creator>
      <dc:date>2013-08-29T13:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571600#M53323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I agree this is going to be a bumpy transition.&amp;nbsp; I have several projects written a couple years ago, it's not like I have the time to go back and rewrite everything I've done in the past.&amp;nbsp;&amp;nbsp; I think there should be samples in both styles, so we can see the before and after and get the hang of the differences .&amp;nbsp; That API reference is good about showing both, but the samples are a mixed bag.&amp;nbsp; I'd hate to see every sample move to AMD because I need to see both to know where and how to change my older code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 13:51:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571600#M53323</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2013-08-29T13:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571601#M53324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I agree this is going to be a bumpy transition.&amp;nbsp; I have several projects written a couple years ago, it's not like I have the time to go back and rewrite everything I've done in the past.&amp;nbsp;&amp;nbsp; I think there should be samples in both styles, so we can see the before and after and get the hang of the differences .&amp;nbsp; That API reference is good about showing both, but the samples are a mixed bag.&amp;nbsp; I'd hate to see every sample move to AMD because I need to see both to know where and how to change my older code.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is one reason why I wish the Esri would keep the older versions of the samples and documentation on their website, similar to what Dojo does. With Dojo's documentation, you can select which version to see. However, when Esri redesigned their website, there doesn't seem to be a way of seeing the older versions (3.6 vs. 3.5 vs 3.4) of the help pages. It's kind of a pain to download the older SDKs and pick through the html files&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 17:04:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571601#M53324</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2013-08-29T17:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571602#M53325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I like to echo Ken. It's not only the samples need to have both versions, but to provide a way to access all released API as well. Lots of projects were developed under old versions, and when something goes wrong, there is no way to look at the API under which the project was developed. Many organizations aren't willing to take the effort to upgrade to the most recent version as long as the project still works.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 17:17:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571602#M53325</guid>
      <dc:creator>JasonZou</dc:creator>
      <dc:date>2013-08-29T17:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571603#M53326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok - with my major JSAPI project about to be fully live I thought I'd try to get my head around AMD, but failed, almost at the start.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example the link &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/argument_aliases-amd.html" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/en/javascript/jsapi/argument_aliases-amd.html&lt;/A&gt;&lt;SPAN&gt; on this page &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jstutorials/" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/en/javascript/jstutorials/&lt;/A&gt;&lt;SPAN&gt; 404s , so I am strugling to work out what exactly the function inside the require is for&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #000088; font-family: monospace;"&gt;&amp;lt;script&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="color:#000000;"&gt;&amp;nbsp; require&lt;/SPAN&gt;&lt;SPAN style="color:#666600;"&gt;([&lt;/SPAN&gt;&lt;SPAN style="color:#999999;"&gt;"esri/map"&lt;/SPAN&gt;&lt;SPAN style="color:#666600;"&gt;],&lt;/SPAN&gt;&lt;SPAN style="color:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color:#000088;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="color:#666600;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color:#000000;"&gt;Map&lt;/SPAN&gt;&lt;SPAN style="color:#666600;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color:#666600;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color:#666600;"&gt;...&lt;/SPAN&gt;&lt;SPAN style="color:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color:#666600;"&gt;});&lt;/SPAN&gt;&lt;SPAN style="color:#000000;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #000088; font-family: monospace;"&gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For a simple map it seems only to define the map, but WTF is this all about?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #000088; font-family: monospace;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="color: #666600; font-family: monospace;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt;dom&lt;/SPAN&gt;&lt;SPAN style="color: #666600; font-family: monospace;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt; domAttr&lt;/SPAN&gt;&lt;SPAN style="color: #666600; font-family: monospace;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt; array&lt;/SPAN&gt;&lt;SPAN style="color: #666600; font-family: monospace;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt;Color&lt;/SPAN&gt;&lt;SPAN style="color: #666600; font-family: monospace;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt; parser&lt;/SPAN&gt;&lt;SPAN style="color: #666600; font-family: monospace;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt; esriConfig&lt;/SPAN&gt;&lt;SPAN style="color: #666600; font-family: monospace;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt;Map&lt;/SPAN&gt;&lt;SPAN style="color: #666600; font-family: monospace;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt;Graphic&lt;/SPAN&gt;&lt;SPAN style="color: #666600; font-family: monospace;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt;GeometryService&lt;/SPAN&gt;&lt;SPAN style="color: #666600; font-family: monospace;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt;BufferParameters&lt;/SPAN&gt;&lt;SPAN style="color: #666600; font-family: monospace;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt;Draw&lt;/SPAN&gt;&lt;SPAN style="color: #666600; font-family: monospace;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt;SimpleMarkerSymbol&lt;/SPAN&gt;&lt;SPAN style="color: #666600; font-family: monospace;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt;SimpleLineSymbol&lt;/SPAN&gt;&lt;SPAN style="color: #666600; font-family: monospace;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: monospace;"&gt;SimpleFillSymbol&lt;/SPAN&gt;&lt;SPAN style="color: #666600; font-family: monospace;"&gt;)
&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I'm giving up for now, and my code will be a horrid mix for a while.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I may return later when there are better guides&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ACM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:36:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571603#M53326</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2021-12-12T00:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571604#M53327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;first of all, require is just a function.:)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It takes two args. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The first one is an array of all modules you needed for your project. For a Ags API app, it usually includes Dojo modules and ESRI modules. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The second argument is a function whose arguments pair with the modules you required. All arguments in this function (may be a long list) are just references to your loaded modules and you can give whatever names you want, but usually it's a good idea to follow conventions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It will be better to read this first.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://dojotoolkit.org/documentation/tutorials/1.9/modern_dojo/"&gt;&lt;BR /&gt;http://dojotoolkit.org/documentation/tutorials/1.9/modern_dojo/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Aug 2013 13:58:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571604#M53327</guid>
      <dc:creator>ZachLiu1</dc:creator>
      <dc:date>2013-08-30T13:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571605#M53328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks - that helps a bit- amazingly just having just the modules required and a minimal second arg it still allworks - I guess the rest still being old style just picks up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea where the link should go to to show "&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/argument_aliases-amd.html"&gt;preferred argument aliases for Esri modules&lt;/A&gt;&lt;SPAN&gt;" which I guess is the list I add to the second arg for all the modules I am referencing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ACM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Aug 2013 14:01:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571605#M53328</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2013-08-30T14:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571606#M53329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you don't provide args for second function, you are still using dojo modules loaded in traditional way, which exist in the global scope.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The require function creates a local scope, so you can not get access to the modules outside of the require function. The major benefit is your global object is clean.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you can write &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;require(["esri.map"], function(Map) { 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var map = new Map();
});&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you can still write &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;require(["esri.map"], function(Map) { 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var map = new esri.map();
});&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But they work in different ways.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually, if you don't load ArcGIS API which automatically load many modules in the old way I guess, the second one won't work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:36:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571606#M53329</guid>
      <dc:creator>ZachLiu1</dc:creator>
      <dc:date>2021-12-12T00:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571607#M53330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; Er, sorry for sounding silly, but aren't those two code blocks identical?&amp;nbsp; I think I know what you mean.&amp;nbsp; Ah I see it now, the Upper case M in the first one and no 'esri'.&amp;nbsp; Doh! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, it's Friday afternoon where I am, it is sunny and will remain so for the weekend, so I'm off home!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Aug 2013 14:25:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571607#M53330</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2013-08-30T14:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571608#M53331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not to pimp, but I'll pimp a little, you can view a presentation I did at the last dev summit on AMD.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://video.esri.com/watch/2318/embrace-your-modules-on-amd-and-javascript"&gt;http://video.esri.com/watch/2318/embrace-your-modules-on-amd-and-javascript&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There was another good talk about building modular dijits, but doesn't look like it's available.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The transition to AMD from the (ArcGIS JS) pre-3.0 days can be a little bumpy, and it may not be perfect, but it works pretty well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am however of the opinion that when you have a dependency array like&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;function(dom, domAttr, array,Color, parser, esriConfig,Map,Graphic,GeometryService,BufferParameters,Draw,SimpleMarkerSymbol,SimpleLineSymbol,SimpleFillSymbol)&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;It's a good sign you could use a refactor of some sort.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Aug 2013 15:51:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571608#M53331</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2013-08-30T15:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571609#M53332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&amp;lt;lightbulb&amp;gt;&amp;nbsp; (well, low energy, dimmer light bulb, that has occasional brown-outs)&amp;nbsp; I'm sort of seeing it now.&amp;nbsp; Gives me an excuse to totally re-structure my code as I move each bit over from my main init function&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2013 12:33:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571609#M53332</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2013-09-02T12:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571610#M53333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I, too, am struggling to convert older code to AMD, and echo many of the earlier posts in this thread, especially requesting that Esri show examples in &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;both &lt;/SPAN&gt;&lt;SPAN&gt;legacy &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;and &lt;/SPAN&gt;&lt;SPAN&gt;AMD format to help us with the transition.&amp;nbsp; My particular question is why all of the examples involving dynamic map service layers are still in legacy code.&amp;nbsp; Is there some move to separate dynamic map services from tiled and feature services?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2013 19:03:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571610#M53333</guid>
      <dc:creator>CharlesGeiger</dc:creator>
      <dc:date>2013-09-02T19:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571611#M53334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK - slowly making progress, but I am hitting (what I think) are scope issues.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am creating an overview map.&amp;nbsp; I have the require and attribute all done -&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;require(["esri/map", "esri/layers/ArcGISTiledMapServiceLayer",
 "esri/layers/ArcGISDynamicMapServiceLayer",
"esri/geometry/Extent",
"esri/layers/FeatureLayer",
"agsjs/dijit/TOC",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/SimpleLineSymbol",
 "dojo/_base/Color",
 "esri/dijit/OverviewMap",
 "dojo/parser",
"dojo/domReady!"
], function (
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Map,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArcGISTiledMapServiceLayer,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArcGISDynamicMapServiceLayer,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Extent,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FeatureLayer,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOC,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SimpleFillSymbol,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SimpleLineSymbol,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Color,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OverviewMap,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parser
&amp;nbsp;&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;BR /&gt;&lt;SPAN&gt;then I create the ovmap&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; var overviewMapDijit = new OverviewMap({&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map: map,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expandFactor: 2,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visible: true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: 230,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 230
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but get &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Uncaught TypeError: Cannot read property 'wkid' of undefined &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As if the map doesn't exist - I have a "var map;" earlier of course - what I have, is, more or less the same as &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jssamples/widget_overviewmap.html" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/en/javascript/jssamples/widget_overviewmap.html&lt;BR /&gt;&lt;BR /&gt;c&lt;/A&gt;&lt;SPAN&gt;heers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ACM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:36:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571611#M53334</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2021-12-12T00:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571612#M53335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;have you added layers to your map before creating the overview?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Sep 2013 12:52:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571612#M53335</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2013-09-03T12:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571613#M53336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yep - Hjelmeland has been PMing me with lots of suggestions -&amp;nbsp; on the last go we took working code of his and dropped my map service in.&amp;nbsp; It worked on his code.&amp;nbsp; The only difference I can see is if I examine the map object, on the working code we have&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;spatialReference: Object
latestWkid: 27700
wkid: 27700
__proto__: Object
updating: false
width: 1680
wrapAround180: fal&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On mine&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;spatialReference: Objectwkid: 27700
__proto__: Object
updating: false
width: 1435
wrapAround180: false


&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for the SpatialReference object - you'll notice the additional "latestWkid" attribute.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ACM&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit nearly there - my code was a horrid mix of legacy and AMD, and I had a new AMD style chunk basically doing the same stuff I'd inserted ages back.&amp;nbsp; Removing this gives me an overview map (breaks loads of other stuff until I reinsert it al in the right place)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit #2 No idea - a brief glimpse was lost again &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; will still work on it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:36:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571613#M53336</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2021-12-12T00:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571614#M53337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I gave it a good try, but for now defeated.&amp;nbsp; I worked out my wkid issue was something to do with my local 3.5 - running it with esr 3.6 moved on to the next errors - a shed load of parser issues.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I will put this aside for now, and concentrate on stuff my users are asking for - like a constrained Floatingpane &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the help so far - at least I have a better understanding.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ACM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2013 12:18:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571614#M53337</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2013-09-04T12:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Legacy code vs AMD code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571615#M53338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;we published a blog post the other day comparing an identical sample written in AMD and legacy patterns.&amp;nbsp; hope its helpful!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;abc's of AMD&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2013/10/14/the-abcs-of-amd/"&gt;http://blogs.esri.com/esri/arcgis/2013/10/14/the-abcs-of-amd/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 14:14:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legacy-code-vs-amd-code/m-p/571615#M53338</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2013-10-15T14:14:39Z</dc:date>
    </item>
  </channel>
</rss>

