<?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 Inconsistent Map Centering After Geocode Result Returned in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inconsistent-map-centering-after-geocode-result/m-p/672615#M62696</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Our app returns a graphic point based on an address search. And we've encountered inconsistent behavior when it comes to the map centering on results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some addresses will return the graphic pt placed in the center of the map as intended:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="132498" alt="slt_center_map.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/132498_slt_center_map.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While other addresses will return the graphic pt in the top left or right of the resulting extent:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="132499" alt="slt_offright_map.PNG" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/132499_slt_offright_map.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;And other address searches will center the map on an area where the graphic point isn't showing at all (though it's still returned to the map as evidenced by the user zooming out or panning).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the graphic pt is called we have our zoom function:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function zoomToPlaces(places) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var multiPoint = new Multipoint(map.spatialReference);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var i = 0; i &amp;lt; places.length; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //multiPoint.addPoint(places&lt;I&gt;.location);&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; multiPoint.addPoint(places&lt;I&gt;.feature.geometry);&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(multiPoint.getExtent().expand(2.0));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;Would having the expand factor set at 2 be a possible cause of this behavior? Has anyone encountered this issue before?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Seth Lewis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 04:23:58 GMT</pubDate>
    <dc:creator>SethLewis1</dc:creator>
    <dc:date>2021-12-12T04:23:58Z</dc:date>
    <item>
      <title>Inconsistent Map Centering After Geocode Result Returned</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inconsistent-map-centering-after-geocode-result/m-p/672615#M62696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Our app returns a graphic point based on an address search. And we've encountered inconsistent behavior when it comes to the map centering on results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some addresses will return the graphic pt placed in the center of the map as intended:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="132498" alt="slt_center_map.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/132498_slt_center_map.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While other addresses will return the graphic pt in the top left or right of the resulting extent:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="132499" alt="slt_offright_map.PNG" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/132499_slt_offright_map.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;And other address searches will center the map on an area where the graphic point isn't showing at all (though it's still returned to the map as evidenced by the user zooming out or panning).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the graphic pt is called we have our zoom function:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function zoomToPlaces(places) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var multiPoint = new Multipoint(map.spatialReference);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var i = 0; i &amp;lt; places.length; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //multiPoint.addPoint(places&lt;I&gt;.location);&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; multiPoint.addPoint(places&lt;I&gt;.feature.geometry);&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(multiPoint.getExtent().expand(2.0));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;Would having the expand factor set at 2 be a possible cause of this behavior? Has anyone encountered this issue before?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Seth Lewis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:23:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inconsistent-map-centering-after-geocode-result/m-p/672615#M62696</guid>
      <dc:creator>SethLewis1</dc:creator>
      <dc:date>2021-12-12T04:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent Map Centering After Geocode Result Returned</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inconsistent-map-centering-after-geocode-result/m-p/672616#M62697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seth, I'm not sure what the issue is, however if you have a geometry point you can always force the map to center on it using &lt;A href="https://developers.arcgis.com/javascript/jsapi/map-amd.html#centerat"&gt;map.centerAt()&lt;/A&gt; or&lt;A href="https://developers.arcgis.com/javascript/jsapi/map-amd.html#centerandzoom"&gt; map.centerAndZoom()&lt;/A&gt;. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2015 16:35:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inconsistent-map-centering-after-geocode-result/m-p/672616#M62697</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2015-10-21T16:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent Map Centering After Geocode Result Returned</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inconsistent-map-centering-after-geocode-result/m-p/672617#M62698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response. I should've included in my original post that we're calling map.centerAt(pt) earlier in our script but we'll look at centerAndZoom as a workaround if we're unable to determine a cause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Seth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2015 21:43:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inconsistent-map-centering-after-geocode-result/m-p/672617#M62698</guid>
      <dc:creator>SethLewis1</dc:creator>
      <dc:date>2015-10-21T21:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent Map Centering After Geocode Result Returned</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inconsistent-map-centering-after-geocode-result/m-p/672618#M62699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; It is like a timing issue then. You should be using something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map.centerAt(point).then(.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2015 01:45:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inconsistent-map-centering-after-geocode-result/m-p/672618#M62699</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-10-22T01:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent Map Centering After Geocode Result Returned</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inconsistent-map-centering-after-geocode-result/m-p/672619#M62700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You were correct. It was a timing issue. Once we adjusted for that the issue was resolved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2015 20:15:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inconsistent-map-centering-after-geocode-result/m-p/672619#M62700</guid>
      <dc:creator>SethLewis1</dc:creator>
      <dc:date>2015-10-22T20:15:30Z</dc:date>
    </item>
  </channel>
</rss>

