<?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: standard focus level in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/standard-focus-level/m-p/249436#M23103</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; map.setExtent(esri.graphicsExtent(SearchPar[0].features).expand(5.2), true);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;The application focuses on the area of the map the end user selected and than expands back out.&amp;nbsp; However the zoom level is not consistent if the area of the map is larger or smaller .&amp;nbsp; For instance if the end user wants to see all the adjacent areas within a mile for a piece of property zoom will show this if it is a large section but not if it is a smaller section.&amp;nbsp; So I am wondering if there is a way to make the focus consistent so the user can see the same things if the focus is on a large or small property.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;First, are you using tiled or dynamic services.&amp;nbsp; If tiled, remember that you are snapping to a particular tile level and therefore can't go "exactly" 1 mile out. I will assume tiled since you are referring to levels.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you always want to go out 1 mile, you shouldnt be using the expand command.&amp;nbsp; Expand using the current extent and a ratio.&amp;nbsp; Below expands a given extent a given distance&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var expandFactor = /* half of whatever distance in map units */;

var newExtent = new esri.geometry.Extent({"xmin":map.extent.xmin-expandFactor,"ymin":ymin-expandFactor,"xmax":xmax+expandFactor,"ymax":ymax+expandFactor,
&amp;nbsp; "spatialReference":map.spatialReference});

map.setExtent(newExtent);

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 12:23:48 GMT</pubDate>
    <dc:creator>JeffPace</dc:creator>
    <dc:date>2021-12-11T12:23:48Z</dc:date>
    <item>
      <title>standard focus level</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/standard-focus-level/m-p/249435#M23102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="plain" name="code"&gt; map.setExtent(esri.graphicsExtent(SearchPar[0].features).expand(5.2), true);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The application focuses on the area of the map the end user selected and than expands back out.&amp;nbsp; However the zoom level is not consistent if the area of the map is larger or smaller .&amp;nbsp; For instance if the end user wants to see all the adjacent areas within a mile for a piece of property zoom will show this if it is a large section but not if it is a smaller section.&amp;nbsp; So I am wondering if there is a way to make the focus consistent so the user can see the same things if the focus is on a large or small property.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 15:13:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/standard-focus-level/m-p/249435#M23102</guid>
      <dc:creator>TonyRopson</dc:creator>
      <dc:date>2012-01-05T15:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: standard focus level</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/standard-focus-level/m-p/249436#M23103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; map.setExtent(esri.graphicsExtent(SearchPar[0].features).expand(5.2), true);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;The application focuses on the area of the map the end user selected and than expands back out.&amp;nbsp; However the zoom level is not consistent if the area of the map is larger or smaller .&amp;nbsp; For instance if the end user wants to see all the adjacent areas within a mile for a piece of property zoom will show this if it is a large section but not if it is a smaller section.&amp;nbsp; So I am wondering if there is a way to make the focus consistent so the user can see the same things if the focus is on a large or small property.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;First, are you using tiled or dynamic services.&amp;nbsp; If tiled, remember that you are snapping to a particular tile level and therefore can't go "exactly" 1 mile out. I will assume tiled since you are referring to levels.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you always want to go out 1 mile, you shouldnt be using the expand command.&amp;nbsp; Expand using the current extent and a ratio.&amp;nbsp; Below expands a given extent a given distance&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var expandFactor = /* half of whatever distance in map units */;

var newExtent = new esri.geometry.Extent({"xmin":map.extent.xmin-expandFactor,"ymin":ymin-expandFactor,"xmax":xmax+expandFactor,"ymax":ymax+expandFactor,
&amp;nbsp; "spatialReference":map.spatialReference});

map.setExtent(newExtent);

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:23:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/standard-focus-level/m-p/249436#M23103</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2021-12-11T12:23:48Z</dc:date>
    </item>
  </channel>
</rss>

