@turf/centroid
Advanced tools
Comparing version 4.1.0 to 4.2.0
20
index.js
@@ -14,3 +14,3 @@ var each = require('@turf/meta').coordEach; | ||
* @example | ||
* var poly = { | ||
* var polygon = { | ||
* "type": "Feature", | ||
@@ -20,20 +20,10 @@ * "properties": {}, | ||
* "type": "Polygon", | ||
* "coordinates": [[ | ||
* [105.818939,21.004714], | ||
* [105.818939,21.061754], | ||
* [105.890007,21.061754], | ||
* [105.890007,21.004714], | ||
* [105.818939,21.004714] | ||
* ]] | ||
* "coordinates": [[[-81, 41], [-88, 36], [-84, 31], [-80, 33], [-77, 39], [-81, 41]]] | ||
* } | ||
* }; | ||
* | ||
* var centroidPt = turf.centroid(poly); | ||
* var centroid = turf.centroid(polygon); | ||
* | ||
* var result = { | ||
* "type": "FeatureCollection", | ||
* "features": [poly, centroidPt] | ||
* }; | ||
* | ||
* //=result | ||
* //addToMap | ||
* var addToMap = [polygon, centroid] | ||
*/ | ||
@@ -40,0 +30,0 @@ module.exports = function (features) { |
{ | ||
"name": "@turf/centroid", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"description": "turf centroid module", | ||
@@ -37,5 +37,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"@turf/meta": "^4.1.0", | ||
"@turf/helpers": "^4.1.0" | ||
"@turf/meta": "^4.2.0", | ||
"@turf/helpers": "^4.2.0" | ||
} | ||
} |
@@ -17,3 +17,3 @@ # @turf/centroid | ||
```javascript | ||
var poly = { | ||
var polygon = { | ||
"type": "Feature", | ||
@@ -23,20 +23,10 @@ "properties": {}, | ||
"type": "Polygon", | ||
"coordinates": [[ | ||
[105.818939,21.004714], | ||
[105.818939,21.061754], | ||
[105.890007,21.061754], | ||
[105.890007,21.004714], | ||
[105.818939,21.004714] | ||
]] | ||
"coordinates": [[[-81, 41], [-88, 36], [-84, 31], [-80, 33], [-77, 39], [-81, 41]]] | ||
} | ||
}; | ||
var centroidPt = turf.centroid(poly); | ||
var centroid = turf.centroid(polygon); | ||
var result = { | ||
"type": "FeatureCollection", | ||
"features": [poly, centroidPt] | ||
}; | ||
//=result | ||
//addToMap | ||
var addToMap = [polygon, centroid] | ||
``` | ||
@@ -43,0 +33,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
4757
45
58
Updated@turf/helpers@^4.2.0
Updated@turf/meta@^4.2.0