web-merc-projection
TypeScript icon, indicating that this package has built-in type declarations

1.3.5 • Public • Published

web-merc-projection npm downloads JavaScript Style Guide bundle tree-shake

About

Web Mercator Projection provides projection maths for converting between mercator meters, screen pixels (of 512x512 or configurable-size tiles), and latitude/longitude.

Install

# npm
npm install --save web-merc-projection
# yarn
yarn add web-merc-projection
# pnpm
pnpm add web-merc-projection

Example use

import {
      llToPX,
      pxToLL,
      llToMerc,
      mercToLL,
      convert,
      xyzToBBOX,
      bboxToXYZBounds
} from 'web-merc-projection'

llToPX([-179, 85], 9, false, 256) // [364, 215]

Recommended configuration

This project uses PNPM to manage dependencies. It is recommended to install PNPM globally and use it to install dependencies.

# install directions from https://pnpm.io/installation

# Windows
iwr https://get.pnpm.io/install.ps1 -useb | iex
# Posix - curl
curl -fsSL https://get.pnpm.io/install.sh | sh -
# Posix - wget
wget -qO- https://get.pnpm.io/install.sh | sh -

# or just install with npm
npm install -g pnpm

You may experience issues trying to get linting working in VS Code. The easiest way is to install globally the following packages:

pnpm install -g standard ts-standard

Version Control

This project utilizes the Semantic Versioning 2.0.0

Given a version number MAJOR.MINOR.PATCH, increment the:

  1. MAJOR version when you make incompatible API changes
  2. MINOR version when you add functionality in a backward compatible manner
  3. PATCH version when you make backward compatible bug fixes

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

Package Sidebar

Install

npm i web-merc-projection

Weekly Downloads

131

Version

1.3.5

License

MIT

Unpacked Size

115 kB

Total Files

33

Last publish

Collaborators

  • oconnorct1