Created
October 8, 2016 15:18
-
-
Save sujoyu/c51d01be7c5b1d300656fb0af261c8ae to your computer and use it in GitHub Desktop.
Google Maps Scripts API bug fix code on iOS 10.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
function ios_ver (){ | |
var ios_ua = navigator.userAgent; | |
if( ios_ua.indexOf("iPhone") > 0 ) { | |
ios_ua.match(/iPhone OS (\w+)/g); | |
var version = RegExp.$1.split("_")[0]; | |
return version; | |
} | |
} | |
if (ios_ver() === '10') { | |
window.__Touch = window.Touch; | |
window.Touch = function(init) { | |
this.target = init.target; | |
this.identifier = init.identifier; | |
this.clientX = init.clientX; | |
this.clientY = init.clientY; | |
this.pageX = init.pageX; | |
this.pageY = init.pageY; | |
this.screenX = init.screenX; | |
this.screenY = init.screenY; | |
} | |
window.Touch.prototype = Object.create(window.__Touch.prototype); | |
window.Touch.prototype.constructor = window.Touch; | |
window.__TouchEvent = window.TouchEvent; | |
window.TouchEvent = null; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Worked like a charm. Thank you!