<?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 How to remove ArcGISTiledMapServiceLayer completely in ArcAPI Questions</title>
    <link>https://community.esri.com/t5/arcapi-questions/how-to-remove-arcgistiledmapservicelayer/m-p/827941#M70</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a problem related to "ArcGISTiledMapServiceLayer". I have an ArcGISTiledMapServiceLayer map service, which I have added to Map object. This service work as BaseMap. Now I want to add another ArcGISTiledMapServiceLayer map service layer to the same Map object. Before adding the new layer, I just removed the previous tiled map service layer by using method &lt;CODE&gt;objMap.removeAllLayers()&lt;/CODE&gt;. But this method only removes the layer not the extent and it create problem when I add a new layer. &lt;/P&gt;&lt;P&gt;So I want to remove completely the ArcGISTiledMapServiceLayer (layer, extent, scale etc.).&lt;/P&gt;&lt;P&gt;I have tried all the below methods&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;CODE&gt;objMap.removeAllLayers();&lt;/CODE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;CODE&gt;objMap.removeLayer(objMap.getLayer('myLayerID'));&lt;/CODE&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Jul 2014 07:00:40 GMT</pubDate>
    <dc:creator>SanjayGupta</dc:creator>
    <dc:date>2014-07-28T07:00:40Z</dc:date>
    <item>
      <title>How to remove ArcGISTiledMapServiceLayer completely</title>
      <link>https://community.esri.com/t5/arcapi-questions/how-to-remove-arcgistiledmapservicelayer/m-p/827941#M70</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a problem related to "ArcGISTiledMapServiceLayer". I have an ArcGISTiledMapServiceLayer map service, which I have added to Map object. This service work as BaseMap. Now I want to add another ArcGISTiledMapServiceLayer map service layer to the same Map object. Before adding the new layer, I just removed the previous tiled map service layer by using method &lt;CODE&gt;objMap.removeAllLayers()&lt;/CODE&gt;. But this method only removes the layer not the extent and it create problem when I add a new layer. &lt;/P&gt;&lt;P&gt;So I want to remove completely the ArcGISTiledMapServiceLayer (layer, extent, scale etc.).&lt;/P&gt;&lt;P&gt;I have tried all the below methods&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;CODE&gt;objMap.removeAllLayers();&lt;/CODE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;CODE&gt;objMap.removeLayer(objMap.getLayer('myLayerID'));&lt;/CODE&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 07:00:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/how-to-remove-arcgistiledmapservicelayer/m-p/827941#M70</guid>
      <dc:creator>SanjayGupta</dc:creator>
      <dc:date>2014-07-28T07:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove ArcGISTiledMapServiceLayer completely</title>
      <link>https://community.esri.com/t5/arcapi-questions/how-to-remove-arcgistiledmapservicelayer/m-p/827942#M71</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could destroy and recreate the map object to clear the basemap and all other map properties such as extent, scale, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14065316226372307 jive_text_macro" jivemacro_uid="_14065316226372307"&gt;
&lt;P&gt;// Destroy existing map&lt;/P&gt;
&lt;P&gt;map.destroy();&lt;/P&gt;
&lt;P&gt;map = null;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//Create new map&lt;/P&gt;
&lt;P&gt;map = new Map("map", { &lt;/P&gt;
&lt;P&gt;… &lt;/P&gt;
&lt;P&gt;});&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on &lt;A href="http://developers.arcgis.com/javascript/samples/fl_any_projection/"&gt;this sample&lt;/A&gt; from ESRI.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 07:15:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/how-to-remove-arcgistiledmapservicelayer/m-p/827942#M71</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2014-07-28T07:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove ArcGISTiledMapServiceLayer completely</title>
      <link>https://community.esri.com/t5/arcapi-questions/how-to-remove-arcgistiledmapservicelayer/m-p/827943#M72</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But there is too much other properties, event assigned to the Map object, so that I cannot destroy and re-create the Map object. Any other solution?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 07:18:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/how-to-remove-arcgistiledmapservicelayer/m-p/827943#M72</guid>
      <dc:creator>SanjayGupta</dc:creator>
      <dc:date>2014-07-28T07:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove ArcGISTiledMapServiceLayer completely</title>
      <link>https://community.esri.com/t5/arcapi-questions/how-to-remove-arcgistiledmapservicelayer/m-p/827944#M73</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;But this method only removes the layer not the extent and it create problem when I add a new layer.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the problem that the previous map extent creates when adding the new basemap layer? - is the spatial reference different?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 01:05:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/how-to-remove-arcgistiledmapservicelayer/m-p/827944#M73</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2014-07-29T01:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove ArcGISTiledMapServiceLayer completely</title>
      <link>https://community.esri.com/t5/arcapi-questions/how-to-remove-arcgistiledmapservicelayer/m-p/827945#M74</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is, the map not get zoomed after Zoom-Level-5. &lt;/P&gt;&lt;P&gt;Yes both layer's spatialReferences are different.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 04:47:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/how-to-remove-arcgistiledmapservicelayer/m-p/827945#M74</guid>
      <dc:creator>SanjayGupta</dc:creator>
      <dc:date>2014-07-29T04:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove ArcGISTiledMapServiceLayer completely</title>
      <link>https://community.esri.com/t5/arcapi-questions/how-to-remove-arcgistiledmapservicelayer/m-p/827946#M75</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure if it is possible to do this. I was under the impression that all tiled layers had to use the same spatial reference. After a bit of searching I found this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jssamples/map_customextent_and_sr.html" title="https://developers.arcgis.com/javascript/jssamples/map_customextent_and_sr.html"&gt;Set custom extent and spatial reference | ArcGIS API for JavaScript&lt;/A&gt;‌&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P style="margin: 1em 0 0.5em; font-size: 12px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;At versions 1.0 and 1.1 of the ArcGIS JavaScript API, any map service layers you used were required to correspond with the map's spatial reference. Beginning at version 1.2, you can use dynamic map services that have a different spatial reference from the map. Although this gives you more flexibility of the layers you can use, the projection on the fly negatively affects performance.&lt;/P&gt;
&lt;P style="margin: 1em 0 0.5em; font-size: 12px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;STRONG&gt;Cached (tiled) layers in your map must still match the map's spatial reference.&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 00:09:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/how-to-remove-arcgistiledmapservicelayer/m-p/827946#M75</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2014-07-30T00:09:22Z</dc:date>
    </item>
  </channel>
</rss>

