Repository: cordova-plugin-geolocation Updated Branches: refs/heads/master a6da270a0 -> e8c921af3
Using a fallback epsilon in case Number.EPSILON is not defined. 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/e8c921af Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/e8c921af Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/e8c921af Branch: refs/heads/master Commit: e8c921af320a7ca67cde2533db3125759d5e133a Parents: a6da270 Author: Dmitry Blotsky <[email protected]> Authored: Mon Feb 15 13:45:59 2016 -0800 Committer: Dmitry Blotsky <[email protected]> Committed: Mon Feb 15 13:45:59 2016 -0800 ---------------------------------------------------------------------- src/windows/GeolocationProxy.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/e8c921af/src/windows/GeolocationProxy.js ---------------------------------------------------------------------- diff --git a/src/windows/GeolocationProxy.js b/src/windows/GeolocationProxy.js index 9670e4f..93adef9 100644 --- a/src/windows/GeolocationProxy.js +++ b/src/windows/GeolocationProxy.js @@ -18,6 +18,9 @@ var PositionError = require('./PositionError'); var callbacks = {}; var locs = {}; +// constants +var FALLBACK_EPSILON = 0.001; + function ensureAndCreateLocator() { var deferral; @@ -162,7 +165,11 @@ module.exports = { // 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 = Number.EPSILON; + if (Number.EPSILON) { + loc.movementThreshold = Number.EPSILON; + } else { + loc.movementThreshold = FALLBACK_EPSILON; + } } loc.addEventListener("positionchanged", onPositionChanged); @@ -190,4 +197,4 @@ module.exports = { } }; -require("cordova/exec/proxy").add("Geolocation", module.exports); \ No newline at end of file +require("cordova/exec/proxy").add("Geolocation", module.exports); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
