Named export for ol/tileurlfunction

And change module name from ol/TileUrlFunction to ol/tileurlfunction
This commit is contained in:
Frederic Junod
2017-12-17 18:15:19 +01:00
parent db3e885076
commit 3cc63c4767
9 changed files with 47 additions and 61 deletions

View File

@@ -2,7 +2,7 @@
* @module ol/source/BingMaps
*/
import {inherits} from '../index.js';
import _ol_TileUrlFunction_ from '../TileUrlFunction.js';
import {createFromTileUrlFunctions} from '../tileurlfunction.js';
import {applyTransform, intersects} from '../extent.js';
import _ol_net_ from '../net.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 hidpi = this.hidpi_;
this.tileUrlFunction = _ol_TileUrlFunction_.createFromTileUrlFunctions(
this.tileUrlFunction = createFromTileUrlFunctions(
resource.imageUrlSubdomains.map(function(subdomain) {
var quadKeyTileCoord = [0, 0, 0];
var imageUrl = resource.imageUrl

View File

@@ -8,7 +8,7 @@
*/
import {inherits} from '../index.js';
import _ol_TileUrlFunction_ from '../TileUrlFunction.js';
import {createFromTemplates} from '../tileurlfunction.js';
import _ol_asserts_ from '../asserts.js';
import {applyTransform, intersects} from '../extent.js';
import _ol_net_ from '../net.js';
@@ -133,8 +133,7 @@ _ol_source_TileJSON_.prototype.handleTileJSONResponse = function(tileJSON) {
});
this.tileGrid = tileGrid;
this.tileUrlFunction =
_ol_TileUrlFunction_.createFromTemplates(tileJSON.tiles, tileGrid);
this.tileUrlFunction = createFromTemplates(tileJSON.tiles, tileGrid);
if (tileJSON.attribution !== undefined && !this.getAttributions()) {
var attributionExtent = extent !== undefined ?

View File

@@ -4,7 +4,7 @@
import {inherits} from '../index.js';
import _ol_Tile_ from '../Tile.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_events_ from '../events.js';
import EventType from '../events/EventType.js';
@@ -42,7 +42,7 @@ var _ol_source_TileUTFGrid_ = function(options) {
* @private
* @type {!ol.TileUrlFunctionType}
*/
this.tileUrlFunction_ = _ol_TileUrlFunction_.nullTileUrlFunction;
this.tileUrlFunction_ = nullTileUrlFunction;
/**
* @private
@@ -193,8 +193,7 @@ _ol_source_TileUTFGrid_.prototype.handleTileJSONResponse = function(tileJSON) {
return;
}
this.tileUrlFunction_ =
_ol_TileUrlFunction_.createFromTemplates(grids, tileGrid);
this.tileUrlFunction_ = createFromTemplates(grids, tileGrid);
if (tileJSON.attribution !== undefined) {
var attributionExtent = extent !== undefined ?

View File

@@ -3,7 +3,7 @@
*/
import {getUid, inherits} from '../index.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_TileEventType_ from '../source/TileEventType.js';
import _ol_tilecoord_ from '../tilecoord.js';
@@ -44,8 +44,7 @@ var _ol_source_UrlTile_ = function(options) {
* @type {ol.TileUrlFunctionType}
*/
this.tileUrlFunction = this.fixedTileUrlFunction ?
this.fixedTileUrlFunction.bind(this) :
_ol_TileUrlFunction_.nullTileUrlFunction;
this.fixedTileUrlFunction.bind(this) : nullTileUrlFunction;
/**
* @protected
@@ -171,10 +170,10 @@ _ol_source_UrlTile_.prototype.setTileUrlFunction = function(tileUrlFunction, opt
* @api
*/
_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.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');
this.setTileUrlFunction(this.fixedTileUrlFunction ?
this.fixedTileUrlFunction.bind(this) :
_ol_TileUrlFunction_.createFromTemplates(urls, this.tileGrid), key);
createFromTemplates(urls, this.tileGrid), key);
};

View File

@@ -2,7 +2,7 @@
* @module ol/source/WMTS
*/
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 {containsExtent} from '../extent.js';
import _ol_obj_ from '../obj.js';
@@ -63,7 +63,7 @@ var _ol_source_WMTS_ = function(options) {
var urls = options.urls;
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)
@@ -151,9 +151,7 @@ var _ol_source_WMTS_ = function(options) {
};
var tileUrlFunction = (urls && urls.length > 0) ?
_ol_TileUrlFunction_.createFromTileUrlFunctions(
urls.map(this.createFromWMTSTemplate_)) :
_ol_TileUrlFunction_.nullTileUrlFunction;
createFromTileUrlFunctions(urls.map(this.createFromWMTSTemplate_)) : nullTileUrlFunction;
_ol_source_TileImage_.call(this, {
attributions: options.attributions,
@@ -187,7 +185,7 @@ _ol_source_WMTS_.prototype.setUrls = function(urls) {
var key = urls.join('\n');
this.setTileUrlFunction(this.fixedTileUrlFunction ?
this.fixedTileUrlFunction.bind(this) :
_ol_TileUrlFunction_.createFromTileUrlFunctions(urls.map(this.createFromWMTSTemplate_.bind(this))), key);
createFromTileUrlFunctions(urls.map(this.createFromWMTSTemplate_.bind(this))), key);
};
/**

View File

@@ -5,7 +5,7 @@ import {DEFAULT_TILE_SIZE} from '../tilegrid/common.js';
import {inherits} from '../index.js';
import _ol_ImageTile_ from '../ImageTile.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 {createCanvasContext2D} from '../dom.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) {
url += '{TileGroup}/{z}-{x}-{y}.jpg';
}
var urls = _ol_TileUrlFunction_.expandUrl(url);
var urls = expandUrl(url);
/**
* @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);