My question is about Javascript. I have a Callback function which receives a Position object on a successful callback.
The problem is that when I try to set the prop
You can implement a helper method like flowing:
var LocationHelper = function() {};
LocationHelper.prototype.getLocation = function(callback) {
navigator.geolocation.getCurrentPosition(onSuccess, onError);
function onSuccess(pos) {
callback({
pos: pos
});
}
function onError(message) {
callback({
message: message
});
}
};