<?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: Require in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/require/m-p/202076#M18713</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The second way (AMD) is the direction that Dojo and Esri's JSAPI are going. The first way (legacy) will eventually be deprecated when Dojo 2.0 is realeased. Take a look at this &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/javascript/jshelp/inside_dojo_amd.html" rel="nofollow" target="_blank"&gt;help page&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Feb 2014 13:27:11 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2014-02-07T13:27:11Z</dc:date>
    <item>
      <title>Require</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/require/m-p/202075#M18712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Looking at examples and seeing two different ways to require dojo.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Whats the difference and which one should I be using?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry for the green question...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;dojo.require("esri.map"); dojo.require("esri.layers.FeatureLayer")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var map; &amp;nbsp; require([ &amp;nbsp;&amp;nbsp;&amp;nbsp; "esri/map", "esri/layers/FeatureLayer" &amp;nbsp; ], function( &amp;nbsp; Map, FeatureLayer &amp;nbsp; ) &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 13:09:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/require/m-p/202075#M18712</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2014-02-07T13:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Require</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/require/m-p/202076#M18713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The second way (AMD) is the direction that Dojo and Esri's JSAPI are going. The first way (legacy) will eventually be deprecated when Dojo 2.0 is realeased. Take a look at this &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/javascript/jshelp/inside_dojo_amd.html" rel="nofollow" target="_blank"&gt;help page&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 13:27:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/require/m-p/202076#M18713</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2014-02-07T13:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Require</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/require/m-p/202077#M18714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you...Cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 13:42:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/require/m-p/202077#M18714</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2014-02-07T13:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Require</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/require/m-p/202078#M18715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm missing something.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Imagine I have another script on the page that needs to call a function inside the require().&amp;nbsp; None of the functions inside require() are visible outside of it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For instance, let's say I already have the point or x,y and simply want to map it.&amp;nbsp; If the code with the xys is outside the require(), how can I get the points mapped?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 19:06:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/require/m-p/202078#M18715</guid>
      <dc:creator>ThomasGagne</dc:creator>
      <dc:date>2014-02-19T19:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Require</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/require/m-p/202079#M18716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You would create separate modules to keep your code modular.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a diagram I have been using to kind of explain how require/define work together a little easier for people.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]31596[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So you could have a module that somehow produces your coordinates, and can return them via a pattern like the &lt;/SPAN&gt;&lt;A href="http://addyosmani.com/resources/essentialjsdesignpatterns/book/#revealingmodulepatternjavascript"&gt;revealing module pattern&lt;/A&gt;&lt;SPAN&gt; in the module.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can then call the module from your the methods inside the require() of your application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Every Dojo app needs at least one require() method, but can have multiple modules using define().&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some good refs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://dojotoolkit.org/documentation/"&gt;http://dojotoolkit.org/documentation/&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 20:15:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/require/m-p/202079#M18716</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2014-02-19T20:15:27Z</dc:date>
    </item>
  </channel>
</rss>

