web-merc-projection
v1.3.5
Published
Work with the web mercator projection.
Downloads
173
Maintainers
Readme
web-merc-projection
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:
- MAJOR version when you make incompatible API changes
- MINOR version when you add functionality in a backward compatible manner
- 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.