ThinkGeo.com    |     Blog    |     Wiki    |     Support

Client side error when zooming in or out on Chrome

Hi Thinkgeo and community,

We’ve noticed within the past few months and following some Chrome updates that we have been getting consistent zooming in and zooming out client side errors. The client side error is “[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/6662647093133312” and the source of the error is reported at “preventDefault @ opl_GeoResource.axd?v=10.3.0:144”. It looks like OpenLayers code is now being treated as passive and is not stopping window event listeners.

In addition, we have noted this issue even with our basic test project were we add a bing map overlay and shapefilefeaturelayers to our map. In our main project this wouldn’t be a big deal if we didn’t have to content below our map; however, this is causing an annoying zooming/scrolling problem since we load in data after the matter below our map. Notice in the demo how the map moves up/down on the page based on zooming in or out.

Demo: https://www.screencast.com/t/RQKAHWED9

Are there any workarounds to get “preventDefault” method to not be treated as a passive target?

Thank you,
Neil

Hi Neil,

Thanks for your information.

Our developer research it today, it looks the passive feature is added in 2016 but the default value should be modified this year in browser.

We will fix it in our product, but because we are release new version, the code is frozen now so we provided the workaround, you should want put the JavaScript code into your web site, and please notice it should be added after the map div.

Here is the code:
WebForm1.zip (1.1 KB)

Wish that’s helpful.

Regards,

Ethan