Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

global-mercator

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

global-mercator - npm Package Compare versions

Comparing version 2.8.1 to 2.8.2

1

index.js

@@ -415,2 +415,3 @@ var originShift = 2 * Math.PI * 6378137 / 2.0

var quadkey = ''
ty = (Math.pow(2, zoom) - 1) - ty
range(zoom, 0, -1).map(function (i) {

@@ -417,0 +418,0 @@ var digit = 0

2

package.json
{
"name": "global-mercator",
"version": "2.8.1",
"version": "2.8.2",
"description": "Tools to help with TMS, Quadkey & Google (XYZ) Tiles",

@@ -5,0 +5,0 @@ "repository": {

@@ -62,4 +62,6 @@ # [Global Mercator](https://www.npmjs.com/package/global-mercator)

| [validTile(tile)](#validtile) | Valid Tile |
| [longitude(degree)](#longitude) | Modifies a Longitude to fit within +/-180 degrees. |
| [latitude(degree)](#latitude) | Modifies a Latitude to fit within +/-90 degrees. |
| [longitude(degree)](#longitude) | Modifies a Longitude to fit within +/-180 degrees. |
| [latitude(degree)](#latitude) | Modifies a Latitude to fit within +/-90 degrees. |
| [pointToTile(lnglat, zoom)](#pointtotile) | Get the tile for a point at a specified zoom level |
| [pointToTileFraction(lnglat, zoom)](#pointtotilefraction) | Get the precise fractional tile location for a point at a zoom level |

@@ -87,2 +89,33 @@ ## API

### pointToTile
Get the tile for a point at a specified zoom level
<https://github.com/mapbox/tilebelt>
**Parameters**
- `lnglat` **\[[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)]** [Longitude, Latitude]
- `zoom` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Zoom level
**Examples**
```javascript
var tile = mercator.pointToTile([1, 1], 12)
//= [ 2059, 2036, 12 ]
```
### pointToTileFraction
Get the precise fractional tile location for a point at a zoom level
<https://github.com/mapbox/tilebelt>
**Parameters**
- `lnglat` **\[[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)]** [Longitude, Latitude]
- `zoom` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Zoom level
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), [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)]** tile fraction
var tile = mercator.pointToTileFraction([1, 1], 12)
//= [ 2059.3777777777777, 2036.6216445333432, 12 ]
### bboxToCenter

@@ -111,3 +144,3 @@

- `lnglat` **LngLat** Longitude (Meridians) & Latitude (Parallels) in decimal degrees
- `lnglat` **\[[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)]** [Longitude, Latitude]
- `validate` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** validates LatLng coordinates (optional, default `true`)

@@ -166,3 +199,3 @@

- `lnglat` **LngLat** Longitude (Meridians) & Latitude (Parallels) in decimal degrees
- `lnglat` **\[[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)]** [Longitude, Latitude]
- `zoom` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Zoom level

@@ -186,3 +219,3 @@ - `validate` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** validates LatLng coordinates (optional, default `true`)

- `lnglat` **LngLat** Longitude (Meridians) & Latitude (Parallels) in decimal degrees
- `lnglat` **\[[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)]** [Longitude, Latitude]
- `zoom` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Zoom level

@@ -507,3 +540,3 @@ - `validate` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** validates LatLng coordinates (optional, default `true`)

- `lnglat` **LngLat** Longitude (Meridians) & Latitude (Parallels) in decimal degrees
- `lnglat` **\[[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)]** [Longitude, Latitude]
- `validate` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** validates LatLng coordinates (optional, default `true`)

@@ -510,0 +543,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc