slippy-tile
Advanced tools
Comparing version 2.3.0 to 2.3.1
23
index.js
@@ -65,14 +65,13 @@ const mercator = require('global-mercator') | ||
function wms (tile, url) { | ||
if (url.match(/{height|width|proj|srs|crs|bbox}/gi)) { | ||
url = url.replace(/{height}/gi, '256') | ||
url = url.replace(/{width}/gi, '256') | ||
url = url.replace(/{size}/gi, '256,256') | ||
url = url.replace(/{(proj|srs|crs)}/gi, 'EPSG:3857') | ||
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(',')) | ||
} | ||
url = url.replace(/{height}/gi, '256') | ||
url = url.replace(/{width}/gi, '256') | ||
url = url.replace(/{size}/gi, '256,256') | ||
url = url.replace(/{(proj|srs|crs)}/gi, 'EPSG:3857') | ||
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(',')) | ||
url = url.replace(/{bbox4326}/gi, bbox.join(',')) | ||
url = url.replace(/{bbox3857}/gi, bboxMeters.join(',')) | ||
url = url.replace(/{bbox}/gi, bbox.join(',')) | ||
return url | ||
@@ -79,0 +78,0 @@ } |
{ | ||
"name": "slippy-tile", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Helps convert Slippy Map url tile schemas", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
11699
136