slippy-tile
Advanced tools
Comparing version 2.3.1 to 3.0.0
# Changelog | ||
## 3.0.0 - 2017-09-29 | ||
- Support ES Modules | ||
## 2.3.0 - 2017-09-11 | ||
@@ -5,0 +9,0 @@ |
@@ -1,12 +0,15 @@ | ||
type Tile = [number, number, number]; | ||
export type Tile = [number, number, number] | ||
interface Options { | ||
layer?: string | ||
format?: string | ||
version?: string | ||
[key: string]: string | ||
} | ||
declare function slippyTile(tile: Tile, url: string, options?: Options): string; | ||
declare namespace slippyTile { } | ||
export = slippyTile | ||
/** | ||
* Substitutes the given tile information [x, y, z] to the URL tile scheme. | ||
*/ | ||
export default function slippyTile( | ||
tile: Tile, | ||
url: string, | ||
options?: { | ||
layer?: string | ||
format?: string | ||
version?: string | ||
[key: string]: string | ||
} | ||
): string; |
20
index.js
@@ -1,15 +0,4 @@ | ||
const mercator = require('global-mercator') | ||
const googleToBBox = mercator.googleToBBox | ||
const googleToTile = mercator.googleToTile | ||
const googleToQuadkey = mercator.googleToQuadkey | ||
const bboxToMeters = mercator.bboxToMeters | ||
import { googleToBBox, googleToTile, googleToQuadkey, bboxToMeters } from 'global-mercator' | ||
/** | ||
* @typedef {Object} Options | ||
* @property {string} layer | ||
* @property {string} version | ||
* @property {string} [format='image/png'] | ||
*/ | ||
/** | ||
* Substitutes the given tile information [x, y, z] to the URL tile scheme. | ||
@@ -20,3 +9,6 @@ * | ||
* @param {string} url URL Tile scheme or provider unique key | ||
* @param {Options} options Additional options | ||
* @param {Object} [options] Additional options | ||
* @param {string} [options.layer] Layer | ||
* @param {string} [options.version] Version | ||
* @param {string} [format='image/png'] Image Format | ||
* @returns {string} parsed URL | ||
@@ -27,3 +19,3 @@ * @example | ||
*/ | ||
module.exports = function (tile, url, options) { | ||
export default function slippyTile (tile, url, options) { | ||
options = options || {} | ||
@@ -30,0 +22,0 @@ const format = options.format || 'image/png' |
{ | ||
"name": "slippy-tile", | ||
"version": "2.3.1", | ||
"version": "3.0.0", | ||
"description": "Helps convert Slippy Map url tile schemas", | ||
"main": "index.js", | ||
"main": "slippy-tile.js", | ||
"module": "index.js", | ||
"jsnext:main": "index.js", | ||
"types": "index.d.ts", | ||
@@ -10,7 +12,8 @@ "files": [ | ||
"index.js", | ||
"docs" | ||
"slippy-tile.js" | ||
], | ||
"scripts": { | ||
"lint": "standard index.js", | ||
"test": "tap test.js --coverage" | ||
"pretest": "rollup -f cjs -o slippy-tile.js index.js", | ||
"test": "node test.js", | ||
"posttest": "standard index.js" | ||
}, | ||
@@ -30,9 +33,9 @@ "author": "Denis Carriere <@DenisCarriere>", | ||
"devDependencies": { | ||
"standard": "^8.6.0", | ||
"tap": "^10.7.2", | ||
"tape": "^4.6.3" | ||
"rollup": "*", | ||
"standard": "*", | ||
"tape": "*" | ||
}, | ||
"dependencies": { | ||
"global-mercator": "^2.8.4" | ||
"global-mercator": "*" | ||
} | ||
} |
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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
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
16242
7
254
2
+ Addedglobal-mercator@3.1.0(transitive)
- Removedglobal-mercator@2.8.4(transitive)
Updatedglobal-mercator@*