Configurable optional alias for .pbf tiles (#109)
This commit is contained in:
@@ -7,7 +7,7 @@ var async = require('async'),
|
||||
var clone = require('clone'),
|
||||
glyphCompose = require('glyph-pbf-composite');
|
||||
|
||||
module.exports.getTileUrls = function(req, domains, path, format) {
|
||||
module.exports.getTileUrls = function(req, domains, path, format, aliases) {
|
||||
|
||||
if (domains) {
|
||||
if (domains.constructor === String && domains.length > 0) {
|
||||
@@ -28,6 +28,10 @@ module.exports.getTileUrls = function(req, domains, path, format) {
|
||||
}
|
||||
var query = queryParams.length > 0 ? ('?' + queryParams.join('&')) : '';
|
||||
|
||||
if (aliases && aliases[format]) {
|
||||
format = aliases[format];
|
||||
}
|
||||
|
||||
var uris = [];
|
||||
domains.forEach(function(domain) {
|
||||
uris.push(req.protocol + '://' + domain + '/' + path +
|
||||
|
||||
Reference in New Issue
Block a user