Skip to content

Instantly share code, notes, and snippets.

@jraanamo
Last active May 16, 2016 09:55
Show Gist options
  • Save jraanamo/9a70c45df1324508a2ec34ea4d06ab72 to your computer and use it in GitHub Desktop.
Save jraanamo/9a70c45df1324508a2ec34ea4d06ab72 to your computer and use it in GitHub Desktop.
// onSuccess Callback
// This method accepts a Position object, which contains the
// current GPS coordinates
//
var onSuccess = function(position) {
alert('Latitude: ' + position.coords.latitude + '\n' +
'Longitude: ' + position.coords.longitude + '\n' +
'Altitude: ' + position.coords.altitude + '\n' +
'Accuracy: ' + position.coords.accuracy + '\n' +
'Heading: ' + position.coords.heading + '\n' +
'floor: ' + position.coords.floor + '\n' +
'Timestamp: ' + position.timestamp + '\n');
};
// onError Callback receives a PositionError object
//
function onError(error) {
alert('code: ' + error.code + '\n' +
'message: ' + error.message + '\n');
}
IndoorAtlas.getCurrentPosition(onSuccess, onError);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment