<?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 centerAndZoom Issue in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659007#M61489</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;when using centerAndZoom, the point is centered left-right (East-West) but shifted Down (South) from the center of screen. Has anyone else seen this? This behavior is experienced in both PC as well as mobile device.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function doTheZoom(geom) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; map.centerAndZoom(geom,16);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RGibson&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Nov 2012 13:16:22 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2012-11-02T13:16:22Z</dc:date>
    <item>
      <title>centerAndZoom Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659007#M61489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;when using centerAndZoom, the point is centered left-right (East-West) but shifted Down (South) from the center of screen. Has anyone else seen this? This behavior is experienced in both PC as well as mobile device.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function doTheZoom(geom) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; map.centerAndZoom(geom,16);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RGibson&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2012 13:16:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659007#M61489</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-11-02T13:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: centerAndZoom Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659008#M61490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What's on your geom parameter?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try setting your geom with a wkid (matching the basemap)...something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&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; var point = new esri.geometry.Point([x, y], new esri.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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wkid: 27700
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("Zooming to location...", point, zoomLevel);
&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.centerAndZoom(point, zoomLevel);
&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; console.log("Zoom complete");&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:53:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659008#M61490</guid>
      <dc:creator>AndyBurns</dc:creator>
      <dc:date>2021-12-12T03:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: centerAndZoom Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659009#M61491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The geometry is actually the location of a returned address location.....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; function showResults(candidates) { &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var candidate = candidates[0]; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;..............&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;geom = candidate.location;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2012 15:00:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659009#M61491</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-11-02T15:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: centerAndZoom Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659010#M61492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I may need to clarify the issue. The geom is in the correct location on the map. However the location on the map isn't centered on the screen as it should be. It's shifted down or to the South.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;r&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2012 15:23:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659010#M61492</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-11-02T15:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: centerAndZoom Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659011#M61493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;okay got it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are the returned co ords and the basemap in the same spatial ref? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;try creating a point for it to go to&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ie:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function showResults(candidates) {
var candidate = candidates[0];
..............

 geom = candidate.location; 

 var point = new esri.geometry.Point([geom], new esri.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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wkid: &lt;STRONG&gt;YOUR WKID&lt;/STRONG&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; }));

 map.centerAndZoom(point, 16);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you can output the results of your geom i will check to ensure everything is there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had similar issues and it was down to not specifying the spatial ref or the spatial ref of the basemap was incorrect with the spatial ref of the address results, you might need to run a geometry job to change spatial ref but if you can let me know your basemap spatial ref and the address locator spatial ref that will clear that up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:53:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659011#M61493</guid>
      <dc:creator>AndyBurns</dc:creator>
      <dc:date>2021-12-12T03:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: centerAndZoom Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659012#M61494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The original coords of the address location is a state plane (3433) and the basemap is 102100 (World Street Map from AGS Online). I've done this before and not experienced this issue. Only with this app am I having the issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;r&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2012 16:47:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659012#M61494</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-11-02T16:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: centerAndZoom Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659013#M61495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Okay, try the geometry reproject service here - &lt;/SPAN&gt;&lt;A href="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer/project"&gt;http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer/project&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;see if the results when you reproject to 102100 are better suited try testing with these new co ords hard coded just to see if its where it should be, thats the only thing i can think of that there is a mismatched between the spatial ref's&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;inSR = 3443&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outSR = 102100&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Geometries X, Y&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry i cant be of anymore help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2012 22:46:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659013#M61495</guid>
      <dc:creator>AndyBurns</dc:creator>
      <dc:date>2012-11-02T22:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: centerAndZoom Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659014#M61496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your assistance, Andy. The point is falling where it should geographically speaking. The issue is essentially one of screen shift.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RGibson&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2012 12:37:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659014#M61496</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-11-05T12:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: centerAndZoom Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659015#M61497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Looks like even the Mobile - Geolocation Sample has this issue.....hmmmm.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2012 13:37:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659015#M61497</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-11-05T13:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: centerAndZoom Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659016#M61498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;wierd, i guess that you tried that on your local machine...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you try the html5 one aswell and see if you get similar results?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/exp_geolocate.html"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/exp_geolocate.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2012 14:28:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659016#M61498</guid>
      <dc:creator>AndyBurns</dc:creator>
      <dc:date>2012-11-05T14:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: centerAndZoom Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659017#M61499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hmmm....oddly enough that did center correctly.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2012 14:34:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659017#M61499</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-11-05T14:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: centerAndZoom Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659018#M61500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So apparently the issue was with how the sample uses the resizeMap function and the CSS. The fix was to subtract the height of the header from the screen height, like so:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;$('#map').css("height", (screen.height - (document.getElementById("header").height)));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RGibson&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2012 18:42:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centerandzoom-issue/m-p/659018#M61500</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-11-05T18:42:17Z</dc:date>
    </item>
  </channel>
</rss>

