<?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: refresh the map when adding new layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-the-map-when-adding-new-layer/m-p/528586#M49281</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;this is only to shorten the line&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Nov 2011 03:30:11 GMT</pubDate>
    <dc:creator>salimalzahrani</dc:creator>
    <dc:date>2011-11-22T03:30:11Z</dc:date>
    <item>
      <title>refresh the map when adding new layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-the-map-when-adding-new-layer/m-p/528584#M49279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i am quite newbie on Javascript API, what i am trying to do is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i added new layers to the map and need to refresh or reload the map so i can see the new layer &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i tried many way mentioned here but nothing works&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2396&amp;amp;t=259812"&gt;http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2396&amp;amp;t=259812&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this is the error i get always.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[08:59:28.833] _547 is undefined @ &lt;/SPAN&gt;&lt;A href="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.5compact:48"&gt;http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.5compact:48&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here is my code for this idea&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.removeLayer(tiledMapServiceLayer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.removeLayer(dynamicMapServiceLayer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("url");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(tiledMapServiceLayer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer("url");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(dynamicMapServiceLayer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(map.extent);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2011 04:17:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-the-map-when-adding-new-layer/m-p/528584#M49279</guid>
      <dc:creator>salimalzahrani</dc:creator>
      <dc:date>2011-11-21T04:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: refresh the map when adding new layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-the-map-when-adding-new-layer/m-p/528585#M49280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;hi everyone,&lt;BR /&gt;i am quite newbie on Javascript API, what i am trying to do is:&lt;BR /&gt;i added new layers to the map and need to refresh or reload the map so i can see the new layer &lt;BR /&gt;i tried many way mentioned here but nothing works&lt;BR /&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2396&amp;amp;t=259812"&gt;http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2396&amp;amp;t=259812&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;this is the error i get always.&lt;BR /&gt;[08:59:28.833] _547 is undefined @ &lt;A href="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.5compact:48"&gt;http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.5compact:48&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;here is my code for this idea&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.removeLayer(tiledMapServiceLayer);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.removeLayer(dynamicMapServiceLayer);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("url");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(tiledMapServiceLayer);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer("url");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(dynamicMapServiceLayer);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(map.extent);&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;both addLayer and setExtent should refresh your map, but you are not creating valid layers.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("url");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you are passing in the String "url", you need to send the actual url.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2011 13:25:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-the-map-when-adding-new-layer/m-p/528585#M49280</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2011-11-21T13:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: refresh the map when adding new layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-the-map-when-adding-new-layer/m-p/528586#M49281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;this is only to shorten the line&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 03:30:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-the-map-when-adding-new-layer/m-p/528586#M49281</guid>
      <dc:creator>salimalzahrani</dc:creator>
      <dc:date>2011-11-22T03:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: refresh the map when adding new layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-the-map-when-adding-new-layer/m-p/528587#M49282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i wrote "url" just to shorten the line &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;my map is working but i need to be able to change the service layer from one service to another&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 03:39:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-the-map-when-adding-new-layer/m-p/528587#M49282</guid>
      <dc:creator>salimalzahrani</dc:creator>
      <dc:date>2011-11-22T03:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: refresh the map when adding new layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-the-map-when-adding-new-layer/m-p/528588#M49283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use the destroy method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;destroy()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Destroys the map instance. After the map is destroyed it is no longer valid however you can re-use the div element of the map to create a new map instance. (As of v2.0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Return value: none&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Code snippets:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map.destroy();&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 09:21:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-the-map-when-adding-new-layer/m-p/528588#M49283</guid>
      <dc:creator>JasonSandall</dc:creator>
      <dc:date>2011-11-22T09:21:54Z</dc:date>
    </item>
  </channel>
</rss>

