Skip to content
Permalink
Browse files
added Coordinates class & updated require path to Coordinates class
  • Loading branch information
hermwong committed May 15, 2013
1 parent 5a901e1 commit 317b235367661f78e2bfc1362d401b5fabf493a2
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
@@ -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;
@@ -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) {

0 comments on commit 317b235

Please sign in to comment.