Rename _ol_source_TileDebug_ to TileDebug
This commit is contained in:
@@ -4,7 +4,7 @@ import {defaults as defaultControls} from '../src/ol/control.js';
|
|||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
import {fromLonLat} from '../src/ol/proj.js';
|
import {fromLonLat} from '../src/ol/proj.js';
|
||||||
import OSM from '../src/ol/source/OSM.js';
|
import OSM from '../src/ol/source/OSM.js';
|
||||||
import _ol_source_TileDebug_ from '../src/ol/source/TileDebug.js';
|
import TileDebug from '../src/ol/source/TileDebug.js';
|
||||||
|
|
||||||
|
|
||||||
var osmSource = new OSM();
|
var osmSource = new OSM();
|
||||||
@@ -14,7 +14,7 @@ var map = new Map({
|
|||||||
source: osmSource
|
source: osmSource
|
||||||
}),
|
}),
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
source: new _ol_source_TileDebug_({
|
source: new TileDebug({
|
||||||
projection: 'EPSG:3857',
|
projection: 'EPSG:3857',
|
||||||
tileGrid: osmSource.getTileGrid()
|
tileGrid: osmSource.getTileGrid()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import _ol_tilecoord_ from '../tilecoord.js';
|
|||||||
* @param {olx.source.TileDebugOptions} options Debug tile options.
|
* @param {olx.source.TileDebugOptions} options Debug tile options.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
var _ol_source_TileDebug_ = function(options) {
|
var TileDebug = function(options) {
|
||||||
|
|
||||||
TileSource.call(this, {
|
TileSource.call(this, {
|
||||||
opaque: false,
|
opaque: false,
|
||||||
@@ -33,13 +33,13 @@ var _ol_source_TileDebug_ = function(options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_source_TileDebug_, TileSource);
|
inherits(TileDebug, TileSource);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_source_TileDebug_.prototype.getTile = function(z, x, y) {
|
TileDebug.prototype.getTile = function(z, x, y) {
|
||||||
var tileCoordKey = _ol_tilecoord_.getKeyZXY(z, x, y);
|
var tileCoordKey = _ol_tilecoord_.getKeyZXY(z, x, y);
|
||||||
if (this.tileCache.containsKey(tileCoordKey)) {
|
if (this.tileCache.containsKey(tileCoordKey)) {
|
||||||
return /** @type {!ol.source.TileDebug.Tile_} */ (this.tileCache.get(tileCoordKey));
|
return /** @type {!ol.source.TileDebug.Tile_} */ (this.tileCache.get(tileCoordKey));
|
||||||
@@ -49,7 +49,7 @@ _ol_source_TileDebug_.prototype.getTile = function(z, x, y) {
|
|||||||
var textTileCoord = this.getTileCoordForTileUrlFunction(tileCoord);
|
var textTileCoord = this.getTileCoordForTileUrlFunction(tileCoord);
|
||||||
var text = !textTileCoord ? '' :
|
var text = !textTileCoord ? '' :
|
||||||
this.getTileCoordForTileUrlFunction(textTileCoord).toString();
|
this.getTileCoordForTileUrlFunction(textTileCoord).toString();
|
||||||
var tile = new _ol_source_TileDebug_.Tile_(tileCoord, tileSize, text);
|
var tile = new TileDebug.Tile_(tileCoord, tileSize, text);
|
||||||
this.tileCache.set(tileCoordKey, tile);
|
this.tileCache.set(tileCoordKey, tile);
|
||||||
return tile;
|
return tile;
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ _ol_source_TileDebug_.prototype.getTile = function(z, x, y) {
|
|||||||
* @param {string} text Text.
|
* @param {string} text Text.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_source_TileDebug_.Tile_ = function(tileCoord, tileSize, text) {
|
TileDebug.Tile_ = function(tileCoord, tileSize, text) {
|
||||||
|
|
||||||
_ol_Tile_.call(this, tileCoord, TileState.LOADED);
|
_ol_Tile_.call(this, tileCoord, TileState.LOADED);
|
||||||
|
|
||||||
@@ -87,14 +87,14 @@ _ol_source_TileDebug_.Tile_ = function(tileCoord, tileSize, text) {
|
|||||||
this.canvas_ = null;
|
this.canvas_ = null;
|
||||||
|
|
||||||
};
|
};
|
||||||
inherits(_ol_source_TileDebug_.Tile_, _ol_Tile_);
|
inherits(TileDebug.Tile_, _ol_Tile_);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the image element for this tile.
|
* Get the image element for this tile.
|
||||||
* @return {HTMLCanvasElement} Image.
|
* @return {HTMLCanvasElement} Image.
|
||||||
*/
|
*/
|
||||||
_ol_source_TileDebug_.Tile_.prototype.getImage = function() {
|
TileDebug.Tile_.prototype.getImage = function() {
|
||||||
if (this.canvas_) {
|
if (this.canvas_) {
|
||||||
return this.canvas_;
|
return this.canvas_;
|
||||||
} else {
|
} else {
|
||||||
@@ -119,5 +119,5 @@ _ol_source_TileDebug_.Tile_.prototype.getImage = function() {
|
|||||||
/**
|
/**
|
||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
_ol_source_TileDebug_.Tile_.prototype.load = function() {};
|
TileDebug.Tile_.prototype.load = function() {};
|
||||||
export default _ol_source_TileDebug_;
|
export default TileDebug;
|
||||||
|
|||||||
Reference in New Issue
Block a user