Javascript API 3x Map Click Event Intermittently Fails to Fire in Chrome Browser

4606
50
Jump to solution
03-25-2021 11:41 AM
Dan
by
Occasional Contributor

 

- Javascript API 3.28

- Chrome 89.0.4389.90

- https://www.bcpao.us/PropertySearch/#/account/2961057

---------------------------------------------------------------------------------------------------

Our public Javascript API  3x web map (“MapView”), in production since 2016, started intermittently failing to fire the map.on(“click”) event in Chrome browser on Windows 10 desktop for some users when inside an iframe.  Other elements within the map (checkboxes, buttons, input, search, zoom, pan, layer toggle, etc.) all work.  I can detect that map_gc is the event target every time, but map.on(“click”) doesn’t always fire. I tried loading the web map into a div instead of an iframe, but the result was the same. When the map is loaded in its own window, it seems to work every time. There are no errors in the console.

The website, map, and all resources are local on a single server.  There is another iframe in a separate tab under the web map tab that contains a Pictometry/Eagleview IPA image viewer that initially has no src, so everything is single domain at that point.  There is a resize event on the iframe to ensure the map fits inside the tabbed panel as the browser window is resized. Sometimes resizing the browser window fixes or breaks the map-click, and sometimes has no affect.  Sometimes it just works and is difficult to break.  Sometimes it breaks every time.

This doesn’t happen on all computers and doesn’t appear to happen in any other browser (Edge, IE11, Firefox, Opera, Brave, Safari, etc.)  It doesn't seem to happen on a tablet (Android or Apple) in Chrome either. 

To see this in action, from the URL included above, click the MapView button above the photo.  Maybe I’ve stared at it too long to see an obvious issue . . .

1 Solution

Accepted Solutions
Dan
by
Occasional Contributor

Upgrading to JSAPI 3.35 seems to have solved this issue and is implemented.  My thanks to those who provided suggestions.

View solution in original post

50 Replies
BenjaminCumberland
New Contributor III

Hey DanDan,

We noticed last Thursday one of our users running into the exact same issue that you are describing. We also use the 3.28 API and your Chrome version is the exact same as well. One small difference is we have our Map setup in Div tags. I was able to click on the map within your website and it worked for me fine, but when I had the user that is having issues click it, he couldn't get it to work.

One thing we noticed is that the Map Click event refuses to trigger, but will eventually trigger after several clicks. It works one time, then goes back to broken state until so many clicks are hit again. This happens both in our environment and also on yours for that one user. We also noticed if we point to a new version of the API (3.35) it fixed the issue for the user. We don't want to go that route just yet, but I did want to point it out.

Please let me know if you are still working through this issue or if you were able to come up with a solution.

Dan
by
Occasional Contributor

Greetings, and thank you for contacting me. I upgraded to 3.35 in our test environment, and that seems to have solved the issue. I haven't been able to get the map click to fail today since upgrading to 3.35. We are receiving more frequent reports of this issue, so I'm implementing faster than I usually would. I don't yet know the cause of this issue, but I wonder if there is a low tolerance in the API for differentiating between a pan and a click. Some users with mice set to fast movement tend to have a harder time clicking because the slightest movement of the mouse causes a pan rather than a click. I don't know if Chrome is doing anything to exacerbate this issue but upgrading the JSAPI to 3.35 seems to solve it. Thanks again. -Dan

0 Kudos
Dan
by
Occasional Contributor

Upgrading to JSAPI 3.35 seems to have solved this issue and is implemented.  My thanks to those who provided suggestions.

View solution in original post

Dan
by
Occasional Contributor

Just an FYI that I struggled to find a solution for this all last week and planned to try an API upgrade on Monday as a last ditch hope that it would solve it.  I went so far as to build a very basic two-tab page with the same two maps (JSAPI 3.28 and Pictometry) populating two iframes.  It worked every time, so I started to think it may be some other resource in my production app that was interfering with the JSAPI.  I almost never post on blogs but I'm glad I did.  I received a private message very soon after from a developer who was experiencing the same issue who later confirmed that upgrading to 3.35 worked for their applications. My thanks to that person as well for being the first to respond and to give me hope that upgrading to 3.35 was a viable option.  One thing you will notice with the 3.35 upgrade is that map clicks happen much faster than in 3.28.  In my application, since upgrading to 3.35, map clicks respond now in less than 100ms where before it would take around 700ms.

0 Kudos
Raleigh_GISGIS
New Contributor II

What about maps in ArcGIS Enterprise that are not at 3.31 yet?  We are getting reports in ArcGIS Enterprise 10.8.0.  Though I don't think there is a way to specify a specific API version in Enterprise (except for the one in the REST directory).  Couldn't find a way to determine which version of the JS API 3.x it uses.  I would guess 3.30 since the REST directory uses 4.13.  Upgrading to 10.8.1 is not in our plans since we are going to upgrade to 10.9.

0 Kudos
JustinGreco1
New Contributor III

What about maps in ArcGIS Enterprise that are not at 3.31 yet?  We are getting reports in ArcGIS Enterprise 10.8.0. I don't think there is a way to specify a specific API version in Enterprise (except for the one in the REST directory).  Couldn't find a way to determine which version of the JS API 3.x it uses.  I would guess 3.30 since the REST directory uses 4.13.  Upgrading to 10.8.1 is not in our plans since we are going to upgrade to 10.9.

0 Kudos
MaximeDemers
Occasional Contributor III

Hi,

Im facing the same issue with JSAP 3.29 and upgrading to 3.35 solved it.

However, I wonder if anybody can tell me if it is safe to upgrade the JSAPI when using web app builder? Is there a possibility that some widgets stop working?

Thank you!

HenryKo2
New Contributor III

Hi all, we started to face similar issues last few weeks, where a small number of users are unable to draw geometries on the map with mouse-clicks. We are using JSAPI 3.22. MS Edge doesn't have this issue, but Chrome does, and only for some users. But with the same Chrome version, it works for most users. This issue started to spread to more and more users gradually. We use DIV, no iFrame.

We are a large corporate and initially we suspect it's something to do with user policies/settings. But at the moment, this does not appear to be the case.

We upgraded Chrome to a latest beta version, no luck. But another user downgraded her version (I don't have the specifics here), and it started to work for her again.

We are still investigating, and will post here for any further progress (e.g. change JSAPI versions).

 

Dan
by
Occasional Contributor

Thank you.  Although upgrading to JSAPI 3.35 seems to solve the issue, i sure would like to know the cause, and why it is intermittent and only affects some users.

0 Kudos