@turf/rhumb-bearing
Advanced tools
Comparing version 4.5.2 to 4.6.0
32
index.js
@@ -16,22 +16,4 @@ // https://en.wikipedia.org/wiki/Rhumb_line | ||
* @example | ||
* var point1 = { | ||
* "type": "Feature", | ||
* "properties": { | ||
* "marker-color": "#F00" | ||
* }, | ||
* "geometry": { | ||
* "type": "Point", | ||
* "coordinates": [-75.343, 39.984] | ||
* } | ||
* }; | ||
* var point2 = { | ||
* "type": "Feature", | ||
* "properties": { | ||
* "marker-color": "#00F" | ||
* }, | ||
* "geometry": { | ||
* "type": "Point", | ||
* "coordinates": [-75.534, 39.123] | ||
* } | ||
* }; | ||
* var point1 = turf.point([-75.343, 39.984], {"marker-color": "#F00"}); | ||
* var point2 = turf.point([-75.534, 39.123], {"marker-color": "#00F"}); | ||
* | ||
@@ -41,5 +23,5 @@ * var bearing = turf.rhumbBearing(point1, point2); | ||
* //addToMap | ||
* var addToMap = [point1, point2] | ||
* point1.properties.bearing = bearing | ||
* point2.properties.bearing = bearing | ||
* var addToMap = [point1, point2] | ||
*/ | ||
@@ -56,8 +38,6 @@ module.exports = function (start, end, final) { | ||
var bear360; | ||
if (final) { | ||
bear360 = destination.rhumbBearingTo(origin); | ||
} else { | ||
bear360 = origin.rhumbBearingTo(destination); | ||
} | ||
if (final) bear360 = destination.rhumbBearingTo(origin); | ||
else bear360 = origin.rhumbBearingTo(destination); | ||
var bear180 = (bear360 > 180) ? -(360 - bear360) : bear360; | ||
@@ -64,0 +44,0 @@ |
{ | ||
"name": "@turf/rhumb-bearing", | ||
"version": "4.5.2", | ||
"version": "4.6.0", | ||
"description": "turf rhumb-bearing module", | ||
@@ -38,4 +38,4 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@turf/destination": "^4.5.2", | ||
"@turf/helpers": "^4.5.2", | ||
"@turf/destination": "^4.6.0", | ||
"@turf/helpers": "^4.6.0", | ||
"benchmark": "^2.1.4", | ||
@@ -46,5 +46,5 @@ "tape": "^4.6.3", | ||
"dependencies": { | ||
"@turf/invariant": "^4.5.2", | ||
"@turf/invariant": "^4.6.0", | ||
"geodesy": "1.1.1" | ||
} | ||
} |
@@ -17,22 +17,4 @@ # @turf/rhumb-bearing | ||
```javascript | ||
var point1 = { | ||
"type": "Feature", | ||
"properties": { | ||
"marker-color": "#F00" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [-75.343, 39.984] | ||
} | ||
}; | ||
var point2 = { | ||
"type": "Feature", | ||
"properties": { | ||
"marker-color": "#00F" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [-75.534, 39.123] | ||
} | ||
}; | ||
var point1 = turf.point([-75.343, 39.984], {"marker-color": "#F00"}); | ||
var point2 = turf.point([-75.534, 39.123], {"marker-color": "#00F"}); | ||
@@ -42,5 +24,5 @@ var bearing = turf.rhumbBearing(point1, point2); | ||
//addToMap | ||
var addToMap = [point1, point2] | ||
point1.properties.bearing = bearing | ||
point2.properties.bearing = bearing | ||
var addToMap = [point1, point2] | ||
``` | ||
@@ -47,0 +29,0 @@ |
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
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
6526
46
54
Updated@turf/invariant@^4.6.0