Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.0, 2.6.0
-
None
-
Any
Description
CompassError.js PositionError.js do not define the error constants on the prototype of the object. Hence the constants are not passed into the error function as specified in the W3C document http://dev.w3.org/geo/api/spec-source.html#position_error_interface (see: interface PositionError { const unsigned short PERMISSION_DENIED = 1; ...)
Fix: define in the library PositionError.js and Compass.js constants additionally like this:
PositionError.prototype.PERMISSION_DENIED = 1;
https://github.com/apache/incubator-cordova-js/blob/master/lib/common/plugin/PositionError.js#L34
https://github.com/apache/incubator-cordova-js/blob/master/lib/common/plugin/CompassError.js#L31
W3C compatible code is:
positionError = function(gpsError)
{
switch(gpsError.code)
{
case gpsError.PERMISSION_DENIED:
errorMessage = "Access to GPS denied!";
break;
...