<?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 Bug: 4.27 continuous zoom mouse wheel not snaping to max/min scale in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-4-27-continuous-zoom-mouse-wheel-not-snaping/m-p/1309952#M81742</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I'd like to report the bug again. There is a bug with&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;continuous&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;zoom (&lt;/SPAN&gt;&lt;SPAN&gt;view.constraints.snapToZoom = false). It's sometimes impossible to zoom in to max scale (or zoom out to min scale) using mouse wheel.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Look at the screenshot below (I zoomed in using mouse wheel and i can't go further with mouse wheel. The only way to achieve max scale is to use '+' button).&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2023-07-20 at 10.22.12.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/75851i08C7483DC7F35449/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-07-20 at 10.22.12.png" alt="Screenshot 2023-07-20 at 10.22.12.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Codepen: &lt;A href="https://codepen.io/matiol/pen/PoxamWL" target="_blank"&gt;https://codepen.io/matiol/pen/PoxamWL&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Previous topic: &lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-4-25-continuous-zoom-not-snaping-to-max-min/m-p/1242540" target="_blank"&gt;https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-4-25-continuous-zoom-not-snaping-to-max-min/m-p/1242540&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jul 2023 08:29:00 GMT</pubDate>
    <dc:creator>mattheol</dc:creator>
    <dc:date>2023-07-20T08:29:00Z</dc:date>
    <item>
      <title>Bug: 4.27 continuous zoom mouse wheel not snaping to max/min scale</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-4-27-continuous-zoom-mouse-wheel-not-snaping/m-p/1309952#M81742</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'd like to report the bug again. There is a bug with&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;continuous&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;zoom (&lt;/SPAN&gt;&lt;SPAN&gt;view.constraints.snapToZoom = false). It's sometimes impossible to zoom in to max scale (or zoom out to min scale) using mouse wheel.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Look at the screenshot below (I zoomed in using mouse wheel and i can't go further with mouse wheel. The only way to achieve max scale is to use '+' button).&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2023-07-20 at 10.22.12.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/75851i08C7483DC7F35449/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-07-20 at 10.22.12.png" alt="Screenshot 2023-07-20 at 10.22.12.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Codepen: &lt;A href="https://codepen.io/matiol/pen/PoxamWL" target="_blank"&gt;https://codepen.io/matiol/pen/PoxamWL&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Previous topic: &lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-4-25-continuous-zoom-not-snaping-to-max-min/m-p/1242540" target="_blank"&gt;https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-4-25-continuous-zoom-not-snaping-to-max-min/m-p/1242540&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 08:29:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-4-27-continuous-zoom-mouse-wheel-not-snaping/m-p/1309952#M81742</guid>
      <dc:creator>mattheol</dc:creator>
      <dc:date>2023-07-20T08:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Bug: 4.27 continuous zoom mouse wheel not snaping to max/min scale</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-4-27-continuous-zoom-mouse-wheel-not-snaping/m-p/1310160#M81745</link>
      <description>&lt;P&gt;If this behavior is by design, then it likely won't be classified as a bug, which might explain why you didn't get any traction last time.&amp;nbsp; Fortunately, working around this is easy.&amp;nbsp; Below is the code from the script tag in your codepen, with lines 28 - 34 added in order to provide the behavior you're looking for.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;      require([
      "esri/Map",
      "esri/views/MapView",
    ], function(
      Map,
      MapView,
      Expand
    ) {
      const map = new Map({
        basemap: 'topo'
      });

      // center the view over 48 states
      const view = new MapView({
        container: "viewDiv",
        map: map,
        center: [-100, 35],
        zoom: 19,
        constraints: {
          snapToZoom: false
        }
      });
      view.ui.add("scaleDiv", "top-left");
      const scaleDiv = document.getElementById("scaleDiv");
      view.watch('stationary', () =&amp;gt; {
            document.getElementById("scaleDiv").innerHTML = `Current scale: ${view.scale}&amp;lt;br&amp;gt; Max scale: ${view.constraints.effectiveMaxScale} &amp;lt;br&amp;gt; Min scale: ${view.constraints.effectiveMinScale}`;
      });
      view.on("mouse-wheel", function(evt) {
        var viewScale = view.scale;
        window.setTimeout(function() {
          if ((viewScale == view.scale) &amp;amp;&amp;amp; (viewScale != view.constraints.effectiveMinScale) &amp;amp;&amp;amp; (viewScale != view.constraints.effectiveMaxScale))
            view.scale = ((evt.deltaY &amp;gt; 0) ? view.constraints.effectiveMinScale : view.constraints.effectiveMaxScale);
        }, 10);
      });
    });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that the mouse-wheel event occurs before the setting of the view's scale value.&amp;nbsp; As a result, when the mouse-wheel event fires, the view's scale property is still set to the value it had before the mouse wheel was moved.&amp;nbsp; The window.setTimeout call is used to work around that sequence.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 17:55:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-4-27-continuous-zoom-mouse-wheel-not-snaping/m-p/1310160#M81745</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-07-20T17:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Bug: 4.27 continuous zoom mouse wheel not snaping to max/min scale</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-4-27-continuous-zoom-mouse-wheel-not-snaping/m-p/1310888#M81760</link>
      <description>&lt;P&gt;Thanks for your reply and this workaround, but I really dislike the idea that this default behavior is desirable. In my opinion you should be able get to max/min scale using mouse-wheel without this kind of workaround and fixing map navigation with setting directly scale on the view object.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 07:28:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-4-27-continuous-zoom-mouse-wheel-not-snaping/m-p/1310888#M81760</guid>
      <dc:creator>mattheol</dc:creator>
      <dc:date>2023-07-24T07:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Bug: 4.27 continuous zoom mouse wheel not snaping to max/min scale</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-4-27-continuous-zoom-mouse-wheel-not-snaping/m-p/1311096#M81765</link>
      <description>&lt;P&gt;You needn't look far to know you're not alone in believing things in the API should be a certain way although they're not...perhaps &lt;A href="https://community.esri.com/t5/arcgis-online-questions/how-can-i-change-the-order-of-popups-on-an-arcgis/td-p/660210/page/4" target="_self"&gt;here&lt;/A&gt; is a good example (and I have a workaround for that one too).&amp;nbsp; You also needn't look far to find things that truly are bugs that don't get fixed nonetheless...even when documented down to the line of code and presented with a solution (&lt;A href="https://community.esri.com/t5/arcgis-api-for-javascript/4-19-uniquevaluerenderer-removeuniquevalueinfo-bug/m-p/1074484" target="_self"&gt;here&lt;/A&gt; and &lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labeling-bug-with-rangedomain-4-26-and-previous/td-p/1280469" target="_self"&gt;here&lt;/A&gt; perhaps).&amp;nbsp; In my 20 years of working with ESRI products, I've come to find that, at the end of the day, it's not a win if the API works as expected...it's a win if the final product works as expected.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 17:24:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-4-27-continuous-zoom-mouse-wheel-not-snaping/m-p/1311096#M81765</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-07-24T17:24:49Z</dc:date>
    </item>
  </channel>
</rss>

