Last active
March 23, 2016 11:58
-
-
Save nask0/6632f5540f1d617f5aab to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var LocHelper = (function() { | |
var locationHelper = locationHelper || {}; | |
locationHelper.coords = false; | |
locationHelper.domEl = document.getElementsByTagName("body"); | |
locationHelper.updateDomEl = function( innerHtml ) { | |
if( 'string' === typeof innerHtml ) { | |
locationHelper.domEl.innerHTML = innerHtml; | |
} | |
}; | |
locationHelper.getLocation = function() { | |
if (navigator.geolocation) { | |
navigator.geolocation.getCurrentPosition(showPosition, showError); | |
} else { | |
locationHelper.updateDomEl( 'Geolocation is not supported by this browser.' ); | |
} | |
}; | |
// @TODO : IMPLEMENT MORE | |
return locationHelper; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment