<?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 Possible bug with map.centerAndZoom in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/possible-bug-with-map-centerandzoom/m-p/574562#M53676</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a repeatable bug in an app, where in certain circumstances Internet Explorer 9 fails to map.centerAndZoom properly.&amp;nbsp; Other browsers I've tested (Firefox, Safari, Chrome, Opera) are fine.&amp;nbsp; The condition seems to be when the starting point has essentially the same longitude as the desired destination (doesn't need to be exact).&amp;nbsp; In this scenario, but only the first time (I swear), the map just zooms straight in without adjusting lat or lon.&amp;nbsp; Both the map and the desired destination are Web Mercator spatial refs (wkid: 102100).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In other words, the bug is triggered by code kind of like so, where xnew, ynew, and zoomLevel are supplied (and where xnew is not much different from current center x of the map):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var zoomLevel = 4;&amp;nbsp;&amp;nbsp; // or whatever, zooming in in this case
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var WMRef = new esri.SpatialReference({wkid: 102100});
 var newCenter = new esri.geometry.Point(xnew, ynew, WMRef);
 map.centerAndZoom(newCenter, zoomLevel);
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in IE9 and no other browser, first execution will just zoom straight in with no panning at all.&amp;nbsp; I do not have an isolated 1-page for this, no.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I put the line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xnew += 1000000"
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;before the code above, then the zoomcenter works (though zoomcenters to the wrong spot of course), because the longitude is apparently different enough to cure the bug.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anybody seen this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rex Bradford&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Direct Relief International&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Nov 2012 20:32:50 GMT</pubDate>
    <dc:creator>RexBradford</dc:creator>
    <dc:date>2012-11-07T20:32:50Z</dc:date>
    <item>
      <title>Possible bug with map.centerAndZoom</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/possible-bug-with-map-centerandzoom/m-p/574562#M53676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a repeatable bug in an app, where in certain circumstances Internet Explorer 9 fails to map.centerAndZoom properly.&amp;nbsp; Other browsers I've tested (Firefox, Safari, Chrome, Opera) are fine.&amp;nbsp; The condition seems to be when the starting point has essentially the same longitude as the desired destination (doesn't need to be exact).&amp;nbsp; In this scenario, but only the first time (I swear), the map just zooms straight in without adjusting lat or lon.&amp;nbsp; Both the map and the desired destination are Web Mercator spatial refs (wkid: 102100).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In other words, the bug is triggered by code kind of like so, where xnew, ynew, and zoomLevel are supplied (and where xnew is not much different from current center x of the map):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var zoomLevel = 4;&amp;nbsp;&amp;nbsp; // or whatever, zooming in in this case
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var WMRef = new esri.SpatialReference({wkid: 102100});
 var newCenter = new esri.geometry.Point(xnew, ynew, WMRef);
 map.centerAndZoom(newCenter, zoomLevel);
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in IE9 and no other browser, first execution will just zoom straight in with no panning at all.&amp;nbsp; I do not have an isolated 1-page for this, no.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I put the line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xnew += 1000000"
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;before the code above, then the zoomcenter works (though zoomcenters to the wrong spot of course), because the longitude is apparently different enough to cure the bug.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anybody seen this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rex Bradford&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Direct Relief International&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 20:32:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/possible-bug-with-map-centerandzoom/m-p/574562#M53676</guid>
      <dc:creator>RexBradford</dc:creator>
      <dc:date>2012-11-07T20:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Possible bug with map.centerAndZoom</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/possible-bug-with-map-centerandzoom/m-p/574563#M53677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Also if there are any hooks for troubleshooting this kind of thing....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rex Bradford&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Direct Relief International&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 20:49:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/possible-bug-with-map-centerandzoom/m-p/574563#M53677</guid>
      <dc:creator>RexBradford</dc:creator>
      <dc:date>2012-11-07T20:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Possible bug with map.centerAndZoom</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/possible-bug-with-map-centerandzoom/m-p/574564#M53678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In case anyone's following this and interested, the "same longitude" thing was a red herring. The real clue was "first time", because i n the real app the first time this zoom happens I also turn on another layer and their markers and other stuff like that.&amp;nbsp; I haven't figured out the details, but delaying that layer creation until the end of the zoom cured the problem.&amp;nbsp; I don't know why only IE9 is unhappy with creating the layer while zooming and not other browsers, but anyhow that's the area where the issue lies.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rex Bradford&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mary Ferrell Foundation&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 22:13:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/possible-bug-with-map-centerandzoom/m-p/574564#M53678</guid>
      <dc:creator>RexBradford</dc:creator>
      <dc:date>2012-11-07T22:13:42Z</dc:date>
    </item>
  </channel>
</rss>

