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

@mapbox/extent

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapbox/extent

a geographic extent object

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
232K
decreased by-3.44%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

extent

A simple geographical extent.

api

extent()

Create a new extent object

extent([w, s, e, n])

Create a new extent object, given bounds as an array.

extent.include([lon, lat])

Expand the extent to include a lon, lat point.

extent.union([w, s, e, n] or other extent)

Expand the extent to include another extent.

extent.equals([w, s, e, n] or other extent)

Whether this extent is exactly equal to another.

extent.bbox()

Get the extent's value. null if no points have been included yet. Order is [WSEN] to match the GeoJSON standard.

extent.center()

Get the centerpoint of the extent as a [longitude, latitude] array.

extent.polygon()

Get the extent as a GeoJSON Polygon geometry object.

extent.contains([lon, lat])

Returns true if this extent contains the given point, and false if not. Points on the boundary of the extent are considered to be contained. If the extent is invalid, returns null.

extent.contains()

Returns a function that evaluates whether points are contained in the extent - same behavior as .contains([lon, lat]). This pre-compiles the function with the current extent values, yielding a roughly 3x speedup.

Keywords

FAQs

Package last updated on 02 Dec 2016

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