Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turf/center

Package Overview
Dependencies
Maintainers
4
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/center - npm Package Compare versions

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);

6

package.json
{
"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)&lt;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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc