From ea1184cdd3664a93f6eb7512589b2c7e82a7f6c1 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Thu, 15 Jul 2010 16:55:00 -0700 Subject: [PATCH] Fixed up geolocation to use the native geolocation when available --- framework/assets/js/geolocation.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/framework/assets/js/geolocation.js b/framework/assets/js/geolocation.js index 68d069a9..19fb1ffa 100644 --- a/framework/assets/js/geolocation.js +++ b/framework/assets/js/geolocation.js @@ -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(); } -}); \ No newline at end of file +});