Google Maps API v3 Disable Pinch to Zoom on iPad Safari

后端 未结 1 1383
醉酒成梦
醉酒成梦 2020-12-20 01:08

I am trying to figure out how to disable the default pinch to zoom functionality on the Google Maps API V3 with Javascript. I tried detecting the touchstart events on the do

相关标签:
1条回答
  • 2020-12-20 02:00

    I figured out a solution, since my project is full screen the following code did the trick.

    var tblock = function (e) {
        if (e.touches.length > 1) {
            e.preventDefault()
        }
    
        return false;
    }
    
    document.body.addEventListener("touchmove", tblock, true);
    
    0 讨论(0)
提交回复
热议问题