Allow more than one digit range in ol.TileUrlFunction.expandUrl
To be able to have number range like `{9-13}`
This commit is contained in:
@@ -18,6 +18,15 @@ describe('ol.TileUrlFunction', function() {
|
||||
'http://tile-3/{z}/{x}/{y}'
|
||||
]);
|
||||
});
|
||||
it('creates expected URLs', function() {
|
||||
var template = 'http://tile-{9-11}/{z}/{x}/{y}';
|
||||
var urls = ol.TileUrlFunction.expandUrl(template);
|
||||
expect(urls).to.eql([
|
||||
'http://tile-9/{z}/{x}/{y}',
|
||||
'http://tile-10/{z}/{x}/{y}',
|
||||
'http://tile-11/{z}/{x}/{y}'
|
||||
]);
|
||||
});
|
||||
});
|
||||
describe('with character range', function() {
|
||||
it('creates expected URLs', function() {
|
||||
@@ -30,6 +39,15 @@ describe('ol.TileUrlFunction', function() {
|
||||
]);
|
||||
});
|
||||
});
|
||||
describe('without range', function() {
|
||||
it('creates expected URLs', function() {
|
||||
var template = 'http://tiles.example.com/{z}/{x}/{y}';
|
||||
var urls = ol.TileUrlFunction.expandUrl(template);
|
||||
expect(urls).to.eql([
|
||||
'http://tiles.example.com/{z}/{x}/{y}'
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('createFromTemplate', function() {
|
||||
|
||||
Reference in New Issue
Block a user