Fixed up geolocation to use the native geolocation when available

This commit is contained in:
Joe Bowser 2010-07-15 16:55:00 -07:00
parent 9bf83337c9
commit ea1184cdd3

View File

@ -80,11 +80,8 @@ PhoneGap.addConstructor(function() {
origObj[funkList[v]] = proxyObj[funkList[v]];
}
}
// In case a native geolocation object exists, proxy the native one over to a diff object so that we can overwrite the native implementation.
if (typeof navigator.geolocation != 'undefined') {
navigator._geo = new Geolocation();
__proxyObj(navigator.geolocation, navigator._geo, ["setLocation", "getCurrentPosition", "watchPosition", "clearWatch", "setError", "start", "stop", "gotCurrentPosition"]);
} else {
// In the case of Android, we can use the Native Geolocation Object if it exists, so only load this on 1.x devices
if (typeof navigator.geolocation == 'undefined') {
navigator.geolocation = new Geolocation();
}
});
});