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

12186
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
BenjaminCumberland
New Contributor III

We have Edge, Edge Chromium, Firefox, and Chrome, only Chrome fails for our user. Just like HenryKo2 states, we have had several other users with the same Chrome version do Map Clicks and it works for them, but a small set of users continue to fail.

We also thought it could be a user policies/settings thing once our user was able to fail on two different computers. Unfortunately due to teleworking in place, it's hard to for us to test that on more computers at the current moment for us.

BenjaminCumberland
New Contributor III

I want to add that even though updating to 3.35 API is a solution, I want to find an alternative solution since upgrading currently breaks several other tools for our application.

Dan
by
Occasional Contributor

Fortunately, that wasn't the case for us, at least not yet.  What other types of tools does upgrading to 3.35 break? 

0 Kudos
BenjaminCumberland
New Contributor III

We upgraded our API about 2 years ago and found anything above 3.28 would break ESRI's Draw widget due to it not using something called _tGraphic. It essentially allows a preview of Draw tools on the map before placing the graphic down and we also custom made that graphic to show on the fly measurements. There could have been other tools that broke, but we stopped testing when we saw that and began testing with 3.28, where everything worked.

AnandMatam
New Contributor II

We tried on more thing different from all the suggestions and it appears to work.

1. We took the backup of the bookmarks into an xml for later re-import. (Irrelevant for the solution)
2. Deleted the affected user's Chrome profile (Chrome UI management did not work for some) so we deleted the folder:
C:\Users\username\AppData\Local\Google\Chrome\User Data
Here the username is the affected user's login name.
3. Re-imported the bookmarks from the previously backed up xml. (Irrelevant for the solution)


This seems to fix the issue at least for us on JSAPI 3.3.28.

HenryKo2
Occasional Contributor

Awesome, this worked for me! It will be interesting to go through the profiles to see what effected it.

Just to recapture, both deleting this folder, and changing my monitor scaling to 100%, worked for me for this issue.

0 Kudos
HenryKo2
Occasional Contributor

I forgot to mention about the other test we did. The issue happens for one user. So we had another user log in to her laptop, and it worked for the second person. Same Chrome. We exported their Chrome profiles (with the command chrome://policy) and compared, did not see anything that could cause the issue. I'm starting to think it could be a combination of things.

Dan
by
Occasional Contributor

Has anyone noticed if they are able to fix/break it by resizing the browser window?  When it worked, I could maximize the browser window, which would break it, but when I restored the browser window to it's original size (clicking the browser buttons), it would work again.   In this scenario, it would exhibit consistent behavior.

0 Kudos
HenryKo2
Occasional Contributor

Just discovered this: this issue exists for me on my main monitor, 2560x1440 at 125%, but as soon as I dragged Chrome to my laptop screen, 1920x1080 at 100%, the issue went away! Dragging back to my monitor causes the issue to happen again. I'm on Windows 10. So, along with the window size, this seems to imply JSAPI bug (but doesn't explain why it only started happening recently even though we used the same JSAPI). Maybe the JSAPI bug surfaced with recent Windows updates?

BenjaminCumberland
New Contributor III

That's a very good find on the resolution/zoom. We had our user with the issue try some things and soon as the user adjusted the zoom to anything more than 100%, it would break. Keeping it at 100% fixed the issue. Our entire organization had our Chrome updated to 89.0.4389.90 last week, the same time we noticed the issue occur. I would say it's a combination of Chrome changes along with the JSAPI. Of course, I believe we also had all of our monthly security patches pushed.