<?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: Bug? Map fires 'extent-changed' event upon a single mouse click in JS API v3.8 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100398#M9208</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This happens in Chrome version 33.0.1750.154.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll have to double-check my version at home.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Apr 2014 16:50:29 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2014-04-22T16:50:29Z</dc:date>
    <item>
      <title>Bug? Map fires 'extent-changed' event upon a single mouse click in JS API v3.8</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100393#M9203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am running into a problem with the JS API v3.8 in which the maps 'extent-change' event is fired with a single mouse click (not double or shift+click, just a simple click on the map), even though a single mouse click does not cause the map's extent to actually change.&amp;nbsp; Normally this isn't a problem unless you have a need to run some real code when the extent actually changes.&amp;nbsp; This behavior is unfortunately preventing my popup window from appearing, because I have a function attached to the 'extent-change' event which actually clears the feature layer.&amp;nbsp; But one click should just show the popup, and not fire the 'extent-change'.&amp;nbsp; UPDATE: this only seems to be affecting Chrome&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regardless, see the following code to reproduce in the simplest manner possible:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;lt;!DOCTYPE html&amp;gt; &amp;lt;html&amp;gt; &amp;nbsp; &amp;lt;head&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;Simple Map&amp;lt;/title&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;link rel="stylesheet" href="http://js.arcgis.com/3.8/js/esri/css/esri.css"&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;style&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; html, body, #map { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: 100%; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 100%; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; margin: 0; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; padding: 0; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; body { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; background-color: #FFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; overflow: hidden; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; font-family: "Trebuchet MS"; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/style&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script src="http://js.arcgis.com/3.8/"&amp;gt;&amp;lt;/script&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var map; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; require(["esri/map",&amp;nbsp; &amp;nbsp;&amp;nbsp; "dojo/domReady!"],&amp;nbsp; &amp;nbsp;&amp;nbsp; function( &amp;nbsp;&amp;nbsp; Map) { &amp;nbsp; map = new Map("map", { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; basemap: "gray", &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; center: [-97, 38], &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zoom: 5, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sliderStyle: "small" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }); &amp;nbsp; map.on('extent-change', function(){console.log('extent changed');}); &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }); &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/script&amp;gt; &amp;nbsp; &amp;lt;/head&amp;gt; &amp;nbsp; &amp;lt;body&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div id="map"&amp;gt;&amp;lt;/div&amp;gt; &amp;nbsp; &amp;lt;/body&amp;gt; &amp;lt;/html&amp;gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 17:12:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100393#M9203</guid>
      <dc:creator>Jay_Gregory</dc:creator>
      <dc:date>2014-02-27T17:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Bug? Map fires 'extent-changed' event upon a single mouse click in JS API v3.8</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100394#M9204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My guess is that chrome is more sensitive and may be interpreting a click as a drag&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you could store the extent as a global, say,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;oldextent&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and then on "extent change"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if (oldextent==map.extent){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;do nothing&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}else{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;oldextent=map.extent;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;do stuff&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 20:01:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100394#M9204</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2014-02-27T20:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Bug? Map fires 'extent-changed' event upon a single mouse click in JS API v3.8</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100395#M9205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What version of Chrome are you seeing this issue in? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You are not seeing this issue in Firefox or IE, correct?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, is this desktop or mobile? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using: &lt;/SPAN&gt;&lt;SPAN style="color: #303942; font-family: Segoe UI;"&gt;&lt;SPAN style="font-style:italic;"&gt;Version 33.0.1750.146 m. &lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Using your code, the 'extent-change' event fires once when the the map first loads, as expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the 'extent-change' event does not fire on a single map click. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I must drag or zoom for the 'extent-change' event to fire.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Mar 2014 21:57:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100395#M9205</guid>
      <dc:creator>JonathanUihlein</dc:creator>
      <dc:date>2014-03-04T21:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Bug? Map fires 'extent-changed' event upon a single mouse click in JS API v3.8</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100396#M9206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hmmm, I don't see the behavior anymore.&amp;nbsp; It must have been fixed in a recent Chrome update.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 15:50:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100396#M9206</guid>
      <dc:creator>Jay_Gregory</dc:creator>
      <dc:date>2014-03-12T15:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Bug? Map fires 'extent-changed' event upon a single mouse click in JS API v3.8</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100397#M9207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm seeing the same behavior in Chrome Version 34.0.1847.116 m.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It wasn't doing this before and sounds kind of sporadic.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 16:37:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100397#M9207</guid>
      <dc:creator>JustinShepard</dc:creator>
      <dc:date>2014-04-22T16:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Bug? Map fires 'extent-changed' event upon a single mouse click in JS API v3.8</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100398#M9208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This happens in Chrome version 33.0.1750.154.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll have to double-check my version at home.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 16:50:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100398#M9208</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2014-04-22T16:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Bug? Map fires 'extent-changed' event upon a single mouse click in JS API v3.8</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100399#M9209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't have a solution but I restarted my computer and now it is behaving as expected in Chrome (i.e. it's not trying to move the map every time that I click for an identify)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 20:08:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100399#M9209</guid>
      <dc:creator>JustinShepard</dc:creator>
      <dc:date>2014-04-22T20:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Bug? Map fires 'extent-changed' event upon a single mouse click in JS API v3.8</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100400#M9210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry to wake this thread up almost 2 years later but I am having the same issue in Chrome version 48.0.2564.103 m&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using this thread, I was able to figure out a fix. I thought I would share a complete solution.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; var oldExtent = null;


//ON EXTENT CHANGE - UPDATE IF VISIBLE 
on(this.map, "extent-change", function (event)
{
&amp;nbsp; var isEqual = false
&amp;nbsp; if (oldExtent != null)
&amp;nbsp; isEqual = geometryEngine.equals(oldExtent, event.extent);


&amp;nbsp; if (isEqual)
&amp;nbsp; {
&amp;nbsp; console.log('EXTENT IS THE SAME');
&amp;nbsp; }
&amp;nbsp; else
&amp;nbsp; {
&amp;nbsp; console.log('EXTENT IS DIFFERENT');
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; }


&amp;nbsp; //SET OLD EXTENT
&amp;nbsp; oldExtent = event.extent;
});&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:13:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-map-fires-extent-changed-event-upon-a-single/m-p/100400#M9210</guid>
      <dc:creator>Drew</dc:creator>
      <dc:date>2021-12-11T06:13:50Z</dc:date>
    </item>
  </channel>
</rss>

