# mercator-projection

> Translate latitude and longitude values into 'world' coordinates as used by the Google Map API.

Latest version **0.0.2** (published 2014-06-13) · 0 weekly downloads

## Install

```sh
npm install mercator-projection
pnpm add mercator-projection
yarn add mercator-projection
bun add mercator-projection
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2014-06-13 |
| First published | 2014-06-13 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Google |
| Maintainers | zacbarton |
| Keywords | mercator, projection, map, google, googlemaps, transformations |

## Links

- npm: https://www.npmjs.com/package/mercator-projection
- Repository: https://github.com/zacbarton/node-mercator-projection
- Issues: https://github.com/zacbarton/node-mercator-projection/issues
- npm.io page: https://npm.io/package/mercator-projection

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2014-06-13
- 0.0.1 — 2014-06-13

## README

mercator-projection
========

Whenever the Google Maps API needs to translate a location in the world to a location on a map (the screen), it needs to first translate latitude and longitude values into a "world" coordinate. This translation is accomplished using the Mercator projection.

More details can be found [here](https://developers.google.com/maps/documentation/javascript/maptypes#WorldCoordinates).

Ported from [here](https://developers.google.com/maps/documentation/javascript/examples/map-coordinates).

Installation
--------

    $ npm install -g mercator-projection

Examples
--------

The following examples show you how to use mercator-projection.

```javascript
var merc = require('mercator-projection');

// translate a latlng to a xy
var xy = merc.fromLatLngToPoint({lat: -27.470127, lng: 153.0147027});
// {x: 236.81045525333332, y: 148.32879785796487}

// translate a xy to a latlng
var ll = merc.fromPointToLatLng({x: 236.81045525333332, y: 148.32879785796487})
// ~ {lat: -27.470127, lng: 153.0147027}
```

Running tests
----

    $ npm test

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