slippy-tile
Advanced tools
Comparing version 2.2.0 to 2.3.0
# Changelog | ||
## 2.3.0 - 2017-09-11 | ||
- Add new replacers | ||
- `{bbox4326}`: GeoJSON Bounding Box using EPSG:4326 (WGS84) | ||
- `{bbox3857}`: GeoJSON Bounding Box using EPSG:3857 (World Mercator) | ||
- `{size}`: default = 256,256 | ||
## 2.2.0 - 2017-09-08 | ||
@@ -5,0 +12,0 @@ |
15
index.js
@@ -68,11 +68,10 @@ const mercator = require('global-mercator') | ||
url = url.replace(/{width}/gi, '256') | ||
url = url.replace(/{size}/gi, '256,256') | ||
url = url.replace(/{(proj|srs|crs)}/gi, 'EPSG:3857') | ||
var bbox | ||
if (url.match(/EPSG:(3857|900913)/i)) { | ||
bbox = bboxToMeters(googleToBBox(tile)) | ||
} else { | ||
bbox = googleToBBox(tile) | ||
} | ||
if (url.match(/{bbox}/i)) { url = url.replace(/{bbox}/gi, bbox.join(',')) } | ||
const bbox = googleToBBox(tile) | ||
const bboxMeters = bboxToMeters(bbox) | ||
if (url.match(/EPSG:(3857|900913)/i) && url.match(/{bbox}/i)) url = url.replace(/{bbox}/gi, bboxMeters.join(',')) | ||
if (url.match(/{bbox4326}/i)) url = url.replace(/{bbox4326}/gi, bbox.join(',')) | ||
if (url.match(/{bbox3857}/i)) url = url.replace(/{bbox3857}/gi, bboxMeters.join(',')) | ||
if (url.match(/{bbox}/i)) url = url.replace(/{bbox}/gi, bbox.join(',')) | ||
} | ||
@@ -79,0 +78,0 @@ return url |
{ | ||
"name": "slippy-tile", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Helps convert Slippy Map url tile schemas", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,3 +5,5 @@ # Slippy Tile | ||
[![npm version](https://badge.fury.io/js/slippy-tile.svg)](https://badge.fury.io/js/slippy-tile) | ||
[![Coverage Status](https://coveralls.io/repos/github/DenisCarriere/slippy-tile/badge.svg?branch=master)](https://coveralls.io/github/DenisCarriere/slippy-tile?branch=master) | ||
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/DenisCarriere/slippy-tile/master/LICENSE) | ||
[![ES5](https://camo.githubusercontent.com/d341caa63123c99b79fda7f8efdc29b35f9f2e70/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f65732d352d627269676874677265656e2e737667)](http://kangax.github.io/compat-table/es5/) | ||
@@ -20,6 +22,6 @@ [![Standard - JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) | ||
**web browser ([ES5](https://kangax.github.io/compat-table/es5))** | ||
**web** | ||
```html | ||
<script src="https://unpkg.com/slippy-tile/docs/slippy-tile.min.js"></script> | ||
<script src="https://wzrd.in/standalone/slippy-tile@latest"></script> | ||
``` | ||
@@ -48,2 +50,4 @@ | ||
- `{bbox}`: GeoJSON Bounding Box | ||
- `{bbox4326}`: GeoJSON Bounding Box using EPSG:4326 (WGS84) | ||
- `{bbox3857}`: GeoJSON Bounding Box using EPSG:3857 (World Mercator) | ||
- `{quadkey}` or `{q}`: Microsoft's Quadkey | ||
@@ -53,2 +57,3 @@ - `{switch:1,2,3}`: Selects a random sample | ||
- `{width}`: default = 256 | ||
- `{size}`: default = 256,256 | ||
- `{proj}`: default = EPSG:3857 | ||
@@ -55,0 +60,0 @@ - `{format}`: default = image/png |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
11865
77
0