<?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: Error on Removing all map layers in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-removing-all-map-layers/m-p/391852#M36182</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you able to share your code or link to a live example? This will make it a lot easier to debug.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Prior to the 3.3 release of the JS API it wasn't possible to remove the basemap layer, but this is &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jshelp/#whats_new" rel="nofollow" target="_blank"&gt;now possible&lt;/A&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;STRONG&gt;Use a graphics layer or a feature layer as the only layer in a map&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000; font-family: Lucida Grande;"&gt;The map no longer requires a &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#arcgistiledmapservicelayer" rel="nofollow" target="_blank"&gt;tiled&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Lucida Grande;"&gt; or &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#arcgisdynamicmapservicelayer" rel="nofollow" target="_blank"&gt;dynamic&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Lucida Grande;"&gt; service to be the first type of layer added to the map. View the new &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/renderer_feature_layer_function_animate" rel="nofollow" target="_blank"&gt;Feature Layer in any projection sample&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Lucida Grande;"&gt; or the&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/data_gas_prices" rel="nofollow" target="_blank"&gt;gas prices by state example&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Lucida Grande;"&gt; to see this in action.&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you using v3.3?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Feb 2013 20:21:08 GMT</pubDate>
    <dc:creator>StephenLead</dc:creator>
    <dc:date>2013-02-14T20:21:08Z</dc:date>
    <item>
      <title>Error on Removing all map layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-removing-all-map-layers/m-p/391851#M36181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am seeing the following error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;TypeError: this.map.getLayer(...) is undefined&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://&amp;lt;Machine Name&amp;gt;/arcgis-js/3.3/js/esri/dijit/Scalebar.js" rel="nofollow" target="_blank"&gt;https://&amp;lt;Machine Name&amp;gt;/arcgis-js/3.3/js/esri/dijit/Scalebar.js&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Line 19&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I remove all layers from the map and add new layers. Is this expected behavior? If so, has anyone found a work around. The only thing solving it for me is to add a layer to map, OSM, as invisible and never removing it. This is not a good solution for me as I may be in an environment with no outside internet access where I am simply using graphics layers within the map. Can this be done with a graphics layer to satisfy the map and get around this error?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 20:08:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-removing-all-map-layers/m-p/391851#M36181</guid>
      <dc:creator>JamesVillanueva</dc:creator>
      <dc:date>2013-02-14T20:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error on Removing all map layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-removing-all-map-layers/m-p/391852#M36182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you able to share your code or link to a live example? This will make it a lot easier to debug.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Prior to the 3.3 release of the JS API it wasn't possible to remove the basemap layer, but this is &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jshelp/#whats_new" rel="nofollow" target="_blank"&gt;now possible&lt;/A&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;STRONG&gt;Use a graphics layer or a feature layer as the only layer in a map&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000; font-family: Lucida Grande;"&gt;The map no longer requires a &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#arcgistiledmapservicelayer" rel="nofollow" target="_blank"&gt;tiled&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Lucida Grande;"&gt; or &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#arcgisdynamicmapservicelayer" rel="nofollow" target="_blank"&gt;dynamic&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Lucida Grande;"&gt; service to be the first type of layer added to the map. View the new &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/renderer_feature_layer_function_animate" rel="nofollow" target="_blank"&gt;Feature Layer in any projection sample&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Lucida Grande;"&gt; or the&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/data_gas_prices" rel="nofollow" target="_blank"&gt;gas prices by state example&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Lucida Grande;"&gt; to see this in action.&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you using v3.3?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 20:21:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-removing-all-map-layers/m-p/391852#M36182</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2013-02-14T20:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Error on Removing all map layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-removing-all-map-layers/m-p/391853#M36183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My code is too large to post. I changed the way I was dealing with the base layers. I just ensured I added the new one before I removed the old one, and everything appears to be working. Thanks for the tips.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2013 16:31:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-removing-all-map-layers/m-p/391853#M36183</guid>
      <dc:creator>JamesVillanueva</dc:creator>
      <dc:date>2013-02-15T16:31:17Z</dc:date>
    </item>
  </channel>
</rss>

