<?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 Re: zoom box threshold in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-box-threshold/m-p/99819#M9136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mmm - I think I see your thinking - I could have the ID task fire on a left click event - this will also help me control the switch on/off this task when I am drawing features or using an area measure tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ta&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Oct 2012 11:20:08 GMT</pubDate>
    <dc:creator>AdrianMarsden</dc:creator>
    <dc:date>2012-10-11T11:20:08Z</dc:date>
    <item>
      <title>zoom box threshold</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-box-threshold/m-p/99817#M9134</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;I'm using the out of box navigaton bar, with a nice zoom box thingy.&amp;nbsp; I also have a default onclick of the map to fire off the identify task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sometimes when I want to ID a feature, after zooming in using the zoom button, the mouse moves fractionally, and this is read as a zoom event (click drag) and map zooms into a tiny area.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way of setting a threshold for the zoom option, so anything less than X pixels is interpreted as a single click?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ACM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2012 08:55:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-box-threshold/m-p/99817#M9134</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2012-10-11T08:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: zoom box threshold</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-box-threshold/m-p/99818#M9135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thought it might be useful to 'link' these threads - &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/68248-Mouse-pan-triggering-sensitivity" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/68248-Mouse-pan-triggering-sensitivity&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't think there's anything out-the-box to either set the zoom tolerance nor to cancel any zoom once it's 'started', you could probably hook up something to bounce the user back to the previous extent if you calculate they've triggered an unintentional zoom but you'd have to be very careful with how that might affect your user's experience!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could always delve into the API and see if there's any unofficial ways to hook into the zooming mechanism, but I suspect you won't want to go there...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2012 11:13:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-box-threshold/m-p/99818#M9135</guid>
      <dc:creator>__Rich_</dc:creator>
      <dc:date>2012-10-11T11:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: zoom box threshold</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-box-threshold/m-p/99819#M9136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mmm - I think I see your thinking - I could have the ID task fire on a left click event - this will also help me control the switch on/off this task when I am drawing features or using an area measure tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ta&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2012 11:20:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-box-threshold/m-p/99819#M9136</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2012-10-11T11:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: zoom box threshold</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-box-threshold/m-p/99820#M9137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could code your identify tool with a boolean for "active" or not, then disable the zoom navigation while it is active.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Use the .deactivate of the nav toolbar that you declared for when identify is active, and .activate() when it isn't.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 19:06:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-box-threshold/m-p/99820#M9137</guid>
      <dc:creator>MarcusBush</dc:creator>
      <dc:date>2013-02-04T19:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: zoom box threshold</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-box-threshold/m-p/99821#M9138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Finally got to look at this and did what was suggested -= a bounce back if the zoomextent was a large difference from the original&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; dojo.connect(map, "onZoomEnd", catchZoom2);
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(map, "onZoomStart", catchZoom);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hook the map to some functions in the init function, then&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;//catch bad zooms//get map extent at the start of the zoom
function catchZoom(extent,zoomFactor) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; oldExtent = new esri.geometry.Extent();&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; oldExtent = extent;&amp;nbsp;&amp;nbsp; 
}
//if the zoomfactor is too big, assume it is an error and go back to the original
function catchZoom2(extent, zoomFactor) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; console.debug(zoomFactor)
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (zoomFactor &amp;gt; 400) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(startExtent);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If anyone has a more elegant way it would be nice.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:12:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-box-threshold/m-p/99821#M9138</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2021-12-11T06:12:10Z</dc:date>
    </item>
  </channel>
</rss>

