<?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 Zooming with mouse wheel/double-click forces pan in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zooming-with-mouse-wheel-double-click-forces-pan/m-p/172621#M15977</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a map that I'm initializing off-screen and sliding in using jQuery. For some reason zooming in with the scroll wheel or by double-clicking causes the map to simultaneously pan down (or pan up when zooming out). Using the slider controls works fine. Also if I disable the animation and create it on-screen it zooms normally. I'm guessing it has something to do with the relative position of the map to where it was created, but I don't imagine I have much control over that. Does anyone have any thoughts on this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's how I'm styling the map:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;#map {
 bottom: -450px;
 height: 450px;
 position: fixed;
 width: 100%;
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And this is my animation function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;toggleMap: function() {
 // New bottom value
 var newBottom;

 if (isShowing) {
&amp;nbsp; newBottom = -MAP_HEIGHT;
 }
 else {
&amp;nbsp; newBottom = 0;
 }

 // Set this here in case they reverse the animation before it finishes
 isShowing = !isShowing;

 // Change link text
 $('#gis-link').text(!isShowing ? 'show' : 'hide');

 // Animate
 $map.animate({
&amp;nbsp; bottom: newBottom
 });
},&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Sep 2013 15:44:42 GMT</pubDate>
    <dc:creator>RobertMartin2</dc:creator>
    <dc:date>2013-09-18T15:44:42Z</dc:date>
    <item>
      <title>Zooming with mouse wheel/double-click forces pan</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zooming-with-mouse-wheel-double-click-forces-pan/m-p/172621#M15977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a map that I'm initializing off-screen and sliding in using jQuery. For some reason zooming in with the scroll wheel or by double-clicking causes the map to simultaneously pan down (or pan up when zooming out). Using the slider controls works fine. Also if I disable the animation and create it on-screen it zooms normally. I'm guessing it has something to do with the relative position of the map to where it was created, but I don't imagine I have much control over that. Does anyone have any thoughts on this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's how I'm styling the map:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;#map {
 bottom: -450px;
 height: 450px;
 position: fixed;
 width: 100%;
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And this is my animation function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;toggleMap: function() {
 // New bottom value
 var newBottom;

 if (isShowing) {
&amp;nbsp; newBottom = -MAP_HEIGHT;
 }
 else {
&amp;nbsp; newBottom = 0;
 }

 // Set this here in case they reverse the animation before it finishes
 isShowing = !isShowing;

 // Change link text
 $('#gis-link').text(!isShowing ? 'show' : 'hide');

 // Animate
 $map.animate({
&amp;nbsp; bottom: newBottom
 });
},&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 15:44:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zooming-with-mouse-wheel-double-click-forces-pan/m-p/172621#M15977</guid>
      <dc:creator>RobertMartin2</dc:creator>
      <dc:date>2013-09-18T15:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Zooming with mouse wheel/double-click forces pan</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zooming-with-mouse-wheel-double-click-forces-pan/m-p/172622#M15978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does this occur on all browsers and client devices or just particular configurations?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would need to see more of the code in order to help you out, such as the resize map functions you might be using.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 15:49:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zooming-with-mouse-wheel-double-click-forces-pan/m-p/172622#M15978</guid>
      <dc:creator>GISDev1</dc:creator>
      <dc:date>2013-09-18T15:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Zooming with mouse wheel/double-click forces pan</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zooming-with-mouse-wheel-double-click-forces-pan/m-p/172623#M15979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Dev,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm developing in Chrome 29.0.1547.66 but it happens in Firefox 24.0 as well. I'm not explicitly calling any resize functions -- in fact the only code I have so far is creating the map and adding some layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is how I create the map:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;require(['esri/map'], function(Map) {
 // Create and add map div
 $('&amp;lt;div/&amp;gt;', {id: 'map'}).appendTo('#bounds');

 // Reference map div
 $map = $('#map');

 // Create map
 map = new Map('map', {
&amp;nbsp; logo: false,
 });

 // Add tiled layers
 addLayers();
});&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code to add the layers is rather long but I'm basically just forming URLs, creating layer objects, and passing them to map.AddLayer(). There are 3 tiled layers and 1 dynamic. They all work fine as long as the map is in a fixed on-screen position.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:55:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zooming-with-mouse-wheel-double-click-forces-pan/m-p/172623#M15979</guid>
      <dc:creator>RobertMartin2</dc:creator>
      <dc:date>2021-12-11T08:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Zooming with mouse wheel/double-click forces pan</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zooming-with-mouse-wheel-double-click-forces-pan/m-p/172624#M15980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Derek of the JS team was kind enough to point me in the right direction:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;map.reposition();&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Boom! No more pan.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2013 20:45:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zooming-with-mouse-wheel-double-click-forces-pan/m-p/172624#M15980</guid>
      <dc:creator>RobertMartin2</dc:creator>
      <dc:date>2013-09-19T20:45:24Z</dc:date>
    </item>
  </channel>
</rss>

