<?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: buffering in JavaScript with app.tb in ArcGIS Server with JavaScript API Questions</title>
    <link>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/buffering-in-javascript-with-app-tb/m-p/716350#M14</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have figured out what is going on .&amp;nbsp; The object defined at the end of the &lt;A href="https://developers.arcgis.com/javascript/jssamples/util_buffergraphic.html" title="https://developers.arcgis.com/javascript/jssamples/util_buffergraphic.html"&gt;Buffer any shape | ArcGIS API for JavaScript&lt;/A&gt; has automatic global scope (a JavaScript term).&amp;nbsp; That means it is known throughout the application (similar to HTML global scope), so inline scripts outside the main script tag have access to the app objects contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The confusion arises because the example at &lt;A href="https://developers.arcgis.com/javascript/jssamples/util_geodesic_buffering.html" title="https://developers.arcgis.com/javascript/jssamples/util_geodesic_buffering.html"&gt;Geodesic buffering | ArcGIS API for JavaScript&lt;/A&gt;&amp;nbsp; declares app as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var app = {}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This gives this variable JavaScript global (not automatic global) scope. This means that its contents are NOT available outside the script environment (outside the &amp;lt;script&amp;gt; and &amp;lt;/script&amp;gt; tags).&amp;nbsp; Since there are no scripts outside main script block, there is no harm. However, if you enter the var app = {} line in the Buffer any shape example, it will fail.&amp;nbsp; Also,&lt;/P&gt;&lt;P&gt;if you remove the app from the Geodesic buffering sample (using only map, gsvc) that sample still works fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 21 Sep 2014 14:58:18 GMT</pubDate>
    <dc:creator>BruceRalston</dc:creator>
    <dc:date>2014-09-21T14:58:18Z</dc:date>
    <item>
      <title>buffering in JavaScript with app.tb</title>
      <link>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/buffering-in-javascript-with-app-tb/m-p/716349#M13</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have noticed that some examples of buffering in javascript api do not use and app.tb, app.gsvc, or app.map.&amp;nbsp; The Buffer a Point sample is an example.&amp;nbsp; However, the new dojo style samples, like util_buffergraphic do use a structure like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; app = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map: map,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tb: tb,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gsvc: gsvc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume this is required by the newer dojo style.&amp;nbsp; Is this correct?&amp;nbsp; Is there somewhere I can read up about why this is necessary in the new style dojo but not in the old style dojo?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 14:16:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/buffering-in-javascript-with-app-tb/m-p/716349#M13</guid>
      <dc:creator>BruceRalston</dc:creator>
      <dc:date>2014-09-19T14:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: buffering in JavaScript with app.tb</title>
      <link>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/buffering-in-javascript-with-app-tb/m-p/716350#M14</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have figured out what is going on .&amp;nbsp; The object defined at the end of the &lt;A href="https://developers.arcgis.com/javascript/jssamples/util_buffergraphic.html" title="https://developers.arcgis.com/javascript/jssamples/util_buffergraphic.html"&gt;Buffer any shape | ArcGIS API for JavaScript&lt;/A&gt; has automatic global scope (a JavaScript term).&amp;nbsp; That means it is known throughout the application (similar to HTML global scope), so inline scripts outside the main script tag have access to the app objects contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The confusion arises because the example at &lt;A href="https://developers.arcgis.com/javascript/jssamples/util_geodesic_buffering.html" title="https://developers.arcgis.com/javascript/jssamples/util_geodesic_buffering.html"&gt;Geodesic buffering | ArcGIS API for JavaScript&lt;/A&gt;&amp;nbsp; declares app as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var app = {}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This gives this variable JavaScript global (not automatic global) scope. This means that its contents are NOT available outside the script environment (outside the &amp;lt;script&amp;gt; and &amp;lt;/script&amp;gt; tags).&amp;nbsp; Since there are no scripts outside main script block, there is no harm. However, if you enter the var app = {} line in the Buffer any shape example, it will fail.&amp;nbsp; Also,&lt;/P&gt;&lt;P&gt;if you remove the app from the Geodesic buffering sample (using only map, gsvc) that sample still works fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Sep 2014 14:58:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/buffering-in-javascript-with-app-tb/m-p/716350#M14</guid>
      <dc:creator>BruceRalston</dc:creator>
      <dc:date>2014-09-21T14:58:18Z</dc:date>
    </item>
  </channel>
</rss>

