cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sgreb...@apache.org
Subject cordova-plugin-geolocation git commit: CB-8085 Fix geolocation plugin on Windows
Date Mon, 01 Dec 2014 07:38:14 GMT
Repository: cordova-plugin-geolocation
Updated Branches:
  refs/heads/master 7dc440053 -> e3f968599


CB-8085 Fix geolocation plugin on Windows


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/e3f96859
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/e3f96859
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/e3f96859

Branch: refs/heads/master
Commit: e3f9685993975cdc59283e4d5b0940cc293ed83b
Parents: 7dc4400
Author: sgrebnov <v-segreb@microsoft.com>
Authored: Wed Nov 26 23:24:51 2014 +0300
Committer: sgrebnov <v-segreb@microsoft.com>
Committed: Wed Nov 26 23:24:51 2014 +0300

----------------------------------------------------------------------
 src/windows/GeolocationProxy.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/e3f96859/src/windows/GeolocationProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/GeolocationProxy.js b/src/windows/GeolocationProxy.js
index bafff6d..9cab6a4 100644
--- a/src/windows/GeolocationProxy.js
+++ b/src/windows/GeolocationProxy.js
@@ -1,4 +1,4 @@
-/*
+/*
  * Copyright 2013 Research In Motion Limited.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -111,7 +111,7 @@ module.exports = {
             highAccuracy = args[1],
 
             onPositionChanged = function (e) {
-                success(createResult(e.position));
+                success(createResult(e.position), {keepCallback: true});
             },
 
             onStatusChanged = function (e) {
@@ -142,6 +142,14 @@ module.exports = {
                 Windows.Devices.Geolocation.PositionAccuracy.high :
                 Windows.Devices.Geolocation.PositionAccuracy.default;
 
+        if (cordova.platformId == 'windows' && WinJS.Utilities.isPhone) {
+            // on Windows Phone 8.1 'positionchanged' event fails with error below if movementThreshold
is not set
+            // JavaScript runtime error: Operation aborted
+            // You must set the MovementThreshold property or the ReportInterval property
before adding event handlers.
+            // WinRT information: You must set the MovementThreshold property or the ReportInterval
property before adding event handlers
+            loc.movementThreshold = loc.movementThreshold || 1; // 1 meter
+        }
+
         loc.addEventListener("positionchanged", onPositionChanged);
         loc.addEventListener("statuschanged", onStatusChanged);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message