Skip to content

Instantly share code, notes, and snippets.

@kevbradwick
Created February 18, 2014 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevbradwick/9073945 to your computer and use it in GitHub Desktop.
Save kevbradwick/9073945 to your computer and use it in GitHub Desktop.
novel way of ie6 detection that doesn't rely on user agent sniffing
/**
* Property: mapTypes
* The types of map we're switching between
*/
mapTypes: (function() {
var div = document.createElement('div');
div.innerHTML = '<!--[if lte IE 6]><i></i><![endif]-->';
if (!!div.getElementsByTagName('i').length) {
return ['normal', 'satellite', 'terrain'];
}
return ['normal', 'satellite', 'hybrid'];
}()),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment