Skip to content

Instantly share code, notes, and snippets.

@sealucky7
Created April 11, 2017 18:26
Show Gist options
  • Save sealucky7/1562981cce8cfdf42cf7871013c2f02d to your computer and use it in GitHub Desktop.
Save sealucky7/1562981cce8cfdf42cf7871013c2f02d to your computer and use it in GitHub Desktop.
// Add var
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
Opera: function() {
return navigator.userAgent.match(/Opera Mini/i);
},
Windows: function() {
return navigator.userAgent.match(/IEMobile/i);
},
any: function() {
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
}
};
// After initialization map add
if(isMobile.any()){
nameMap.behaviors.disable('drag');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment