V8: The "preventDefault" is true for touchstart and touchend events in BingMap even when panning is disabled. RRS feed

  • Question

  • In BingMaps options, I set "disablePanning: true" to disable the map panning for my mobile users. But it causes problems below:

    1. If user wants to scroll the page in mobile, it doesn't work if the touch starts from inside the map. I think the touch events shouldn't be "preventDefault" if panning is disabled.

    2. It blocks the map's onclick event to be triggered. Since the touch event is "preventDefault", the default behavior of onclick event won't be triggered. I had some logic to re-enable the panning when user click the map on mobile devices. Although I can listen to touchend event myself but I think it can be and should be fixed from BingMap side regarding the first issue.

    Monday, June 26, 2017 6:22 AM


  • This is working as expected. Click events work fine when panning is disabled. The reason why the map doesn't scroll when you swipe the map as zooming is still enabled. The map doesn't zoom unless there are two touch points, but it has to block the default behavior in order to work. It can't do this on the fly as the initial touch point would never be captured.

    [Blog] [twitter] [LinkedIn]

    Monday, July 24, 2017 11:22 PM