# bbox-dateline

> Modifies a BBox to fit within the bounds of the International Date Line

Latest version **1.2.1** (published 2017-06-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install bbox-dateline
pnpm add bbox-dateline
yarn add bbox-dateline
bun add bbox-dateline
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2017-06-02 |
| First published | 2017-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Denis Carriere |
| Maintainers | deniscarriere |
| Keywords | bbox, geojson, dateline, date, line |

## Links

- npm: https://www.npmjs.com/package/bbox-dateline
- npm.io page: https://npm.io/package/bbox-dateline

## Dependencies (2)

- [@turf/bbox](https://npm.io/package/@turf/bbox.md) ^3.13.0
- [@turf/center](https://npm.io/package/@turf/center.md) ^3.13.0

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2017-06-02
- 1.2.0 — 2017-05-29
- 1.1.1 — 2017-03-20
- 1.1.0 — 2017-03-20
- 1.0.3 — 2017-03-14
- 1.0.2 — 2017-03-14
- 1.0.1 — 2017-03-14
- 1.0.0 — 2017-03-14

## README

# BBox Date Line

[![Build Status](https://travis-ci.org/DenisCarriere/bbox-dateline.svg?branch=master)](https://travis-ci.org/DenisCarriere/bbox-dateline)
[![npm version](https://badge.fury.io/js/bbox-dateline.svg)](https://badge.fury.io/js/bbox-dateline)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/DenisCarriere/bbox-dateline/master/LICENSE)
[![Coverage Status](https://coveralls.io/repos/github/DenisCarriere/bbox-dateline/badge.svg?branch=master)](https://coveralls.io/github/DenisCarriere/bbox-dateline?branch=master)

[![Standard - JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

> Modifies a BBox to fit within 180° longitude & 90° latitude.

## Install

```bash
$ yarn add bbox-dateline
```

## Usage

```javascript
const dateline = require('bbox-dateline')
dateline.bbox([190, 100, -200, -120])
//= [-170, -80, 160, 60]
```

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

-   [bbox](#bbox)
-   [center](#center)
-   [latitude](#latitude)
-   [longitude](#longitude)

### bbox

Modifies a BBox to fit within the bounds of the International Date Line.

**Parameters**

-   `bbox` **(BBox | FeatureCollection | Feature&lt;any>)** BBox [west, south, east, north] or GeoJSON Feature

**Examples**

```javascript
dateline.bbox([190, 100, -200, -120])
//= [-170, -80, 160, 60]
```

Returns **BBox** valid BBox extent

### center

Modifies a Center to fit within the bounds of the International Date Line.

**Parameters**

-   `coord` **(\[[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)] | BBox | FeatureCollection | Feature&lt;any>)** Center [lng, lat], BBox [west, south, east, south] or GeoJSON Feature

**Examples**

```javascript
dateline.center([190, 100])
//= [-170, -80]
```

Returns **\[[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)]** valid center coordinate

### latitude

Modifies a Latitude to fit within +/-90 degrees.

**Parameters**

-   `lat` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** latitude to modify

**Examples**

```javascript
dateline.latitude(100)
//= -80
```

Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** modified latitude

### longitude

Modifies a Longitude to fit within +/-180 degrees.

**Parameters**

-   `lng` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** longitude to modify

**Examples**

```javascript
dateline.longitude(190)
//= -170
```

Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** modified longitude

---
_Source: https://npm.io/package/bbox-dateline · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
