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

12227
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
DanWebGIS
New Contributor

Is your map app public?  If so, would you please provide a link?  Now that Google shut off their experiment, map clicks work in both our 3.28 and 3.35 JSAPI maps.

0 Kudos