global-mercator
Advanced tools
Comparing version 2.8.1 to 2.8.2
@@ -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 |
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47864
750
622