Merge pull request #7623 from fredj/named_export_tileurlfunction

Named export for ol/tileurlfunction
This commit is contained in:
Frédéric Junod
2017-12-18 08:36:24 +01:00
committed by GitHub
9 changed files with 47 additions and 61 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
* @module ol/source/BingMaps * @module ol/source/BingMaps
*/ */
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_TileUrlFunction_ from '../TileUrlFunction.js'; import {createFromTileUrlFunctions} from '../tileurlfunction.js';
import {applyTransform, intersects} from '../extent.js'; import {applyTransform, intersects} from '../extent.js';
import _ol_net_ from '../net.js'; import _ol_net_ from '../net.js';
import {get as getProjection, getTransformFromProjections} from '../proj.js'; import {get as getProjection, getTransformFromProjections} from '../proj.js';
@@ -142,7 +142,7 @@ _ol_source_BingMaps_.prototype.handleImageryMetadataResponse = function(response
var culture = this.culture_; var culture = this.culture_;
var hidpi = this.hidpi_; var hidpi = this.hidpi_;
this.tileUrlFunction = _ol_TileUrlFunction_.createFromTileUrlFunctions( this.tileUrlFunction = createFromTileUrlFunctions(
resource.imageUrlSubdomains.map(function(subdomain) { resource.imageUrlSubdomains.map(function(subdomain) {
var quadKeyTileCoord = [0, 0, 0]; var quadKeyTileCoord = [0, 0, 0];
var imageUrl = resource.imageUrl var imageUrl = resource.imageUrl
+2 -3
View File
@@ -8,7 +8,7 @@
*/ */
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_TileUrlFunction_ from '../TileUrlFunction.js'; import {createFromTemplates} from '../tileurlfunction.js';
import _ol_asserts_ from '../asserts.js'; import _ol_asserts_ from '../asserts.js';
import {applyTransform, intersects} from '../extent.js'; import {applyTransform, intersects} from '../extent.js';
import _ol_net_ from '../net.js'; import _ol_net_ from '../net.js';
@@ -133,8 +133,7 @@ _ol_source_TileJSON_.prototype.handleTileJSONResponse = function(tileJSON) {
}); });
this.tileGrid = tileGrid; this.tileGrid = tileGrid;
this.tileUrlFunction = this.tileUrlFunction = createFromTemplates(tileJSON.tiles, tileGrid);
_ol_TileUrlFunction_.createFromTemplates(tileJSON.tiles, tileGrid);
if (tileJSON.attribution !== undefined && !this.getAttributions()) { if (tileJSON.attribution !== undefined && !this.getAttributions()) {
var attributionExtent = extent !== undefined ? var attributionExtent = extent !== undefined ?
+3 -4
View File
@@ -4,7 +4,7 @@
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_Tile_ from '../Tile.js'; import _ol_Tile_ from '../Tile.js';
import _ol_TileState_ from '../TileState.js'; import _ol_TileState_ from '../TileState.js';
import _ol_TileUrlFunction_ from '../TileUrlFunction.js'; import {createFromTemplates, nullTileUrlFunction} from '../tileurlfunction.js';
import _ol_asserts_ from '../asserts.js'; import _ol_asserts_ from '../asserts.js';
import _ol_events_ from '../events.js'; import _ol_events_ from '../events.js';
import EventType from '../events/EventType.js'; import EventType from '../events/EventType.js';
@@ -42,7 +42,7 @@ var _ol_source_TileUTFGrid_ = function(options) {
* @private * @private
* @type {!ol.TileUrlFunctionType} * @type {!ol.TileUrlFunctionType}
*/ */
this.tileUrlFunction_ = _ol_TileUrlFunction_.nullTileUrlFunction; this.tileUrlFunction_ = nullTileUrlFunction;
/** /**
* @private * @private
@@ -193,8 +193,7 @@ _ol_source_TileUTFGrid_.prototype.handleTileJSONResponse = function(tileJSON) {
return; return;
} }
this.tileUrlFunction_ = this.tileUrlFunction_ = createFromTemplates(grids, tileGrid);
_ol_TileUrlFunction_.createFromTemplates(grids, tileGrid);
if (tileJSON.attribution !== undefined) { if (tileJSON.attribution !== undefined) {
var attributionExtent = extent !== undefined ? var attributionExtent = extent !== undefined ?
+5 -6
View File
@@ -3,7 +3,7 @@
*/ */
import {getUid, inherits} from '../index.js'; import {getUid, inherits} from '../index.js';
import _ol_TileState_ from '../TileState.js'; import _ol_TileState_ from '../TileState.js';
import _ol_TileUrlFunction_ from '../TileUrlFunction.js'; import {expandUrl, createFromTemplates, nullTileUrlFunction} from '../tileurlfunction.js';
import _ol_source_Tile_ from '../source/Tile.js'; import _ol_source_Tile_ from '../source/Tile.js';
import _ol_source_TileEventType_ from '../source/TileEventType.js'; import _ol_source_TileEventType_ from '../source/TileEventType.js';
import _ol_tilecoord_ from '../tilecoord.js'; import _ol_tilecoord_ from '../tilecoord.js';
@@ -44,8 +44,7 @@ var _ol_source_UrlTile_ = function(options) {
* @type {ol.TileUrlFunctionType} * @type {ol.TileUrlFunctionType}
*/ */
this.tileUrlFunction = this.fixedTileUrlFunction ? this.tileUrlFunction = this.fixedTileUrlFunction ?
this.fixedTileUrlFunction.bind(this) : this.fixedTileUrlFunction.bind(this) : nullTileUrlFunction;
_ol_TileUrlFunction_.nullTileUrlFunction;
/** /**
* @protected * @protected
@@ -171,10 +170,10 @@ _ol_source_UrlTile_.prototype.setTileUrlFunction = function(tileUrlFunction, opt
* @api * @api
*/ */
_ol_source_UrlTile_.prototype.setUrl = function(url) { _ol_source_UrlTile_.prototype.setUrl = function(url) {
var urls = this.urls = _ol_TileUrlFunction_.expandUrl(url); var urls = this.urls = expandUrl(url);
this.setTileUrlFunction(this.fixedTileUrlFunction ? this.setTileUrlFunction(this.fixedTileUrlFunction ?
this.fixedTileUrlFunction.bind(this) : this.fixedTileUrlFunction.bind(this) :
_ol_TileUrlFunction_.createFromTemplates(urls, this.tileGrid), url); createFromTemplates(urls, this.tileGrid), url);
}; };
@@ -188,7 +187,7 @@ _ol_source_UrlTile_.prototype.setUrls = function(urls) {
var key = urls.join('\n'); var key = urls.join('\n');
this.setTileUrlFunction(this.fixedTileUrlFunction ? this.setTileUrlFunction(this.fixedTileUrlFunction ?
this.fixedTileUrlFunction.bind(this) : this.fixedTileUrlFunction.bind(this) :
_ol_TileUrlFunction_.createFromTemplates(urls, this.tileGrid), key); createFromTemplates(urls, this.tileGrid), key);
}; };
+4 -6
View File
@@ -2,7 +2,7 @@
* @module ol/source/WMTS * @module ol/source/WMTS
*/ */
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_TileUrlFunction_ from '../TileUrlFunction.js'; import {expandUrl, createFromTileUrlFunctions, nullTileUrlFunction} from '../tileurlfunction.js';
import _ol_array_ from '../array.js'; import _ol_array_ from '../array.js';
import {containsExtent} from '../extent.js'; import {containsExtent} from '../extent.js';
import _ol_obj_ from '../obj.js'; import _ol_obj_ from '../obj.js';
@@ -63,7 +63,7 @@ var _ol_source_WMTS_ = function(options) {
var urls = options.urls; var urls = options.urls;
if (urls === undefined && options.url !== undefined) { if (urls === undefined && options.url !== undefined) {
urls = _ol_TileUrlFunction_.expandUrl(options.url); urls = expandUrl(options.url);
} }
// FIXME: should we guess this requestEncoding from options.url(s) // FIXME: should we guess this requestEncoding from options.url(s)
@@ -151,9 +151,7 @@ var _ol_source_WMTS_ = function(options) {
}; };
var tileUrlFunction = (urls && urls.length > 0) ? var tileUrlFunction = (urls && urls.length > 0) ?
_ol_TileUrlFunction_.createFromTileUrlFunctions( createFromTileUrlFunctions(urls.map(this.createFromWMTSTemplate_)) : nullTileUrlFunction;
urls.map(this.createFromWMTSTemplate_)) :
_ol_TileUrlFunction_.nullTileUrlFunction;
_ol_source_TileImage_.call(this, { _ol_source_TileImage_.call(this, {
attributions: options.attributions, attributions: options.attributions,
@@ -187,7 +185,7 @@ _ol_source_WMTS_.prototype.setUrls = function(urls) {
var key = urls.join('\n'); var key = urls.join('\n');
this.setTileUrlFunction(this.fixedTileUrlFunction ? this.setTileUrlFunction(this.fixedTileUrlFunction ?
this.fixedTileUrlFunction.bind(this) : this.fixedTileUrlFunction.bind(this) :
_ol_TileUrlFunction_.createFromTileUrlFunctions(urls.map(this.createFromWMTSTemplate_.bind(this))), key); createFromTileUrlFunctions(urls.map(this.createFromWMTSTemplate_.bind(this))), key);
}; };
/** /**
+3 -3
View File
@@ -5,7 +5,7 @@ import {DEFAULT_TILE_SIZE} from '../tilegrid/common.js';
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_ImageTile_ from '../ImageTile.js'; import _ol_ImageTile_ from '../ImageTile.js';
import _ol_TileState_ from '../TileState.js'; import _ol_TileState_ from '../TileState.js';
import _ol_TileUrlFunction_ from '../TileUrlFunction.js'; import {expandUrl, createFromTileUrlFunctions} from '../tileurlfunction.js';
import _ol_asserts_ from '../asserts.js'; import _ol_asserts_ from '../asserts.js';
import {createCanvasContext2D} from '../dom.js'; import {createCanvasContext2D} from '../dom.js';
import {getTopLeft} from '../extent.js'; import {getTopLeft} from '../extent.js';
@@ -92,7 +92,7 @@ var _ol_source_Zoomify_ = function(opt_options) {
if (url && url.indexOf('{TileGroup}') == -1 && url.indexOf('{tileIndex}') == -1) { if (url && url.indexOf('{TileGroup}') == -1 && url.indexOf('{tileIndex}') == -1) {
url += '{TileGroup}/{z}-{x}-{y}.jpg'; url += '{TileGroup}/{z}-{x}-{y}.jpg';
} }
var urls = _ol_TileUrlFunction_.expandUrl(url); var urls = expandUrl(url);
/** /**
* @param {string} template Template. * @param {string} template Template.
@@ -133,7 +133,7 @@ var _ol_source_Zoomify_ = function(opt_options) {
}); });
} }
var tileUrlFunction = _ol_TileUrlFunction_.createFromTileUrlFunctions(urls.map(createFromTemplate)); var tileUrlFunction = createFromTileUrlFunctions(urls.map(createFromTemplate));
var ZoomifyTileClass = _ol_source_Zoomify_.Tile_.bind(null, tileGrid); var ZoomifyTileClass = _ol_source_Zoomify_.Tile_.bind(null, tileGrid);
@@ -1,10 +1,9 @@
/** /**
* @module ol/TileUrlFunction * @module ol/tileurlfunction
*/ */
import _ol_asserts_ from './asserts.js'; import _ol_asserts_ from './asserts.js';
import _ol_math_ from './math.js'; import _ol_math_ from './math.js';
import _ol_tilecoord_ from './tilecoord.js'; import _ol_tilecoord_ from './tilecoord.js';
var _ol_TileUrlFunction_ = {};
/** /**
@@ -12,7 +11,7 @@ var _ol_TileUrlFunction_ = {};
* @param {ol.tilegrid.TileGrid} tileGrid Tile grid. * @param {ol.tilegrid.TileGrid} tileGrid Tile grid.
* @return {ol.TileUrlFunctionType} Tile URL function. * @return {ol.TileUrlFunctionType} Tile URL function.
*/ */
_ol_TileUrlFunction_.createFromTemplate = function(template, tileGrid) { export function createFromTemplate(template, tileGrid) {
var zRegEx = /\{z\}/g; var zRegEx = /\{z\}/g;
var xRegEx = /\{x\}/g; var xRegEx = /\{x\}/g;
var yRegEx = /\{y\}/g; var yRegEx = /\{y\}/g;
@@ -44,7 +43,7 @@ _ol_TileUrlFunction_.createFromTemplate = function(template, tileGrid) {
} }
} }
); );
}; }
/** /**
@@ -52,22 +51,21 @@ _ol_TileUrlFunction_.createFromTemplate = function(template, tileGrid) {
* @param {ol.tilegrid.TileGrid} tileGrid Tile grid. * @param {ol.tilegrid.TileGrid} tileGrid Tile grid.
* @return {ol.TileUrlFunctionType} Tile URL function. * @return {ol.TileUrlFunctionType} Tile URL function.
*/ */
_ol_TileUrlFunction_.createFromTemplates = function(templates, tileGrid) { export function createFromTemplates(templates, tileGrid) {
var len = templates.length; var len = templates.length;
var tileUrlFunctions = new Array(len); var tileUrlFunctions = new Array(len);
for (var i = 0; i < len; ++i) { for (var i = 0; i < len; ++i) {
tileUrlFunctions[i] = _ol_TileUrlFunction_.createFromTemplate( tileUrlFunctions[i] = createFromTemplate(templates[i], tileGrid);
templates[i], tileGrid);
} }
return _ol_TileUrlFunction_.createFromTileUrlFunctions(tileUrlFunctions); return createFromTileUrlFunctions(tileUrlFunctions);
}; }
/** /**
* @param {Array.<ol.TileUrlFunctionType>} tileUrlFunctions Tile URL Functions. * @param {Array.<ol.TileUrlFunctionType>} tileUrlFunctions Tile URL Functions.
* @return {ol.TileUrlFunctionType} Tile URL function. * @return {ol.TileUrlFunctionType} Tile URL function.
*/ */
_ol_TileUrlFunction_.createFromTileUrlFunctions = function(tileUrlFunctions) { export function createFromTileUrlFunctions(tileUrlFunctions) {
if (tileUrlFunctions.length === 1) { if (tileUrlFunctions.length === 1) {
return tileUrlFunctions[0]; return tileUrlFunctions[0];
} }
@@ -88,7 +86,7 @@ _ol_TileUrlFunction_.createFromTileUrlFunctions = function(tileUrlFunctions) {
} }
} }
); );
}; }
/** /**
@@ -97,16 +95,16 @@ _ol_TileUrlFunction_.createFromTileUrlFunctions = function(tileUrlFunctions) {
* @param {ol.proj.Projection} projection Projection. * @param {ol.proj.Projection} projection Projection.
* @return {string|undefined} Tile URL. * @return {string|undefined} Tile URL.
*/ */
_ol_TileUrlFunction_.nullTileUrlFunction = function(tileCoord, pixelRatio, projection) { export function nullTileUrlFunction(tileCoord, pixelRatio, projection) {
return undefined; return undefined;
}; }
/** /**
* @param {string} url URL. * @param {string} url URL.
* @return {Array.<string>} Array of urls. * @return {Array.<string>} Array of urls.
*/ */
_ol_TileUrlFunction_.expandUrl = function(url) { export function expandUrl(url) {
var urls = []; var urls = [];
var match = /\{([a-z])-([a-z])\}/.exec(url); var match = /\{([a-z])-([a-z])\}/.exec(url);
if (match) { if (match) {
@@ -130,5 +128,4 @@ _ol_TileUrlFunction_.expandUrl = function(url) {
} }
urls.push(url); urls.push(url);
return urls; return urls;
}; }
export default _ol_TileUrlFunction_;
+2 -3
View File
@@ -1,6 +1,6 @@
import _ol_ImageTile_ from '../../../../src/ol/ImageTile.js'; import _ol_ImageTile_ from '../../../../src/ol/ImageTile.js';
import _ol_TileState_ from '../../../../src/ol/TileState.js'; import _ol_TileState_ from '../../../../src/ol/TileState.js';
import _ol_TileUrlFunction_ from '../../../../src/ol/TileUrlFunction.js'; import {createFromTemplate} from '../../../../src/ol/tileurlfunction.js';
import _ol_events_ from '../../../../src/ol/events.js'; import _ol_events_ from '../../../../src/ol/events.js';
import {addCommon, clearAllProjections, get as getProjection} from '../../../../src/ol/proj.js'; import {addCommon, clearAllProjections, get as getProjection} from '../../../../src/ol/proj.js';
import {register} from '../../../../src/ol/proj/proj4.js'; import {register} from '../../../../src/ol/proj/proj4.js';
@@ -20,8 +20,7 @@ describe('ol.source.TileImage', function() {
projection: proj, projection: proj,
tileGrid: opt_tileGrid || tileGrid: opt_tileGrid ||
_ol_tilegrid_.createForProjection(proj, undefined, [2, 2]), _ol_tilegrid_.createForProjection(proj, undefined, [2, 2]),
tileUrlFunction: _ol_TileUrlFunction_.createFromTemplate( tileUrlFunction: createFromTemplate('data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=')
'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=')
}); });
} }
+13 -18
View File
@@ -1,4 +1,4 @@
import _ol_TileUrlFunction_ from '../../../src/ol/TileUrlFunction.js'; import {expandUrl, createFromTemplate, createFromTemplates, createFromTileUrlFunctions} from '../../../src/ol/tileurlfunction.js';
import _ol_tilecoord_ from '../../../src/ol/tilecoord.js'; import _ol_tilecoord_ from '../../../src/ol/tilecoord.js';
import _ol_tilegrid_ from '../../../src/ol/tilegrid.js'; import _ol_tilegrid_ from '../../../src/ol/tilegrid.js';
import _ol_tilegrid_TileGrid_ from '../../../src/ol/tilegrid/TileGrid.js'; import _ol_tilegrid_TileGrid_ from '../../../src/ol/tilegrid/TileGrid.js';
@@ -9,7 +9,7 @@ describe('ol.TileUrlFunction', function() {
describe('with number range', function() { describe('with number range', function() {
it('creates expected URLs', function() { it('creates expected URLs', function() {
var template = 'http://tile-{1-3}/{z}/{x}/{y}'; var template = 'http://tile-{1-3}/{z}/{x}/{y}';
var urls = _ol_TileUrlFunction_.expandUrl(template); var urls = expandUrl(template);
expect(urls).to.eql([ expect(urls).to.eql([
'http://tile-1/{z}/{x}/{y}', 'http://tile-1/{z}/{x}/{y}',
'http://tile-2/{z}/{x}/{y}', 'http://tile-2/{z}/{x}/{y}',
@@ -18,7 +18,7 @@ describe('ol.TileUrlFunction', function() {
}); });
it('creates expected URLs', function() { it('creates expected URLs', function() {
var template = 'http://tile-{9-11}/{z}/{x}/{y}'; var template = 'http://tile-{9-11}/{z}/{x}/{y}';
var urls = _ol_TileUrlFunction_.expandUrl(template); var urls = expandUrl(template);
expect(urls).to.eql([ expect(urls).to.eql([
'http://tile-9/{z}/{x}/{y}', 'http://tile-9/{z}/{x}/{y}',
'http://tile-10/{z}/{x}/{y}', 'http://tile-10/{z}/{x}/{y}',
@@ -29,7 +29,7 @@ describe('ol.TileUrlFunction', function() {
describe('with character range', function() { describe('with character range', function() {
it('creates expected URLs', function() { it('creates expected URLs', function() {
var template = 'http://tile-{c-e}/{z}/{x}/{y}'; var template = 'http://tile-{c-e}/{z}/{x}/{y}';
var urls = _ol_TileUrlFunction_.expandUrl(template); var urls = expandUrl(template);
expect(urls).to.eql([ expect(urls).to.eql([
'http://tile-c/{z}/{x}/{y}', 'http://tile-c/{z}/{x}/{y}',
'http://tile-d/{z}/{x}/{y}', 'http://tile-d/{z}/{x}/{y}',
@@ -40,7 +40,7 @@ describe('ol.TileUrlFunction', function() {
describe('without range', function() { describe('without range', function() {
it('creates expected URLs', function() { it('creates expected URLs', function() {
var template = 'http://tiles.example.com/{z}/{x}/{y}'; var template = 'http://tiles.example.com/{z}/{x}/{y}';
var urls = _ol_TileUrlFunction_.expandUrl(template); var urls = expandUrl(template);
expect(urls).to.eql([ expect(urls).to.eql([
'http://tiles.example.com/{z}/{x}/{y}' 'http://tiles.example.com/{z}/{x}/{y}'
]); ]);
@@ -51,14 +51,12 @@ describe('ol.TileUrlFunction', function() {
describe('createFromTemplate', function() { describe('createFromTemplate', function() {
var tileGrid = _ol_tilegrid_.createXYZ(); var tileGrid = _ol_tilegrid_.createXYZ();
it('creates expected URL', function() { it('creates expected URL', function() {
var tileUrl = _ol_TileUrlFunction_.createFromTemplate( var tileUrl = createFromTemplate('{z}/{x}/{y}', tileGrid);
'{z}/{x}/{y}', tileGrid);
expect(tileUrl([3, 2, -2])).to.eql('3/2/1'); expect(tileUrl([3, 2, -2])).to.eql('3/2/1');
expect(tileUrl(null)).to.be(undefined); expect(tileUrl(null)).to.be(undefined);
}); });
it('accepts {-y} placeholder', function() { it('accepts {-y} placeholder', function() {
var tileUrl = _ol_TileUrlFunction_.createFromTemplate( var tileUrl = createFromTemplate('{z}/{x}/{-y}', tileGrid);
'{z}/{x}/{-y}', tileGrid);
expect(tileUrl([3, 2, -3])).to.eql('3/2/5'); expect(tileUrl([3, 2, -3])).to.eql('3/2/5');
}); });
it('returns correct value for {-y} with custom tile grids', function() { it('returns correct value for {-y} with custom tile grids', function() {
@@ -67,13 +65,11 @@ describe('ol.TileUrlFunction', function() {
origin: [-180, -90], origin: [-180, -90],
resolutions: [360 / 256, 360 / 512, 360 / 1024, 360 / 2048] resolutions: [360 / 256, 360 / 512, 360 / 1024, 360 / 2048]
}); });
var tileUrl = _ol_TileUrlFunction_.createFromTemplate( var tileUrl = createFromTemplate('{z}/{x}/{-y}', customTileGrid);
'{z}/{x}/{-y}', customTileGrid);
expect(tileUrl([3, 2, -3])).to.eql('3/2/1'); expect(tileUrl([3, 2, -3])).to.eql('3/2/1');
}); });
it('replaces multiple placeholder occurrences', function() { it('replaces multiple placeholder occurrences', function() {
var tileUrl = _ol_TileUrlFunction_.createFromTemplate( var tileUrl = createFromTemplate('{z}/{z}{x}{y}', tileGrid);
'{z}/{z}{x}{y}', tileGrid);
expect(tileUrl([3, 2, -2])).to.eql('3/321'); expect(tileUrl([3, 2, -2])).to.eql('3/321');
}); });
}); });
@@ -86,8 +82,7 @@ describe('ol.TileUrlFunction', function() {
'http://tile-2/{z}/{x}/{y}', 'http://tile-2/{z}/{x}/{y}',
'http://tile-3/{z}/{x}/{y}' 'http://tile-3/{z}/{x}/{y}'
]; ];
var tileUrlFunction = _ol_TileUrlFunction_.createFromTemplates( var tileUrlFunction = createFromTemplates(templates, tileGrid);
templates, tileGrid);
var tileCoord = [3, 2, -2]; var tileCoord = [3, 2, -2];
/* eslint-disable openlayers-internal/no-missing-requires */ /* eslint-disable openlayers-internal/no-missing-requires */
@@ -115,9 +110,9 @@ describe('ol.TileUrlFunction', function() {
describe('createFromTileUrlFunctions', function() { describe('createFromTileUrlFunctions', function() {
var tileGrid = _ol_tilegrid_.createXYZ(); var tileGrid = _ol_tilegrid_.createXYZ();
it('creates expected URL', function() { it('creates expected URL', function() {
var tileUrl = _ol_TileUrlFunction_.createFromTileUrlFunctions([ var tileUrl = createFromTileUrlFunctions([
_ol_TileUrlFunction_.createFromTemplate('a', tileGrid), createFromTemplate('a', tileGrid),
_ol_TileUrlFunction_.createFromTemplate('b', tileGrid) createFromTemplate('b', tileGrid)
]); ]);
var tileUrl1 = tileUrl([1, 0, 0]); var tileUrl1 = tileUrl([1, 0, 0]);
var tileUrl2 = tileUrl([1, 0, 1]); var tileUrl2 = tileUrl([1, 0, 1]);