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

12215
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 . . .

50 Replies
StevenLau
New Contributor

If it works in incognito, this may be an indication that the user needs to refresh the cache?

0 Kudos
SebastienPelletier
Occasional Contributor

It seems that doing this fixes the bug (only for a short time)

Taskkill /IM chrome.exe /F
DEL "%localappdata%\Google\Chrome\User Data\Local State"

0 Kudos
BjornSvensson
Esri Regular Contributor

Hi @SebastienPelletier 
This is a Chrome Experimental feature which is something they can turn on/off independently of the Chrome version you have.  It allows them to release an experimental feature to x % of users.  I'm guessing that your taskkill/del combo might reset this so if you do it a few times the bug would probably re-occur.

0 Kudos
SebastienPelletier
Occasional Contributor

Ok Thanx,

The only solution at this moment is migrate to the latest version of the API, or wait for Chrome to stop its experiments?

Unfortunately migration can be very difficult in a business context.

0 Kudos
DarrylHilton
New Contributor III

Very interesting topic, we have had the same problem but unfortunately moving from 3.13 to anything above that seems to cause other issues in our job (the point click was grabbing data from the WMS and using that to populate fields in a form, when  I change the javascript version number in my html the clicking works again but the fields in the form say 'undefined')

If I;ve read right google are going to roll the change back???? Do we know how long that takes?

0 Kudos
BjornSvensson
Esri Regular Contributor

@DarrylHilton - The Chromium issue was updated to say "We are expecting to end the experiment by the end of this week."

https://bugs.chromium.org/p/chromium/issues/detail?id=1192449#c39 

DarrylHilton
New Contributor III

Thanks...just saw that too.

0 Kudos
SebastienPelletier
Occasional Contributor
Does that mean the patch will come with a new version of Chrome?
0 Kudos
DarrylHilton
New Contributor III

Google switched their experiment off a few hours ago, my apps are now working again as expected.

A new version of google shouldn't be needed, restarting the browser should do it as the config setting was server side

0 Kudos
AnandGanesan
New Contributor

We upgraded our JSAPI to 3.35. But no luck, even in 3.35 it fails intermittently  to trigger the map click event.

We are using the toolbars.Draw.POLYLINE tool to draw a line in the map. When trying to click on the map to create a point, it fails intermittently. This issue happens both in chrome and firefox

I saw a similar blog post, where people are suggesting to update the chrome browser zoom level to fix the problem. I tried that too, and actually it reduces the number of click event failures. but the issue is not completely resolved.

 

Any suggestion or ideas for a complete fix.

 

0 Kudos