BBox Date Line
![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)
![Standard - JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)
Modifies a BBox to fit within the bounds of the International Date Line.
Install
npm
$ npm install --save bbox-dateline
web browser ES5
<script src="https://unpkg.com/bbox-dateline/docs/bbox-dateline.min.js"></script>
Usage
var dateline = require('bbox-dateline')
dateline.bbox([190, 100, -200, -120])
API
Table of Contents
bbox
Modifies a BBox to fit within the bounds of the International Date Line.
Parameters
bbox
(BBox | FeatureCollection | Feature<any>) BBox [west, south, east, north] or GeoJSON Feature
Examples
dateline.bbox([190, 100, -200, -120])
Returns BBox valid BBox extent
center
Modifies a Center to fit within the bounds of the International Date Line.
Parameters
center
([number, number] | BBox | FeatureCollection | Feature<any>) Center [lng, lat], BBox [west, south, east, south] or GeoJSON Feature
Examples
dateline.center([190, 100])
Returns [number, number] valid center coordinate
latitude
Modifies a Latitude to fit within +/-90 degrees.
Parameters
Examples
dateline.latitude(100)
Returns number modified latitude
longitude
Modifies a Longitude to fit within +/-180 degrees.
Parameters
lng
number longitude to modify
Examples
dateline.longitude(190)
Returns number modified longitude