<?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: Change map scale based on the layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-map-scale-based-on-the-layer/m-p/481681#M44809</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Ok so a dynamic map service doesn't have any scales, only the tiled map service does. You would have to set the scales in the map.lods property. Have a look at this sample - &lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/map_switch_layer_on_zoom.html"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/map_switch_layer_on_zoom.html&lt;BR /&gt;&lt;BR /&gt;S&lt;/A&gt;o you could set the scales there to use.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Weston,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply. But my requirement is to switch between (Tiled + Dynamic Layer) and Dynamic layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my steps for application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. load application with no basemap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Select scale from dropdown in map say 20000.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Map should zoom to 20000.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Then add basemap from basemap dropdown on map. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5. User selects scale 20000 from dropdown. Map should zoom to basemap nearest scale, which is 18055.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;6. And then if user again removes the base map then step 2 and 3 should follow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But if map is loaded without base map, and then I add the basemap. It is added on the map, but is not visible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And if I add the basemap and dynamic layer, and then remove the base map, then map still zooms to the base map scale.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried with adding and removing the layers. But it didn't solved the purpose.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The solution for this that I currently found is that recreate the map object. Since after destroying the map object we can use its div to create the new map. But doing this we can loose any graphics or selection created on the&amp;nbsp; map.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Vinay Bansal&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 May 2013 10:45:03 GMT</pubDate>
    <dc:creator>VinayBansal</dc:creator>
    <dc:date>2013-05-09T10:45:03Z</dc:date>
    <item>
      <title>Change map scale based on the layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-map-scale-based-on-the-layer/m-p/481679#M44807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(Javascript API 3.4 and ArcGIS 10.1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a scenario where I have Bing Base map and DynamicMapService Layer. There is a drop down to select the scale and user has the ability to enter scale. Now the problem is that when Bing map is On, and user selects the scale from dropdown say 20000, map zooms to scale (18666) which is obvious since Bing base map is there and it is following the scale range of Bing. Now when I remove the Bing base map from my map control , now I want to set the scale 20000, and since only dynamicmapservice is there on the map, then it should follow the scale ranges of dynamic map services, but it still zooms to 18666.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Means, when base map is on it should follows the basemap scale, and if basemap is removed, it should follows the scale range of dynamicmapservice layer., i.e. I need to switch dynamically between (Basemap + DynamicMapServicelayer) scenario&amp;nbsp; to DynamicMapService layer on map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So please let me know if this is possible. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks to all.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2013 04:51:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-map-scale-based-on-the-layer/m-p/481679#M44807</guid>
      <dc:creator>VinayBansal</dc:creator>
      <dc:date>2013-05-08T04:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Change map scale based on the layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-map-scale-based-on-the-layer/m-p/481680#M44808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok so a dynamic map service doesn't have any scales, only the tiled map service does. You would have to set the scales in the map.lods property. Have a look at this sample - &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/map_switch_layer_on_zoom.html"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/map_switch_layer_on_zoom.html&lt;BR /&gt;&lt;BR /&gt;S&lt;/A&gt;&lt;SPAN&gt;o you could set the scales there to use.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 09:12:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-map-scale-based-on-the-layer/m-p/481680#M44808</guid>
      <dc:creator>ShaunWeston</dc:creator>
      <dc:date>2013-05-09T09:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Change map scale based on the layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-map-scale-based-on-the-layer/m-p/481681#M44809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Ok so a dynamic map service doesn't have any scales, only the tiled map service does. You would have to set the scales in the map.lods property. Have a look at this sample - &lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/map_switch_layer_on_zoom.html"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/map_switch_layer_on_zoom.html&lt;BR /&gt;&lt;BR /&gt;S&lt;/A&gt;o you could set the scales there to use.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Weston,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply. But my requirement is to switch between (Tiled + Dynamic Layer) and Dynamic layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my steps for application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. load application with no basemap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Select scale from dropdown in map say 20000.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Map should zoom to 20000.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Then add basemap from basemap dropdown on map. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5. User selects scale 20000 from dropdown. Map should zoom to basemap nearest scale, which is 18055.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;6. And then if user again removes the base map then step 2 and 3 should follow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But if map is loaded without base map, and then I add the basemap. It is added on the map, but is not visible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And if I add the basemap and dynamic layer, and then remove the base map, then map still zooms to the base map scale.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried with adding and removing the layers. But it didn't solved the purpose.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The solution for this that I currently found is that recreate the map object. Since after destroying the map object we can use its div to create the new map. But doing this we can loose any graphics or selection created on the&amp;nbsp; map.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Vinay Bansal&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 10:45:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-map-scale-based-on-the-layer/m-p/481681#M44809</guid>
      <dc:creator>VinayBansal</dc:creator>
      <dc:date>2013-05-09T10:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Change map scale based on the layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-map-scale-based-on-the-layer/m-p/481682#M44810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I got the solution for this.....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Clearing these variables when bsaemap is off,&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;map.__tileInfo = null; map.__LOD = null; veTileLayer = null; map._params.maxScale = 0; map._params.minScale = 0; map._params.minZoom = -1; map._params.maxZoom = -1; map._params.tileInfo = null; map._params.lods = null;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And setting back these variables when basemap is on&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;map.__LOD = tileLod; map.__tileInfo = veTileLayer.tileInfo; map._params.minScale = tileLods[0].scale; map._params.maxScale = tileLods[tileLods.length - 1].scale; map._params.minZoom = 0; map._params.maxZoom = tileLods.length - 1; map._params.tileInfo = tileLayer.tileInfo; map._params.lods = tileLods;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 May 2013 05:51:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-map-scale-based-on-the-layer/m-p/481682#M44810</guid>
      <dc:creator>VinayBansal</dc:creator>
      <dc:date>2013-05-27T05:51:53Z</dc:date>
    </item>
  </channel>
</rss>

