Comparing version 0.10.0 to 0.11.0
22
index.js
"use_strict"; | ||
const bboxArea = require("./bbox-area.js"); | ||
const bboxArray = require("./bbox-array.js"); | ||
const bboxPoint = require("./bbox-point.js"); | ||
const bboxSize = require("./bbox-size.js"); | ||
const booleanContains = require("./boolean-contains.js"); | ||
const booleanContainsPoint = require("./boolean-contains-point.js"); | ||
const booleanIntersects = require("./boolean-intersects.js"); | ||
const calc = require("./calc.js"); | ||
const densePolygon = require("./dense-polygon.js"); | ||
const intersect = require("./intersect.js"); | ||
const merge = require("./merge.js"); | ||
const polygon = require("./polygon.js"); | ||
const densePolygon = require("./dense-polygon.js"); | ||
const preciseDensePolygon = require("./precise/dense-polygon.js"); | ||
const preciseDivide = require("./precise/divide.js"); | ||
const preciseReproject = require("./precise/reproject.js"); | ||
const reproject = require("./reproject.js"); | ||
@@ -12,2 +22,8 @@ const scale = require("./scale.js"); | ||
const bboxfns = { | ||
bboxArea, | ||
bboxArray, | ||
bboxPoint, | ||
bboxSize, | ||
booleanContains, | ||
booleanContainsPoint, | ||
booleanIntersects, | ||
@@ -17,3 +33,7 @@ calc, | ||
intersect, | ||
merge, | ||
polygon, | ||
preciseDensePolygon, | ||
preciseDivide, | ||
preciseReproject, | ||
reproject, | ||
@@ -20,0 +40,0 @@ scale |
{ | ||
"name": "bbox-fns", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"description": "Light-weight JavaScript Bounding Box Utility Functions", | ||
@@ -12,2 +12,3 @@ "main": "index.js", | ||
"bbox-size.js", | ||
"boolean-contains.js", | ||
"boolean-contains-point.js", | ||
@@ -14,0 +15,0 @@ "boolean-intersects.js", |
@@ -14,2 +14,3 @@ # bbox-fns: work in progress | ||
- [bboxPoint](#bboxPoint) | ||
- [booleanContains](#booleanContains) | ||
- [booleanContainsPoint](#booleanContainsPoint) | ||
@@ -66,2 +67,18 @@ - [booleanIntersects](#booleanIntersects) | ||
### booleanContains | ||
Check if a bounding box contains another | ||
```js | ||
import booleanContains from "bbox-fns/boolean-contains.js"; | ||
const western_hemisphere = [-180, -90, 0, 90]; | ||
const colorado = [-109.05378, 37.0057, -102.0665, 41.0443]; | ||
booleanContains(western_hemisphere, colorado); | ||
true | ||
// exclude bbox that extends to the exact edge | ||
booleanContains(western_hemisphere, [-10, -20, 0, 20], { exclusive: true }); | ||
false | ||
``` | ||
### booleanContainsPoint | ||
@@ -68,0 +85,0 @@ Check if a bounding box contains a point |
28061
21
443
243