<?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: Zoom to Point... in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-point/m-p/48159#M4206</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Jeff, I don't agree with you since it zooms more than current every time when it is called by user.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Well since by default a point does not have an extent, you have to assume one.&amp;nbsp; If you want to stay at the current, you are not zooming, you are panning, in which case just call map.centerAt(pt).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Nov 2011 11:41:32 GMT</pubDate>
    <dc:creator>JeffPace</dc:creator>
    <dc:date>2011-11-14T11:41:32Z</dc:date>
    <item>
      <title>Zoom to Point...</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-point/m-p/48156#M4203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is this still the method to zoom to a point using the ESRI Javascript API?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
 var PointExtent = new esri.geometry.Extent();
 PointExtent.xmin = selectedAddress.geometry.x - .001;
 PointExtent.ymin = selectedAddress.geometry.y - .001;
 PointExtent.xmax = selectedAddress.geometry.x + .001;
 PointExtent.ymax = selectedAddress.geometry.y + .001;
 map.setExtent(PointExtent);
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or, is there a new method?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;M&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 16:50:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-point/m-p/48156#M4203</guid>
      <dc:creator>GISAdmin1</dc:creator>
      <dc:date>2011-11-09T16:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Point...</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-point/m-p/48157#M4204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Is this still the method to zoom to a point using the ESRI Javascript API?&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 var PointExtent = new esri.geometry.Extent();
 PointExtent.xmin = selectedAddress.geometry.x - .001;
 PointExtent.ymin = selectedAddress.geometry.y - .001;
 PointExtent.xmax = selectedAddress.geometry.x + .001;
 PointExtent.ymax = selectedAddress.geometry.y + .001;
 map.setExtent(PointExtent);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Or, is there a new method?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;&lt;BR /&gt;M&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Since its a point, I prefer&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;map.centerAndZoom(selectedAddress.geometry,19); // 19 or whatever zoom scale you prefer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:51:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-point/m-p/48157#M4204</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2021-12-10T21:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Point...</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-point/m-p/48158#M4205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Since its a point, I prefer&lt;BR /&gt;&lt;BR /&gt;map.centerAndZoom(selectedAddress.geometry,19); // 19 or whatever zoom scale you prefer.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff, I don't agree with you since it zooms more than current every time when it is called by user.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Nov 2011 21:33:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-point/m-p/48158#M4205</guid>
      <dc:creator>Mete_ErcanPakdil1</dc:creator>
      <dc:date>2011-11-12T21:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Point...</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-point/m-p/48159#M4206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Jeff, I don't agree with you since it zooms more than current every time when it is called by user.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Well since by default a point does not have an extent, you have to assume one.&amp;nbsp; If you want to stay at the current, you are not zooming, you are panning, in which case just call map.centerAt(pt).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 11:41:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-point/m-p/48159#M4206</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2011-11-14T11:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Point...</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-point/m-p/48160#M4207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Another option is to calculate a new extent from the map's current extent and use that to zoom. It's similar to the original code that was posted in this thread but instead of using a hard coded value, the value used to pad the point is calculated on the fly. Something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var tolerance = 5,
&amp;nbsp;&amp;nbsp;&amp;nbsp; pxWidth = map.extent.getWidth() / map.width,
&amp;nbsp;&amp;nbsp;&amp;nbsp; padding = tolerance * pxWidth,
&amp;nbsp;&amp;nbsp;&amp;nbsp; newExtent = new esri.geometry.Extent({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'xmin': evt.mapPoint.x - padding,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'ymin': evt.mapPoint.y - padding,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'xmax': evt.mapPoint.x + padding,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'ymax': evt.mapPoint.y + padding,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'spatialReference': evt.mapPoint.spatialReference
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
map.setExtent(newExtent);
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:51:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-point/m-p/48160#M4207</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2021-12-10T21:51:35Z</dc:date>
    </item>
  </channel>
</rss>

