Created
October 5, 2010 17:13
-
-
Save johnboxall/611920 to your computer and use it in GitHub Desktop.
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
// BlackBerry Geolocation. Tested w/ 4.6.0.297. | |
// http://docs.blackberry.com/en/developers/deliverables/1143/browser_devguide.pdf | |
if (window.blackberry && blackberry.location && blackberry.location.GPSSupported) { | |
var AUTONOMOUS_AID_MODE = 2; | |
function win() { | |
clearTimeout(failTimeoutId); | |
blackberry.location.removeLocationUpdate(win); | |
alert(blackberry.location.latitude + " : " + blackberry.location.longitude); | |
} | |
function fail() { | |
blackberry.location.removeLocationUpdate(win); | |
alert("Couldn't find your location."); | |
} | |
blackberry.location.onLocationUpdate(win); | |
blackberry.location.setAidMode(AUTONOMOUS_AID_MODE); | |
blackberry.location.refreshLocation(); | |
var failTimeoutId = setTimeout(fail, 1000*30); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment