Rename _ol_source_TileImage_ to TileImage

This commit is contained in:
Tim Schaub
2018-01-08 13:53:35 -07:00
parent f184f6685d
commit a66128caa9
13 changed files with 49 additions and 49 deletions

View File

@@ -5,7 +5,7 @@ import TileLayer from '../src/ol/layer/Tile.js';
import {get as getProjection, getTransform} from '../src/ol/proj.js';
import {register} from '../src/ol/proj/proj4.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_TileImage_ from '../src/ol/source/TileImage.js';
import TileImage from '../src/ol/source/TileImage.js';
import proj4 from 'proj4';
@@ -102,7 +102,7 @@ renderEdgesCheckbox.onchange = function() {
map.getLayers().forEach(function(layer) {
if (layer instanceof TileLayer) {
var source = layer.getSource();
if (source instanceof _ol_source_TileImage_) {
if (source instanceof TileImage) {
source.setRenderReprojectionEdges(renderEdgesCheckbox.checked);
}
}

View File

@@ -6,7 +6,7 @@ import TileLayer from '../src/ol/layer/Tile.js';
import {get as getProjection} from '../src/ol/proj.js';
import {register} from '../src/ol/proj/proj4.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_TileImage_ from '../src/ol/source/TileImage.js';
import TileImage from '../src/ol/source/TileImage.js';
import _ol_source_TileWMS_ from '../src/ol/source/TileWMS.js';
import _ol_source_WMTS_ from '../src/ol/source/WMTS.js';
import _ol_source_XYZ_ from '../src/ol/source/XYZ.js';
@@ -202,7 +202,7 @@ updateViewProjection();
var updateRenderEdgesOnLayer = function(layer) {
if (layer instanceof TileLayer) {
var source = layer.getSource();
if (source instanceof _ol_source_TileImage_) {
if (source instanceof TileImage) {
source.setRenderReprojectionEdges(renderEdges);
}
}

View File

@@ -7,7 +7,7 @@ import {applyTransform, intersects} from '../extent.js';
import _ol_net_ from '../net.js';
import {get as getProjection, getTransformFromProjections} from '../proj.js';
import SourceState from '../source/State.js';
import _ol_source_TileImage_ from '../source/TileImage.js';
import TileImage from '../source/TileImage.js';
import _ol_tilecoord_ from '../tilecoord.js';
import _ol_tilegrid_ from '../tilegrid.js';
@@ -28,7 +28,7 @@ var BingMaps = function(options) {
*/
this.hidpi_ = options.hidpi !== undefined ? options.hidpi : false;
_ol_source_TileImage_.call(this, {
TileImage.call(this, {
cacheSize: options.cacheSize,
crossOrigin: 'anonymous',
opaque: true,
@@ -75,7 +75,7 @@ var BingMaps = function(options) {
};
inherits(BingMaps, _ol_source_TileImage_);
inherits(BingMaps, TileImage);
/**

View File

@@ -6,7 +6,7 @@ import {createEmpty} from '../extent.js';
import {modulo} from '../math.js';
import _ol_obj_ from '../obj.js';
import _ol_size_ from '../size.js';
import _ol_source_TileImage_ from '../source/TileImage.js';
import TileImage from '../source/TileImage.js';
import _ol_tilecoord_ from '../tilecoord.js';
import _ol_uri_ from '../uri.js';
@@ -28,7 +28,7 @@ var _ol_source_TileArcGISRest_ = function(opt_options) {
var options = opt_options || {};
_ol_source_TileImage_.call(this, {
TileImage.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize,
crossOrigin: options.crossOrigin,
@@ -57,7 +57,7 @@ var _ol_source_TileArcGISRest_ = function(opt_options) {
this.setKey(this.getKeyForParams_());
};
inherits(_ol_source_TileArcGISRest_, _ol_source_TileImage_);
inherits(_ol_source_TileArcGISRest_, TileImage);
/**

View File

@@ -24,7 +24,7 @@ import _ol_tilegrid_ from '../tilegrid.js';
* @param {olx.source.TileImageOptions} options Image tile options.
* @api
*/
var _ol_source_TileImage_ = function(options) {
var TileImage = function(options) {
_ol_source_UrlTile_.call(this, {
attributions: options.attributions,
@@ -35,7 +35,7 @@ var _ol_source_TileImage_ = function(options) {
state: options.state,
tileGrid: options.tileGrid,
tileLoadFunction: options.tileLoadFunction ?
options.tileLoadFunction : _ol_source_TileImage_.defaultTileLoadFunction,
options.tileLoadFunction : TileImage.defaultTileLoadFunction,
tilePixelRatio: options.tilePixelRatio,
tileUrlFunction: options.tileUrlFunction,
url: options.url,
@@ -84,13 +84,13 @@ var _ol_source_TileImage_ = function(options) {
this.renderReprojectionEdges_ = false;
};
inherits(_ol_source_TileImage_, _ol_source_UrlTile_);
inherits(TileImage, _ol_source_UrlTile_);
/**
* @inheritDoc
*/
_ol_source_TileImage_.prototype.canExpireCache = function() {
TileImage.prototype.canExpireCache = function() {
if (!ENABLE_RASTER_REPROJECTION) {
return _ol_source_UrlTile_.prototype.canExpireCache.call(this);
}
@@ -110,7 +110,7 @@ _ol_source_TileImage_.prototype.canExpireCache = function() {
/**
* @inheritDoc
*/
_ol_source_TileImage_.prototype.expireCache = function(projection, usedTiles) {
TileImage.prototype.expireCache = function(projection, usedTiles) {
if (!ENABLE_RASTER_REPROJECTION) {
_ol_source_UrlTile_.prototype.expireCache.call(this, projection, usedTiles);
return;
@@ -128,7 +128,7 @@ _ol_source_TileImage_.prototype.expireCache = function(projection, usedTiles) {
/**
* @inheritDoc
*/
_ol_source_TileImage_.prototype.getGutter = function(projection) {
TileImage.prototype.getGutter = function(projection) {
if (ENABLE_RASTER_REPROJECTION &&
this.getProjection() && projection && !equivalent(this.getProjection(), projection)) {
return 0;
@@ -142,7 +142,7 @@ _ol_source_TileImage_.prototype.getGutter = function(projection) {
* @protected
* @return {number} Gutter.
*/
_ol_source_TileImage_.prototype.getGutterInternal = function() {
TileImage.prototype.getGutterInternal = function() {
return 0;
};
@@ -150,7 +150,7 @@ _ol_source_TileImage_.prototype.getGutterInternal = function() {
/**
* @inheritDoc
*/
_ol_source_TileImage_.prototype.getOpaque = function(projection) {
TileImage.prototype.getOpaque = function(projection) {
if (ENABLE_RASTER_REPROJECTION &&
this.getProjection() && projection && !equivalent(this.getProjection(), projection)) {
return false;
@@ -163,7 +163,7 @@ _ol_source_TileImage_.prototype.getOpaque = function(projection) {
/**
* @inheritDoc
*/
_ol_source_TileImage_.prototype.getTileGridForProjection = function(projection) {
TileImage.prototype.getTileGridForProjection = function(projection) {
if (!ENABLE_RASTER_REPROJECTION) {
return _ol_source_UrlTile_.prototype.getTileGridForProjection.call(this, projection);
}
@@ -184,7 +184,7 @@ _ol_source_TileImage_.prototype.getTileGridForProjection = function(projection)
/**
* @inheritDoc
*/
_ol_source_TileImage_.prototype.getTileCacheForProjection = function(projection) {
TileImage.prototype.getTileCacheForProjection = function(projection) {
if (!ENABLE_RASTER_REPROJECTION) {
return _ol_source_UrlTile_.prototype.getTileCacheForProjection.call(this, projection);
}
@@ -210,7 +210,7 @@ _ol_source_TileImage_.prototype.getTileCacheForProjection = function(projection)
* @return {!ol.Tile} Tile.
* @private
*/
_ol_source_TileImage_.prototype.createTile_ = function(z, x, y, pixelRatio, projection, key) {
TileImage.prototype.createTile_ = function(z, x, y, pixelRatio, projection, key) {
var tileCoord = [z, x, y];
var urlTileCoord = this.getTileCoordForTileUrlFunction(
tileCoord, projection);
@@ -233,7 +233,7 @@ _ol_source_TileImage_.prototype.createTile_ = function(z, x, y, pixelRatio, proj
/**
* @inheritDoc
*/
_ol_source_TileImage_.prototype.getTile = function(z, x, y, pixelRatio, projection) {
TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection) {
var sourceProjection = /** @type {!ol.proj.Projection} */ (this.getProjection());
if (!ENABLE_RASTER_REPROJECTION ||
!sourceProjection || !projection || equivalent(sourceProjection, projection)) {
@@ -287,7 +287,7 @@ _ol_source_TileImage_.prototype.getTile = function(z, x, y, pixelRatio, projecti
* @return {!ol.Tile} Tile.
* @protected
*/
_ol_source_TileImage_.prototype.getTileInternal = function(z, x, y, pixelRatio, projection) {
TileImage.prototype.getTileInternal = function(z, x, y, pixelRatio, projection) {
var tile = null;
var tileCoordKey = _ol_tilecoord_.getKeyZXY(z, x, y);
var key = this.getKey();
@@ -323,7 +323,7 @@ _ol_source_TileImage_.prototype.getTileInternal = function(z, x, y, pixelRatio,
* @param {boolean} render Render the edges.
* @api
*/
_ol_source_TileImage_.prototype.setRenderReprojectionEdges = function(render) {
TileImage.prototype.setRenderReprojectionEdges = function(render) {
if (!ENABLE_RASTER_REPROJECTION ||
this.renderReprojectionEdges_ == render) {
return;
@@ -348,7 +348,7 @@ _ol_source_TileImage_.prototype.setRenderReprojectionEdges = function(render) {
* @param {ol.tilegrid.TileGrid} tilegrid Tile grid to use for the projection.
* @api
*/
_ol_source_TileImage_.prototype.setTileGridForProjection = function(projection, tilegrid) {
TileImage.prototype.setTileGridForProjection = function(projection, tilegrid) {
if (ENABLE_RASTER_REPROJECTION) {
var proj = getProjection(projection);
if (proj) {
@@ -365,7 +365,7 @@ _ol_source_TileImage_.prototype.setTileGridForProjection = function(projection,
* @param {ol.ImageTile} imageTile Image tile.
* @param {string} src Source.
*/
_ol_source_TileImage_.defaultTileLoadFunction = function(imageTile, src) {
TileImage.defaultTileLoadFunction = function(imageTile, src) {
imageTile.getImage().src = src;
};
export default _ol_source_TileImage_;
export default TileImage;

View File

@@ -14,7 +14,7 @@ import {applyTransform, intersects} from '../extent.js';
import _ol_net_ from '../net.js';
import {get as getProjection, getTransformFromProjections} from '../proj.js';
import SourceState from '../source/State.js';
import _ol_source_TileImage_ from '../source/TileImage.js';
import TileImage from '../source/TileImage.js';
import _ol_tilegrid_ from '../tilegrid.js';
/**
@@ -34,7 +34,7 @@ var _ol_source_TileJSON_ = function(options) {
*/
this.tileJSON_ = null;
_ol_source_TileImage_.call(this, {
TileImage.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize,
crossOrigin: options.crossOrigin,
@@ -65,7 +65,7 @@ var _ol_source_TileJSON_ = function(options) {
};
inherits(_ol_source_TileJSON_, _ol_source_TileImage_);
inherits(_ol_source_TileJSON_, TileImage);
/**

View File

@@ -11,7 +11,7 @@ import {modulo} from '../math.js';
import {get as getProjection, transform, transformExtent} from '../proj.js';
import _ol_reproj_ from '../reproj.js';
import _ol_size_ from '../size.js';
import _ol_source_TileImage_ from '../source/TileImage.js';
import TileImage from '../source/TileImage.js';
import WMSServerType from '../source/WMSServerType.js';
import _ol_tilecoord_ from '../tilecoord.js';
import _ol_string_ from '../string.js';
@@ -34,7 +34,7 @@ var _ol_source_TileWMS_ = function(opt_options) {
var transparent = 'TRANSPARENT' in params ? params['TRANSPARENT'] : true;
_ol_source_TileImage_.call(this, {
TileImage.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize,
crossOrigin: options.crossOrigin,
@@ -91,7 +91,7 @@ var _ol_source_TileWMS_ = function(opt_options) {
};
inherits(_ol_source_TileWMS_, _ol_source_TileImage_);
inherits(_ol_source_TileWMS_, TileImage);
/**

View File

@@ -7,7 +7,7 @@ import {find, findIndex, includes} from '../array.js';
import {containsExtent} from '../extent.js';
import _ol_obj_ from '../obj.js';
import {get as getProjection, equivalent, transformExtent} from '../proj.js';
import _ol_source_TileImage_ from '../source/TileImage.js';
import TileImage from '../source/TileImage.js';
import WMTSRequestEncoding from '../source/WMTSRequestEncoding.js';
import {createFromCapabilitiesMatrixSet} from '../tilegrid/WMTS.js';
import _ol_uri_ from '../uri.js';
@@ -153,7 +153,7 @@ var _ol_source_WMTS_ = function(options) {
var tileUrlFunction = (urls && urls.length > 0) ?
createFromTileUrlFunctions(urls.map(this.createFromWMTSTemplate_)) : nullTileUrlFunction;
_ol_source_TileImage_.call(this, {
TileImage.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize,
crossOrigin: options.crossOrigin,
@@ -173,7 +173,7 @@ var _ol_source_WMTS_ = function(options) {
};
inherits(_ol_source_WMTS_, _ol_source_TileImage_);
inherits(_ol_source_WMTS_, TileImage);
/**
* Set the URLs to use for requests.

View File

@@ -2,7 +2,7 @@
* @module ol/source/XYZ
*/
import {inherits} from '../index.js';
import _ol_source_TileImage_ from '../source/TileImage.js';
import TileImage from '../source/TileImage.js';
import _ol_tilegrid_ from '../tilegrid.js';
/**
@@ -40,7 +40,7 @@ var _ol_source_XYZ_ = function(opt_options) {
tileSize: options.tileSize
});
_ol_source_TileImage_.call(this, {
TileImage.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize,
crossOrigin: options.crossOrigin,
@@ -59,5 +59,5 @@ var _ol_source_XYZ_ = function(opt_options) {
};
inherits(_ol_source_XYZ_, _ol_source_TileImage_);
inherits(_ol_source_XYZ_, TileImage);
export default _ol_source_XYZ_;

View File

@@ -10,7 +10,7 @@ import {assert} from '../asserts.js';
import {createCanvasContext2D} from '../dom.js';
import {getTopLeft} from '../extent.js';
import _ol_size_ from '../size.js';
import _ol_source_TileImage_ from '../source/TileImage.js';
import TileImage from '../source/TileImage.js';
import TileGrid from '../tilegrid/TileGrid.js';
/**
@@ -137,7 +137,7 @@ var _ol_source_Zoomify_ = function(opt_options) {
var ZoomifyTileClass = _ol_source_Zoomify_.Tile_.bind(null, tileGrid);
_ol_source_TileImage_.call(this, {
TileImage.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize,
crossOrigin: options.crossOrigin,
@@ -151,7 +151,7 @@ var _ol_source_Zoomify_ = function(opt_options) {
};
inherits(_ol_source_Zoomify_, _ol_source_TileImage_);
inherits(_ol_source_Zoomify_, TileImage);
/**
* @constructor

View File

@@ -5,7 +5,7 @@ import Point from '../../../../src/ol/geom/Point.js';
import TileLayer from '../../../../src/ol/layer/Tile.js';
import _ol_obj_ from '../../../../src/ol/obj.js';
import {transform} from '../../../../src/ol/proj.js';
import _ol_source_TileImage_ from '../../../../src/ol/source/TileImage.js';
import TileImage from '../../../../src/ol/source/TileImage.js';
import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js';
import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
@@ -218,7 +218,7 @@ describe('ol.rendering.layer.Tile', function() {
describe('tile layer with non-square tiles', function() {
function createSource(tileSize) {
return new _ol_source_TileImage_({
return new TileImage({
url: 'rendering/ol/data/tiles/' + tileSize + '/{z}/{x}/{y}.png',
tileGrid: _ol_tilegrid_.createXYZ({
tileSize: tileSize.split('x')

View File

@@ -7,7 +7,7 @@ import {register} from '../../../../src/ol/proj/proj4.js';
import _ol_proj_EPSG3857_ from '../../../../src/ol/proj/EPSG3857.js';
import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js';
import _ol_reproj_Tile_ from '../../../../src/ol/reproj/Tile.js';
import _ol_source_TileImage_ from '../../../../src/ol/source/TileImage.js';
import TileImage from '../../../../src/ol/source/TileImage.js';
import _ol_tilecoord_ from '../../../../src/ol/tilecoord.js';
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
@@ -15,7 +15,7 @@ import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
describe('ol.source.TileImage', function() {
function createSource(opt_proj, opt_tileGrid, opt_cacheSize) {
var proj = opt_proj || 'EPSG:3857';
return new _ol_source_TileImage_({
return new TileImage({
cacheSize: opt_cacheSize,
projection: proj,
tileGrid: opt_tileGrid ||
@@ -181,7 +181,7 @@ describe('ol.source.TileImage', function() {
var source;
beforeEach(function() {
source = new _ol_source_TileImage_({
source = new TileImage({
url: '{z}/{x}/{y}'
});
});

View File

@@ -1,5 +1,5 @@
import TileSource from '../../../../src/ol/source/Tile.js';
import _ol_source_TileImage_ from '../../../../src/ol/source/TileImage.js';
import TileImage from '../../../../src/ol/source/TileImage.js';
import _ol_source_UrlTile_ from '../../../../src/ol/source/UrlTile.js';
import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js';
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
@@ -12,7 +12,7 @@ describe('ol.source.XYZ', function() {
it('can be constructed without options', function() {
var source = new _ol_source_XYZ_();
expect(source).to.be.an(_ol_source_XYZ_);
expect(source).to.be.an(_ol_source_TileImage_);
expect(source).to.be.an(TileImage);
expect(source).to.be.an(_ol_source_UrlTile_);
expect(source).to.be.an(TileSource);
});