Comparing version 1.3.5 to 2.0.14
@@ -8,5 +8,2 @@ { | ||
}, | ||
"bin": { | ||
"geolib": "./geolib.js" | ||
}, | ||
"repository": { | ||
@@ -27,12 +24,15 @@ "type": "git", | ||
"phantomjs": "~1.8.0", | ||
"grunt-jslint": "~1.0.0" | ||
"grunt-jslint": "~1.0.0", | ||
"time-grunt": "~0.3.1", | ||
"load-grunt-tasks": "~0.4.0" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "LGPL", | ||
"url": "http://www.gnu.org/licenses/lgpl-3.0.txt" | ||
"type": "MIT", | ||
"url": "http://opensource.org/licenses/MIT" | ||
} | ||
], | ||
"files": [ | ||
"geolib.js" | ||
"dist/geolib.js", | ||
"dist/geolib.elevation.js" | ||
], | ||
@@ -43,3 +43,7 @@ "description": "Library to perform geo specific tasks", | ||
"geo", | ||
"distance" | ||
"distance", | ||
"geojson", | ||
"geospatial", | ||
"lbs", | ||
"location" | ||
], | ||
@@ -49,4 +53,4 @@ "scripts": { | ||
}, | ||
"version": "1.3.5", | ||
"main": "./geolib" | ||
} | ||
"version": "2.0.14", | ||
"main": "dist/geolib.js" | ||
} |
@@ -1,5 +0,5 @@ | ||
# Geolib | ||
# Geolib v2.0.14 | ||
[![Build Status](https://secure.travis-ci.org/manuelbieh/Geolib.png?branch=master)](http://travis-ci.org/manuelbieh/Geolib) | ||
A small library to provide some basic geo functions like distance calculation, conversion of decimal coordinates to sexagesimal and vice versa, etc. | ||
Library to provide basic geospatial operations like distance calculation, conversion of decimal coordinates to sexagesimal and vice versa, etc. | ||
@@ -14,3 +14,3 @@ [View demo](http://www.manuel-bieh.de/publikationen/scripts/geolib/demo.html) | ||
Takes 2 or 3. First 2 arguments must be an object with a latitude and a longitude property (e.g. {latitude: 52.518611, longitude: 13.408056}). Coordinates can be in sexagesimal or decimal format. 3rd argument is accuracy (in meters). So a calculated distance of 1248 meters with an accuracy of 100 is returned as 1200. | ||
Takes 2 or 3 arguments. First 2 arguments must be an object with latitude and a longitude properties (e.g. `{latitude: 52.518611, longitude: 13.408056}`). Coordinates can be in sexagesimal or decimal format. 3rd argument is accuracy (in meters). So a calculated distance of 1248 meters with an accuracy of 100 is returned as `1200` (accuracy 10 = `1250` etc.). | ||
@@ -68,2 +68,3 @@ Return value is always an integer and represents the distance in meters. | ||
geolib.getCenter(spots); | ||
geolib.getCenter([ | ||
@@ -135,3 +136,3 @@ {latitude: 52.516272, longitude: 13.377722}, | ||
<h3>geolib.findNearest(object latlng, mixed coords[, int offset])</h3> | ||
<h3>geolib.findNearest(object latlng, mixed coords[[, int offset], int limit])</h3> | ||
@@ -160,3 +161,3 @@ Finds the nearest coordinate to a reference coordinate. | ||
Returns the length of the path in kilometers | ||
Returns the length of the path in meters | ||
@@ -173,6 +174,5 @@ <h4>Example</h4> | ||
<h3>geolib.getSpeed(coords, coords[, options])</h3> | ||
Calculates the speed between to points within a given time span. | ||
Calculates the speed between two points within a given time span. | ||
@@ -190,4 +190,2 @@ Returns the speed in <em>options.unit</em> (default is km/h). | ||
<h3>geolib.convertUnit(string unit, float distance[, int round])</h3> | ||
@@ -231,3 +229,2 @@ | ||
<h4>Example</h4> | ||
@@ -237,9 +234,37 @@ | ||
<h3>geolib.latitude(object latlng)</h3> | ||
<h3>geolib.longitude(object latlng)</h3> | ||
<h3>geolib.elevation(object latlng)</h3> | ||
<h3>geolib.useDecimal(mixed coordinate)</h3> | ||
Returns the latitude/longitude/elevation for a given point and converts it to decimal. | ||
Works with: | ||
- latitude: `latitude`, `lat`, 0 (GeoJSON array) | ||
- longitude: `longitude`, `lng`, `lon`, 1 (GeoJSON array) | ||
- elevation: `elevation`, `elev`, `alt`, `altitude`, 2 (GeoJSON array) | ||
<h4>Examples</h4> | ||
`geolib.latitude({lat: 51.49611, lng: 7.38896}); // -> 51.49611` | ||
`geolib.longitude({lat: 51.49611, lng: 7.38896}); // -> 7.38896` | ||
<h3>geolib.useDecimal(mixed latlng)</h3> | ||
Checks if a coordinate is already in decimal format and, if not, converts it to | ||
<h4>Example</h4> | ||
<pre>geolib.useDecimal("51° 29' 46\" N"); // -> 51.59611111 | ||
geolib.useDecimal(51.59611111) // -> 51.59611111</pre> | ||
<h2>Changelog</h2> | ||
<h3>v2.0.0+beta1</h3> | ||
- Dropped support for IE6, IE7, IE8 | ||
- Added new methods `geolib.latitude()`, `geolib.longitude()`, `geolib.elevation()` to get latitude, longitude or elevation of points. Will be converted to decimal format automatically | ||
- Added new method `geolib.extend()` to extend geolib object | ||
- Added support for GeoJSON format (`[lon, lat, elev]`) | ||
- Added property `geolib.version` to query the currently used version | ||
- Moved `geolib.elevation` to an optional module (`geolib.elevation.js`) | ||
- Using `Object.create(Geolib.prototype)` instead of object literal `{}` | ||
- New folder structure: compiled `geolib.js` can now be found in `dist/` instead of root dir | ||
- Improved Grunt build task |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43161
4
1024
262
13
1