<?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 set the map scale ratio in arcgis server by javascript? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-the-map-scale-ratio-in-arcgis-server-by/m-p/127494#M11796</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;BR /&gt;&lt;SPAN&gt;Really I need to know the code for " How to set the map scale ratio in arcgis server by javascript?" I became crazy for this :mad: I know how to set the map extent or zoom to specific feature. But not sure how to set the scale ratio, how much should i plus/minus the extent. For example what I need to show I have attached a demo file. Like before hope this time also some one will come out to help me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Sep 2011 07:28:35 GMT</pubDate>
    <dc:creator>MdAziz</dc:creator>
    <dc:date>2011-09-05T07:28:35Z</dc:date>
    <item>
      <title>How to set the map scale ratio in arcgis server by javascript?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-the-map-scale-ratio-in-arcgis-server-by/m-p/127494#M11796</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;BR /&gt;&lt;SPAN&gt;Really I need to know the code for " How to set the map scale ratio in arcgis server by javascript?" I became crazy for this :mad: I know how to set the map extent or zoom to specific feature. But not sure how to set the scale ratio, how much should i plus/minus the extent. For example what I need to show I have attached a demo file. Like before hope this time also some one will come out to help me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Sep 2011 07:28:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-the-map-scale-ratio-in-arcgis-server-by/m-p/127494#M11796</guid>
      <dc:creator>MdAziz</dc:creator>
      <dc:date>2011-09-05T07:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the map scale ratio in arcgis server by javascript?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-the-map-scale-ratio-in-arcgis-server-by/m-p/127495#M11797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Have you tried this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
function zoomToScale(scale){
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(esri.geometry.getExtentForScale(map, scale));
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;a.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:13:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-the-map-scale-ratio-in-arcgis-server-by/m-p/127495#M11797</guid>
      <dc:creator>AxelSchaefer</dc:creator>
      <dc:date>2021-12-11T07:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the map scale ratio in arcgis server by javascript?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-the-map-scale-ratio-in-arcgis-server-by/m-p/127496#M11798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot Axxl, ur key word really helps me to get the solution. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
&amp;nbsp; var currentScale = esri.geometry.getScale(map.extent,map.width,map.spatialReference.wkid); 
&amp;nbsp; var scaleRatio = userScale / currentScale;
&amp;nbsp;&amp;nbsp; var newExtent = map.extent.expand(scaleRatio);
&amp;nbsp;&amp;nbsp; map.setExtent(newExtent); 
 &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:13:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-the-map-scale-ratio-in-arcgis-server-by/m-p/127496#M11798</guid>
      <dc:creator>MdAziz</dc:creator>
      <dc:date>2021-12-11T07:13:33Z</dc:date>
    </item>
  </channel>
</rss>

