mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-01 02:12:58 +08:00
Fixed up geolocation to use the native geolocation when available
This commit is contained in:
parent
9bf83337c9
commit
ea1184cdd3
@ -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();
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user