Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 91802101AE for ; Sun, 18 Aug 2013 18:09:55 +0000 (UTC) Received: (qmail 83777 invoked by uid 500); 18 Aug 2013 18:09:55 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 83391 invoked by uid 500); 18 Aug 2013 18:09:53 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 83287 invoked by uid 99); 18 Aug 2013 18:09:50 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Aug 2013 18:09:50 +0000 Date: Sun, 18 Aug 2013 18:09:50 +0000 (UTC) From: "William Cheung (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CB-4610) locationerror event does not contain the three constants (TIMEOUT, PERMISSION_DENIED, POSITION_UNAVAILABLE) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 William Cheung created CB-4610: ---------------------------------- Summary: locationerror event does not contain the three constants (TIMEOUT, PERMISSION_DENIED, POSITION_UNAVAILABLE) Key: CB-4610 URL: https://issues.apache.org/jira/browse/CB-4610 Project: Apache Cordova Issue Type: Bug Components: Plugin Geolocation Affects Versions: 3.0.0, 2.9.0, 2.5.0 Environment: Mac Mountain Lion, iOS (any version) Reporter: William Cheung Assignee: Steve Gill In the PositionError code, three constants were defined. However, they are not passed back in getCurrentPosition's code below: var fail = function(e) { clearTimeout(timeoutTimer.timer); timeoutTimer.timer = null; var err = new PositionError(e.code, e.message); if (errorCallback) { errorCallback(err); } }; This is due to PositionError. wouldn't be available in "err" when you instantiate (or new) PositionError. Try to check the value of "err.TIMEOUT", for example, and you'll get undefined. This works if you are in a browser not using this plugin. One way to fix it is change the PositionError code to below: var PositionError = function(code, message) { this.PERMISSION_DENIED = PositionError.PERMISSION_DENIED; this.POSITION_UNAVAILABLE = PositionError.POSITION_UNAVAILABLE; this.TIMEOUT = PositionError.TIMEOUT; this.code = code || null; this.message = message || ''; }; PositionError.PERMISSION_DENIED = 1; PositionError.POSITION_UNAVAILABLE = 2; PositionError.TIMEOUT = 3; -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira