You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by he...@apache.org on 2013/05/15 20:34:44 UTC

[1/2] git commit: update require path to Position & PositionError classes

Updated Branches:
  refs/heads/master 25be2f27a -> 317b23536


update require path to Position & PositionError classes


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/5a901e1b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/5a901e1b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/5a901e1b

Branch: refs/heads/master
Commit: 5a901e1bb26c3cf2f1f645f98193cc0fd2bc1e07
Parents: 25be2f2
Author: hermwong <he...@gmail.com>
Authored: Tue May 14 14:21:50 2013 -0700
Committer: hermwong <he...@gmail.com>
Committed: Tue May 14 14:21:50 2013 -0700

----------------------------------------------------------------------
 www/geolocation.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/5a901e1b/www/geolocation.js
----------------------------------------------------------------------
diff --git a/www/geolocation.js b/www/geolocation.js
index 6af92ca..0ea7046 100644
--- a/www/geolocation.js
+++ b/www/geolocation.js
@@ -22,8 +22,8 @@
 var argscheck = require('cordova/argscheck'),
     utils = require('cordova/utils'),
     exec = require('cordova/exec'),
-    PositionError = require('cordova/plugin/PositionError'),
-    Position = require('cordova/plugin/Position');
+    PositionError = require('org.apache.cordova.core.GeoBroker.PositionError'),
+    Position = require('org.apache.cordova.core.GeoBroker.Position');
 
 var timers = {};   // list of timers in use
 


[2/2] git commit: added Coordinates class & updated require path to Coordinates class

Posted by he...@apache.org.
added Coordinates class & updated require path to Coordinates class


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/317b2353
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/317b2353
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/317b2353

Branch: refs/heads/master
Commit: 317b235367661f78e2bfc1362d401b5fabf493a2
Parents: 5a901e1
Author: hermwong <he...@gmail.com>
Authored: Wed May 15 11:34:32 2013 -0700
Committer: hermwong <he...@gmail.com>
Committed: Wed May 15 11:34:32 2013 -0700

----------------------------------------------------------------------
 www/Coordinates.js |   69 +++++++++++++++++++++++++++++++++++++++++++++++
 www/Position.js    |    2 +-
 2 files changed, 70 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/317b2353/www/Coordinates.js
----------------------------------------------------------------------
diff --git a/www/Coordinates.js b/www/Coordinates.js
new file mode 100644
index 0000000..84fdd5b
--- /dev/null
+++ b/www/Coordinates.js
@@ -0,0 +1,69 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/**
+ * This class contains position information.
+ * @param {Object} lat
+ * @param {Object} lng
+ * @param {Object} alt
+ * @param {Object} acc
+ * @param {Object} head
+ * @param {Object} vel
+ * @param {Object} altacc
+ * @constructor
+ */
+var Coordinates = function(lat, lng, alt, acc, head, vel, altacc) {
+    /**
+     * The latitude of the position.
+     */
+    this.latitude = lat;
+    /**
+     * The longitude of the position,
+     */
+    this.longitude = lng;
+    /**
+     * The accuracy of the position.
+     */
+    this.accuracy = acc;
+    /**
+     * The altitude of the position.
+     */
+    this.altitude = (alt !== undefined ? alt : null);
+    /**
+     * The direction the device is moving at the position.
+     */
+    this.heading = (head !== undefined ? head : null);
+    /**
+     * The velocity with which the device is moving at the position.
+     */
+    this.speed = (vel !== undefined ? vel : null);
+
+    if (this.speed === 0 || this.speed === null) {
+        this.heading = NaN;
+    }
+
+    /**
+     * The altitude accuracy of the position.
+     */
+    this.altitudeAccuracy = (altacc !== undefined) ? altacc : null;
+};
+
+module.exports = Coordinates;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/317b2353/www/Position.js
----------------------------------------------------------------------
diff --git a/www/Position.js b/www/Position.js
index 0f21ba3..dec18f6 100644
--- a/www/Position.js
+++ b/www/Position.js
@@ -19,7 +19,7 @@
  *
 */
 
-var Coordinates = require('cordova/plugin/Coordinates');
+var Coordinates = require('org.apache.cordova.core.GeoBroker.PositionError.Coordinates');
 
 var Position = function(coords, timestamp) {
     if (coords) {