@turf/center
Advanced tools
Comparing version 4.1.0 to 4.2.0
88
index.js
@@ -1,3 +0,3 @@ | ||
var bbox = require('@turf/bbox'), | ||
point = require('@turf/helpers').point; | ||
var bbox = require('@turf/bbox'); | ||
var point = require('@turf/helpers').point; | ||
@@ -8,5 +8,4 @@ /** | ||
* @name center | ||
* @param {(Feature|FeatureCollection)} layer input features | ||
* @return {Feature<Point>} a Point feature at the absolute center point of all input features | ||
* @addToMap features, centerPt | ||
* @param {FeatureCollection|Feature<any>} layer input features | ||
* @returns {Feature<Point>} a Point feature at the absolute center point of all input features | ||
* @example | ||
@@ -37,65 +36,2 @@ * var features = { | ||
* } | ||
* }, { | ||
* "type": "Feature", | ||
* "properties": {}, | ||
* "geometry": { | ||
* "type": "Point", | ||
* "coordinates": [-97.516809, 35.465779] | ||
* } | ||
* }, { | ||
* "type": "Feature", | ||
* "properties": {}, | ||
* "geometry": { | ||
* "type": "Point", | ||
* "coordinates": [-97.515372, 35.467072] | ||
* } | ||
* }, { | ||
* "type": "Feature", | ||
* "properties": {}, | ||
* "geometry": { | ||
* "type": "Point", | ||
* "coordinates": [-97.509363, 35.463053] | ||
* } | ||
* }, { | ||
* "type": "Feature", | ||
* "properties": {}, | ||
* "geometry": { | ||
* "type": "Point", | ||
* "coordinates": [-97.511123, 35.466601] | ||
* } | ||
* }, { | ||
* "type": "Feature", | ||
* "properties": {}, | ||
* "geometry": { | ||
* "type": "Point", | ||
* "coordinates": [-97.518547, 35.469327] | ||
* } | ||
* }, { | ||
* "type": "Feature", | ||
* "properties": {}, | ||
* "geometry": { | ||
* "type": "Point", | ||
* "coordinates": [-97.519706, 35.469659] | ||
* } | ||
* }, { | ||
* "type": "Feature", | ||
* "properties": {}, | ||
* "geometry": { | ||
* "type": "Point", | ||
* "coordinates": [-97.517839, 35.466998] | ||
* } | ||
* }, { | ||
* "type": "Feature", | ||
* "properties": {}, | ||
* "geometry": { | ||
* "type": "Point", | ||
* "coordinates": [-97.508678, 35.464942] | ||
* } | ||
* }, { | ||
* "type": "Feature", | ||
* "properties": {}, | ||
* "geometry": { | ||
* "type": "Point", | ||
* "coordinates": [-97.514914, 35.463453] | ||
* } | ||
* } | ||
@@ -105,15 +41,9 @@ * ] | ||
* | ||
* var centerPt = turf.center(features); | ||
* centerPt.properties['marker-size'] = 'large'; | ||
* centerPt.properties['marker-color'] = '#000'; | ||
* var center = turf.center(features); | ||
* | ||
* var resultFeatures = features.features.concat(centerPt); | ||
* var result = { | ||
* "type": "FeatureCollection", | ||
* "features": resultFeatures | ||
* }; | ||
* | ||
* //=result | ||
* //addToMap | ||
* center.properties['marker-size'] = 'large'; | ||
* center.properties['marker-color'] = '#000'; | ||
* var addToMap = [features, center] | ||
*/ | ||
module.exports = function (layer) { | ||
@@ -120,0 +50,0 @@ var ext = bbox(layer); |
{ | ||
"name": "@turf/center", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"description": "turf center module", | ||
@@ -38,5 +38,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"@turf/bbox": "^4.1.0", | ||
"@turf/helpers": "^4.1.0" | ||
"@turf/bbox": "^4.2.0", | ||
"@turf/helpers": "^4.2.0" | ||
} | ||
} |
@@ -9,3 +9,3 @@ # @turf/center | ||
- `layer` **([Feature](http://geojson.org/geojson-spec.html#feature-objects) \| [FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects))** input features | ||
- `layer` **([FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects)<any>)** input features | ||
@@ -39,65 +39,2 @@ **Examples** | ||
} | ||
}, { | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [-97.516809, 35.465779] | ||
} | ||
}, { | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [-97.515372, 35.467072] | ||
} | ||
}, { | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [-97.509363, 35.463053] | ||
} | ||
}, { | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [-97.511123, 35.466601] | ||
} | ||
}, { | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [-97.518547, 35.469327] | ||
} | ||
}, { | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [-97.519706, 35.469659] | ||
} | ||
}, { | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [-97.517839, 35.466998] | ||
} | ||
}, { | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [-97.508678, 35.464942] | ||
} | ||
}, { | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [-97.514914, 35.463453] | ||
} | ||
} | ||
@@ -107,13 +44,8 @@ ] | ||
var centerPt = turf.center(features); | ||
centerPt.properties['marker-size'] = 'large'; | ||
centerPt.properties['marker-color'] = '#000'; | ||
var center = turf.center(features); | ||
var resultFeatures = features.features.concat(centerPt); | ||
var result = { | ||
"type": "FeatureCollection", | ||
"features": resultFeatures | ||
}; | ||
//=result | ||
//addToMap | ||
center.properties['marker-size'] = 'large'; | ||
center.properties['marker-color'] = '#000'; | ||
var addToMap = [features, center] | ||
``` | ||
@@ -120,0 +52,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
5583
60
76
Updated@turf/bbox@^4.2.0
Updated@turf/helpers@^4.2.0