Prevent zoom on desktop

Hello, Is there a way to prevent the map from zooming in and out on desktop when scrolling on the page the widget’s on?

This script should do the trick:

document.addEventListener(
  'wheel',
  (e) => {
    if (e.target.closest('[class*="maplibregl-canvas-container"]')) {
      e.stopImmediatePropagation();
    }
  },
  true
);

Please add it to the Custom JS field on the Settings tab of your widget’s settings and let me know how it worked :slightly_smiling_face:

This worked perfectly, thank you! Is there a way to lower the widget’s height as well?

Sure, here isthe code that should be to the Custom CSS field on the Style tab of your widget’s settings:

.global-styles,
[class*="widget__Container-sc"] {
height: 600px !important;
}

I’m having trouble getting this to work. Any additional advice would be greatly appreciated!

The code didn’t work because there was } missing in the code above. I’ve added } closing the mobile styles and the code changing the height worked:


Let me know if you have any questions left. I’ll be happy to assist :slightly_smiling_face: