Add properties and other doc cleanup
This commit is contained in:
parent
c355c99cbd
commit
1787f5ec4f
39
lib/geo.js
39
lib/geo.js
|
@ -106,9 +106,12 @@ exports.GeoPoint = GeoPoint;
|
|||
* });
|
||||
* ```
|
||||
* @class GeoPoint
|
||||
* @param {Object} latlong Object with two Number properties: lat and long.
|
||||
* @prop {Number} lat
|
||||
* @prop {Number} lng
|
||||
* @property {Number} lat The latitude in degrees.
|
||||
* @property {Number} lng The longitude in degrees.
|
||||
*
|
||||
* @options {Object} Options Object with two Number properties: lat and long.
|
||||
* @property {Number} lat The latitude point in degrees. Range: -90 to 90.
|
||||
* @property {Number} lng The longitude point in degrees. Range: -90 to 90.
|
||||
*/
|
||||
|
||||
function GeoPoint(data) {
|
||||
|
@ -138,20 +141,18 @@ function GeoPoint(data) {
|
|||
assert(data.lat <= 90, 'lat must be <= 90');
|
||||
assert(data.lat >= -90, 'lat must be >= -90');
|
||||
|
||||
/**
|
||||
* @property {Number} lat The latitude point in degrees. Range: -90 to 90.
|
||||
*/
|
||||
this.lat = data.lat;
|
||||
|
||||
/**
|
||||
* @property {Number} lng The longitude point in degrees. Range: -90 to 90.
|
||||
*/
|
||||
this.lat = data.lat;
|
||||
this.lng = data.lng;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine the spherical distance between two GeoPoints.
|
||||
* Specify units of measurement with the 'type' property in options object. Type can be:
|
||||
*
|
||||
* @param {GeoPoint} pointA Point A
|
||||
* @param {GeoPoint} pointB Point B
|
||||
* @options {Object} options Options object with one key, 'type'. See below.
|
||||
* @property {String} type Unit of measurement, one of:
|
||||
*
|
||||
* - `miles` (default)
|
||||
* - `radians`
|
||||
* - `kilometers`
|
||||
|
@ -159,9 +160,6 @@ function GeoPoint(data) {
|
|||
* - `miles`
|
||||
* - `feet`
|
||||
* - `degrees`
|
||||
* @param {GeoPoint} pointA Point A
|
||||
* @param {GeoPoint} pointB Point B
|
||||
* @param {Object} options Options object; has one key, 'type', to specify the units of measurment (see above). Default is miles.
|
||||
*/
|
||||
|
||||
GeoPoint.distanceBetween = function distanceBetween(a, b, options) {
|
||||
|
@ -190,7 +188,16 @@ GeoPoint.distanceBetween = function distanceBetween(a, b, options) {
|
|||
* GeoPoint.distanceBetween(here, there, {type: 'miles'}) // 438
|
||||
* ```
|
||||
* @param {Object} point GeoPoint object to which to measure distance.
|
||||
* @param {Object} options Use type key to specify units of measurment (default is miles).
|
||||
* @options {Object} options Options object with one key, 'type'. See below.
|
||||
* @property {String} type Unit of measurement, one of:
|
||||
*
|
||||
* - `miles` (default)
|
||||
* - `radians`
|
||||
* - `kilometers`
|
||||
* - `meters`
|
||||
* - `miles`
|
||||
* - `feet`
|
||||
* - `degrees`
|
||||
*/
|
||||
|
||||
GeoPoint.prototype.distanceTo = function (point, options) {
|
||||
|
|
Loading…
Reference in New Issue