How to use the cordova-plugin-device-orientation.CompassError.COMPASS_NOT_SUPPORTED function in cordova-plugin-device-orientation

To help you get started, we’ve selected a few cordova-plugin-device-orientation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github blefebvre / aem-phonegap-kitchen-sink / content-dev / src / main / content / jcr_root / content / phonegap / kitchen-sink / shell / _jcr_content / pge-app / app-content / phonegap / plugins / cordova-plugin-device-orientation / src / tizen / CompassProxy.js View on Github external
compassCallback = function (orientation) {
                var heading = 360 - orientation.alpha;

                if (compassReady) {
                    if (successCallback)
                        successCallback( new CompassHeading (heading, heading, 0, 0));
                    window.removeEventListener("deviceorientation", compassCallback, true);
                }
                compassReady = true;
            };
            compassReady = false; // workaround invalid first event value returned by WRT
            window.addEventListener("deviceorientation", compassCallback, true);
        }
        else {
            if (errorCallback)
                errorCallback(CompassError.COMPASS_NOT_SUPPORTED);
        }
    },
github apache / cordova-plugin-device-orientation / src / tizen / CompassProxy.js View on Github external
compassCallback = function (orientation) {
                var heading = 360 - orientation.alpha;

                if (compassReady) {
                    if (successCallback)
                        successCallback( new CompassHeading (heading, heading, 0, 0));
                    window.removeEventListener("deviceorientation", compassCallback, true);
                }
                compassReady = true;
            };
            compassReady = false; // workaround invalid first event value returned by WRT
            window.addEventListener("deviceorientation", compassCallback, true);
        }
        else {
            if (errorCallback)
                errorCallback(CompassError.COMPASS_NOT_SUPPORTED);
        }
    },
github apache / cordova-plugin-device-orientation / src / windows / CompassProxy.js View on Github external
setTimeout(function () {
                lose(CompassError.COMPASS_NOT_SUPPORTED);
            }, 0);
        } else {

cordova-plugin-device-orientation

Cordova Device Orientation Plugin

Apache-2.0
Latest version published 7 months ago

Package Health Score

68 / 100
Full package analysis