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

Implements bounding boxes with usual functions like intersects. Can convert from/to Leaflet bounds and GeoJSON.

  • 1.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
206
decreased by-25.9%
Maintainers
1
Weekly downloads
 
Created
Source

bounding-box

Implements bounding boxes with usual functions like intersects. Can convert from/to Leaflet bounds and GeoJSON.

Usage

Browser

Include dist-file via script src:

<script src='node_module/boundingbox/dist/boundingbox.js'>

NodeJS

var BoundingBox = require('boundingbox')

API

Constructor: new BoundingBox(data)

Creates a bounding box object.

Data can be one of the following:

  • Min/max coordinates: { minlat: 48.123, minlon: 16.23, maxlat: 49.012, maxlon: 16.367 }
  • Lat/lon coordinates: { lat: 48.5, lon: 16.5 } or { lat: 48.5, lng: 16.5 } or { latitude: 48.5, longitude: 16.5 }
  • A BoundingBox object to create a copy
  • A L.latLngBounds object (using Leaflet)
  • A L.latLng object (using Leaflet)
  • A GeoJSON feature

Example:

var bbox = new BoundingBox({ minlat: 48.123, minlon: 16.23, maxlat: 49.012, maxlon: 16.367 })

Find the full documentation in the jsdoc. You can re-generate the documentation with npm run doc.

Tests

To run tests with nodejs, just call npm run test

To run tests in a browser, call npm run build-test or npm run watch-test (with debug symbols; listening for changes and auto-recompile) first (which will create all_tests.js) and then open the file test.html in your favorite browser.

Keywords

FAQs

Package last updated on 23 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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