Feature Request: Add Gesture Handling Support for Open Street Maps Field

Support MB Builder Feature Request: Add Gesture Handling Support for Open Street Maps Field

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #47918
    Paweł WitkowskiPaweł Witkowski
    Participant

    We would like to request the addition of gesture handling support for the "Open Street Maps" field in MetaBox. This feature enhances usability, especially on touch devices, by preventing unintended map zooming while scrolling the page.

    A straightforward way to implement this is by integrating the Leaflet.GestureHandling package, which is available at:
    https://github.com/elmarquis/Leaflet.GestureHandling

    Proposed Implementation:

    Include the GestureHandling library in the relevant scripts.

    Modify the following files to enable gesture handling:

    File: /meta-box-aio/vendor/meta-box/meta-box/js/osm.js (Line 48)
    Before:
    this.map = L.map( this.canvas, { zoom: 14 } );

    After:
    this.map = L.map(this.canvas, { zoom: 14, gestureHandling: true });

    File: /meta-box-aio/vendor/meta-box/meta-box/js/osm-frontend.js (Line 21)
    Before:
    map = L.map( this, mapOptions );

    After:

    mapOptions.gestureHandling = true;
    map = L.map( this, mapOptions );

    This small addition would significantly improve the user experience on mobile and touch-enabled devices.
    Would it be possible to include this in a future update of MetaBox?
    Please let us know if you need further details.
    Thank you for your time and consideration!

    #47925
    PeterPeter
    Moderator

    Hello Pawel,

    Thanks for your feedback.

    I will forward this topic to the development team to consider supporting the GestureHandling feature for future updates.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.