New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

boundingbox

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boundingbox - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

16

BoundingBox.js
'use strict'
var GeoJSONBounds = require('geojson-bounds')
// define L, if Leaflet is not available (not not confuse Linter)

@@ -33,2 +35,14 @@ if (typeof L === 'undefined') {

// GeoJSON detected
if (bounds.type === 'Feature') {
var b = GeoJSONBounds.extent(bounds)
bounds = {
minlat: b[0],
minlon: b[1],
maxlat: b[2],
maxlon: b[3]
}
}
if ('bounds' in bounds) {

@@ -134,3 +148,3 @@ bounds = bounds.bounds

[ this.bounds.maxlat, this.bounds.maxlon ],
[ this.bounds.minlat, this.bounds.maxlat ],
[ this.bounds.minlat, this.bounds.maxlon ],
[ this.bounds.minlat, this.bounds.minlon ]

@@ -137,0 +151,0 @@ ]]

6

package.json
{
"dependencies": {},
"name": "boundingbox",
"description": "Implements bounding boxes with usual functions like intersects. Can convert from/to Leaflet bounds and GeoJSON.",
"version": "0.0.5",
"version": "0.0.6",
"main": "BoundingBox.js",

@@ -10,2 +9,5 @@ "directories": {

},
"dependencies": {
"geojson-bounds": "*"
},
"devDependencies": {

@@ -12,0 +14,0 @@ "browserify": "*",

@@ -26,2 +26,3 @@ # bounding-box

* A L.latLng object (using Leaflet)
* A GeoJSON feature

@@ -28,0 +29,0 @@ Example:

@@ -82,2 +82,14 @@ var assert = require('assert')

it('create from GeoJSON', function(done) {
var expected = {"minlat":48,"minlon":16,"maxlat":49,"maxlon":17}
var input = {"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[48,16],[49,16],[48.5,16.5],[49,17],[48,17],[48,16]]]}}
assert.deepEqual(
expected,
new BoundingBox(input).bounds
)
done()
})
if(typeof L != 'undefined')

@@ -190,3 +202,3 @@ it('create from Leaflet L.latLngBounds', function(done) {

var expected = {"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[48,16],[49,16],[49,17],[48,49],[48,16]]]}}
var expected = {"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[48,16],[49,16],[49,17],[48,17],[48,16]]]}}

@@ -193,0 +205,0 @@ assert.deepEqual(expected, bounds1.toGeoJSON())

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