{"name":"sphericalmercator","version":"1.0.0","author":{"name":"MapBox","email":"info@mapbox.com","url":"http://mapbox.com/"},"main":"./sphericalmercator","_npmJsonOpts":{"file":"/Users/kkaefer/.npm/sphericalmercator/1.0.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"sphericalmercator@1.0.0","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.14","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"67ba8489b4873c3b8171f0ea0d35abf905c939a5","tarball":"http://registry-npm.ywwl.com/sphericalmercator/download/sphericalmercator-1.0.0.tgz","integrity":"sha512-c/8ZxvZTKw3A80Nl570HDw5Q1DNN+voLiK0d4wQ8ZRnLjllz43s/l3YGWGcZbY5KNEJ0eQaaDwR2i2sQhhqFGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHm6OBKwVdk+Vue9jyqR88HNp1mEJrOc6a1rfRe91dedAiA9zGu/dZvT5qIjI3uOJs7KYNzP6D8CWObQxeq5M0IZww=="}],"size":3256,"noattachment":false,"key":"/sphericalmercator/-/sphericalmercator-1.0.0.tgz"},"scripts":{},"deprecated":"This module is now under the @mapbox namespace: install @mapbox/sphericalmercator instead","directories":{},"readme":"[![Build Status](https://secure.travis-ci.org/mapbox/node-sphericalmercator.svg?branch=master)](http://travis-ci.org/mapbox/node-sphericalmercator)\n\n`node-sphericalmercator` provides projection math for converting between\nmercator meters, screen pixels (of 256x256 or configurable-size tiles), and\nlatitude/longitude.\n\nCompatible with nodejs packages and in-browser.\n\n## Installation\n\n`npm install sphericalmercator`\n\n## API\n\nSome datatypes are assumed to be arrays: `ll` is `[lon, lat]`, `xy` and `px` are\n`[x, y]`.\n\n```javascript\n// By default, precomputes up to z30\nvar merc = new SphericalMercator({\n    size: 256\n});\n```\n\n### `px(ll, zoom)`\n\nConvert lon, lat to screen pixel x, y from 0, 0 origin, at a certain zoom level.\nThe inverse of `ll`\n\n### `ll(px, zoom)`\n\nConvert screen pixel value to lon, lat, at a certain zoom level. The inverse\nof `px`\n\n### `bbox(x, y, zoom, tms_style, srs)`\n\nConvert tile xyz value to bbox of the form `[w, s, e, n]`\n\n* `x` {Number} x (longitude) number.\n* `y` {Number} y (latitude) number.\n* `zoom` {Number} zoom.\n* `tms_style` {Boolean} whether to compute using tms-style. (optional, default false)\n* `srs` {String} projection for resulting bbox (WGS84|900913). (optional, default WGS84)\n\nReturns bbox array of values in form `[w, s, e, n]`.\n\n### `xyz(bbox, zoom, tms_style, srs)`\n\nConvert bbox to xyz bounds\n\n* `bbox` {Number} bbox in the form `[w, s, e, n]`.\n* `zoom` {Number} zoom.\n* `tms_style` {Boolean} whether to compute using tms-style. (optional, default false)\n* `srs` {String} projection of input bbox (WGS84|900913). (optional, default WGS84)\n\nReturns {Object} XYZ bounds containing minX, maxX, minY, maxY properties.\n\n### `convert(bbox, to)`\n\nConvert bbox from 900913 to WGS84 or vice versa\n\n* `bbox` {Number} bbox in the form `[w, s, e, n]`.\n* `to` {String} projection of resulting bbox (WGS84|900913). (optional, default WGS84)\n\nReturns bbox array of values in form `[w, s, e, n]`.\n\n### `forward(ll)`\n\nConvert lon, lat values to mercator x, y\n\n### `inverse(xy)`\n\nConvert mercator x, y values to lon, lat\n\n## See Also\n\n* [mercantile](https://github.com/sgillies/mercantile) provides similar utilities for projection and tile math in Python\n","publish_time":1308923786156,"maintainers":[{"email":"accounts@mapbox.com","name":"mapbox-admin"}],"_cnpm_publish_time":1308923786156,"dist-tags":{"latest":"1.0.5"}}