Rename VectorImageTile to VectorRenderTile
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @module ol/VectorImageTile
|
* @module ol/VectorRenderTile
|
||||||
*/
|
*/
|
||||||
import {getUid} from './util.js';
|
import {getUid} from './util.js';
|
||||||
import Tile from './Tile.js';
|
import Tile from './Tile.js';
|
||||||
@@ -18,16 +18,16 @@ import {createCanvasContext2D} from './dom.js';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class VectorImageTile extends Tile {
|
class VectorRenderTile extends Tile {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
||||||
* @param {TileState} state State.
|
* @param {TileState} state State.
|
||||||
* @param {import("./tilecoord.js").TileCoord} urlTileCoord Wrapped tile coordinate for source urls.
|
* @param {import("./tilecoord.js").TileCoord} urlTileCoord Wrapped tile coordinate for source urls.
|
||||||
* @param {import("./tilegrid/TileGrid.js").default} sourceTileGrid Tile grid of the source.
|
* @param {import("./tilegrid/TileGrid.js").default} sourceTileGrid Tile grid of the source.
|
||||||
* @param {function(VectorImageTile):Array<import("./VectorTile").default>} getSourceTiles Function
|
* @param {function(VectorRenderTile):Array<import("./VectorTile").default>} getSourceTiles Function
|
||||||
* to get an source tiles for this tile.
|
* to get an source tiles for this tile.
|
||||||
* @param {function(VectorImageTile):void} removeSourceTiles Function to remove this tile from its
|
* @param {function(VectorRenderTile):void} removeSourceTiles Function to remove this tile from its
|
||||||
* source tiles's consumer count.
|
* source tiles's consumer count.
|
||||||
*/
|
*/
|
||||||
constructor(tileCoord, state, urlTileCoord, sourceTileGrid, getSourceTiles, removeSourceTiles) {
|
constructor(tileCoord, state, urlTileCoord, sourceTileGrid, getSourceTiles, removeSourceTiles) {
|
||||||
@@ -65,12 +65,12 @@ class VectorImageTile extends Tile {
|
|||||||
this.replayState_ = {};
|
this.replayState_ = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {!function(import("./VectorImageTile.js").default):Array<import("./VectorTile.js").default>}
|
* @type {!function(import("./VectorRenderTile.js").default):Array<import("./VectorTile.js").default>}
|
||||||
*/
|
*/
|
||||||
this.getSourceTiles_ = getSourceTiles;
|
this.getSourceTiles_ = getSourceTiles;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {!function(import("./VectorImageTile.js").default):void}
|
* @type {!function(import("./VectorRenderTile.js").default):void}
|
||||||
*/
|
*/
|
||||||
this.removeSourceTiles_ = removeSourceTiles;
|
this.removeSourceTiles_ = removeSourceTiles;
|
||||||
|
|
||||||
@@ -165,4 +165,4 @@ class VectorImageTile extends Tile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export default VectorImageTile;
|
export default VectorRenderTile;
|
||||||
+1
-1
@@ -26,7 +26,7 @@ export {default as Tile} from './Tile.js';
|
|||||||
export {default as TileCache} from './TileCache.js';
|
export {default as TileCache} from './TileCache.js';
|
||||||
export {default as TileQueue} from './TileQueue.js';
|
export {default as TileQueue} from './TileQueue.js';
|
||||||
export {default as TileRange} from './TileRange.js';
|
export {default as TileRange} from './TileRange.js';
|
||||||
export {default as VectorImageTile} from './VectorImageTile.js';
|
export {default as VectorRenderTile} from './VectorRenderTile.js';
|
||||||
export {default as VectorTile} from './VectorTile.js';
|
export {default as VectorTile} from './VectorTile.js';
|
||||||
export {default as View} from './View.js';
|
export {default as View} from './View.js';
|
||||||
|
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Object<string, import("../../VectorImageTile.js").default>}
|
* @type {!Object<string, import("../../VectorRenderTile.js").default>}
|
||||||
*/
|
*/
|
||||||
this.renderTileImageQueue_ = {};
|
this.renderTileImageQueue_ = {};
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import("../../VectorImageTile.js").default} tile Tile.
|
* @param {import("../../VectorRenderTile.js").default} tile Tile.
|
||||||
* @param {number} pixelRatio Pixel ratio.
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
* @param {import("../../proj/Projection").default} projection Projection.
|
* @param {import("../../proj/Projection").default} projection Projection.
|
||||||
*/
|
*/
|
||||||
@@ -176,7 +176,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
getTile(z, x, y, pixelRatio, projection) {
|
getTile(z, x, y, pixelRatio, projection) {
|
||||||
const tile = /** @type {import("../../VectorImageTile.js").default} */ (super.getTile(z, x, y, pixelRatio, projection));
|
const tile = /** @type {import("../../VectorRenderTile.js").default} */ (super.getTile(z, x, y, pixelRatio, projection));
|
||||||
this.prepareTile(tile, pixelRatio, projection);
|
this.prepareTile(tile, pixelRatio, projection);
|
||||||
if (tile.getState() < TileState.LOADED) {
|
if (tile.getState() < TileState.LOADED) {
|
||||||
const tileUid = getUid(tile);
|
const tileUid = getUid(tile);
|
||||||
@@ -217,7 +217,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import("../../VectorImageTile.js").default} tile Tile.
|
* @param {import("../../VectorRenderTile.js").default} tile Tile.
|
||||||
* @param {number} pixelRatio Pixel ratio.
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
* @param {import("../../proj/Projection.js").default} projection Projection.
|
* @param {import("../../proj/Projection.js").default} projection Projection.
|
||||||
* @private
|
* @private
|
||||||
@@ -323,7 +323,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
/** @type {!Object<string, boolean>} */
|
/** @type {!Object<string, boolean>} */
|
||||||
const features = {};
|
const features = {};
|
||||||
|
|
||||||
const renderedTiles = /** @type {Array<import("../../VectorImageTile.js").default>} */ (this.renderedTiles);
|
const renderedTiles = /** @type {Array<import("../../VectorRenderTile.js").default>} */ (this.renderedTiles);
|
||||||
|
|
||||||
let bufferedExtent, found;
|
let bufferedExtent, found;
|
||||||
let i, ii;
|
let i, ii;
|
||||||
@@ -452,7 +452,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
const clips = [];
|
const clips = [];
|
||||||
const zs = [];
|
const zs = [];
|
||||||
for (let i = tiles.length - 1; i >= 0; --i) {
|
for (let i = tiles.length - 1; i >= 0; --i) {
|
||||||
const tile = /** @type {import("../../VectorImageTile.js").default} */ (tiles[i]);
|
const tile = /** @type {import("../../VectorRenderTile.js").default} */ (tiles[i]);
|
||||||
if (tile.getState() == TileState.ABORT) {
|
if (tile.getState() == TileState.ABORT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -564,7 +564,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import("../../VectorImageTile.js").default} tile Tile.
|
* @param {import("../../VectorRenderTile.js").default} tile Tile.
|
||||||
* @param {number} pixelRatio Pixel ratio.
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
* @param {import("../../proj/Projection.js").default} projection Projection.
|
* @param {import("../../proj/Projection.js").default} projection Projection.
|
||||||
* @return {boolean} A new tile image was rendered.
|
* @return {boolean} A new tile image was rendered.
|
||||||
@@ -579,7 +579,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import("../../VectorImageTile.js").default} tile Tile.
|
* @param {import("../../VectorRenderTile.js").default} tile Tile.
|
||||||
* @param {number} pixelRatio Pixel ratio.
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
* @param {import("../../proj/Projection.js").default} projection Projection.
|
* @param {import("../../proj/Projection.js").default} projection Projection.
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import TileState from '../TileState.js';
|
import TileState from '../TileState.js';
|
||||||
import VectorImageTile from '../VectorImageTile.js';
|
import VectorRenderTile from '../VectorRenderTile.js';
|
||||||
import Tile from '../VectorTile.js';
|
import Tile from '../VectorTile.js';
|
||||||
import {toSize} from '../size.js';
|
import {toSize} from '../size.js';
|
||||||
import UrlTile from './UrlTile.js';
|
import UrlTile from './UrlTile.js';
|
||||||
@@ -172,7 +172,7 @@ class VectorTile extends UrlTile {
|
|||||||
/**
|
/**
|
||||||
* @param {number} pixelRatio Pixel ratio.
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
* @param {import("../proj/Projection").default} projection Projection.
|
* @param {import("../proj/Projection").default} projection Projection.
|
||||||
* @param {VectorImageTile} tile Vector image tile.
|
* @param {VectorRenderTile} tile Vector image tile.
|
||||||
* @return {Array<import("../VectorTile").default>} Tile keys.
|
* @return {Array<import("../VectorTile").default>} Tile keys.
|
||||||
*/
|
*/
|
||||||
getSourceTiles(pixelRatio, projection, tile) {
|
getSourceTiles(pixelRatio, projection, tile) {
|
||||||
@@ -272,7 +272,7 @@ class VectorTile extends UrlTile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {VectorImageTile} tile Tile.
|
* @param {VectorRenderTile} tile Tile.
|
||||||
* @param {Array<import("../VectorTile").default>} sourceTiles Source tiles.
|
* @param {Array<import("../VectorTile").default>} sourceTiles Source tiles.
|
||||||
*/
|
*/
|
||||||
addSourceTiles(tile, sourceTiles) {
|
addSourceTiles(tile, sourceTiles) {
|
||||||
@@ -283,7 +283,7 @@ class VectorTile extends UrlTile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {VectorImageTile} tile Tile.
|
* @param {VectorRenderTile} tile Tile.
|
||||||
*/
|
*/
|
||||||
removeSourceTiles(tile) {
|
removeSourceTiles(tile) {
|
||||||
const tileKey = getKey(tile.tileCoord);
|
const tileKey = getKey(tile.tileCoord);
|
||||||
@@ -314,7 +314,7 @@ class VectorTile extends UrlTile {
|
|||||||
const tileCoord = [z, x, y];
|
const tileCoord = [z, x, y];
|
||||||
const urlTileCoord = this.getTileCoordForTileUrlFunction(
|
const urlTileCoord = this.getTileCoordForTileUrlFunction(
|
||||||
tileCoord, projection);
|
tileCoord, projection);
|
||||||
const tile = new VectorImageTile(
|
const tile = new VectorRenderTile(
|
||||||
tileCoord,
|
tileCoord,
|
||||||
urlTileCoord !== null ? TileState.IDLE : TileState.EMPTY,
|
urlTileCoord !== null ? TileState.IDLE : TileState.EMPTY,
|
||||||
urlTileCoord,
|
urlTileCoord,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {clear} from '../../../../../src/ol/obj.js';
|
|||||||
import Feature from '../../../../../src/ol/Feature.js';
|
import Feature from '../../../../../src/ol/Feature.js';
|
||||||
import Map from '../../../../../src/ol/Map.js';
|
import Map from '../../../../../src/ol/Map.js';
|
||||||
import TileState from '../../../../../src/ol/TileState.js';
|
import TileState from '../../../../../src/ol/TileState.js';
|
||||||
import VectorImageTile from '../../../../../src/ol/VectorImageTile.js';
|
import VectorRenderTile from '../../../../../src/ol/VectorRenderTile.js';
|
||||||
import VectorTile from '../../../../../src/ol/VectorTile.js';
|
import VectorTile from '../../../../../src/ol/VectorTile.js';
|
||||||
import View from '../../../../../src/ol/View.js';
|
import View from '../../../../../src/ol/View.js';
|
||||||
import {getCenter} from '../../../../../src/ol/extent.js';
|
import {getCenter} from '../../../../../src/ol/extent.js';
|
||||||
@@ -243,7 +243,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
|
|||||||
sourceTile.getImage = function() {
|
sourceTile.getImage = function() {
|
||||||
return document.createElement('canvas');
|
return document.createElement('canvas');
|
||||||
};
|
};
|
||||||
const tile = new VectorImageTile([0, 0, 0], 1, [0, 0, 0], createXYZ(),
|
const tile = new VectorRenderTile([0, 0, 0], 1, [0, 0, 0], createXYZ(),
|
||||||
function() {
|
function() {
|
||||||
return sourceTile;
|
return sourceTile;
|
||||||
},
|
},
|
||||||
@@ -285,7 +285,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
|
|||||||
|
|
||||||
describe('#forEachFeatureAtCoordinate', function() {
|
describe('#forEachFeatureAtCoordinate', function() {
|
||||||
let layer, renderer, executorGroup, source;
|
let layer, renderer, executorGroup, source;
|
||||||
class TileClass extends VectorImageTile {
|
class TileClass extends VectorRenderTile {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(...arguments);
|
super(...arguments);
|
||||||
this.setState(TileState.LOADED);
|
this.setState(TileState.LOADED);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Map from '../../../../src/ol/Map.js';
|
import Map from '../../../../src/ol/Map.js';
|
||||||
import View from '../../../../src/ol/View.js';
|
import View from '../../../../src/ol/View.js';
|
||||||
import VectorImageTile from '../../../../src/ol/VectorImageTile.js';
|
import VectorRenderTile from '../../../../src/ol/VectorRenderTile.js';
|
||||||
import VectorTile from '../../../../src/ol/VectorTile.js';
|
import VectorTile from '../../../../src/ol/VectorTile.js';
|
||||||
import GeoJSON from '../../../../src/ol/format/GeoJSON.js';
|
import GeoJSON from '../../../../src/ol/format/GeoJSON.js';
|
||||||
import MVT from '../../../../src/ol/format/MVT.js';
|
import MVT from '../../../../src/ol/format/MVT.js';
|
||||||
@@ -41,7 +41,7 @@ describe('ol.source.VectorTile', function() {
|
|||||||
describe('#getTile()', function() {
|
describe('#getTile()', function() {
|
||||||
it('creates a tile with the correct tile class', function() {
|
it('creates a tile with the correct tile class', function() {
|
||||||
tile = source.getTile(0, 0, 0, 1, getProjection('EPSG:3857'));
|
tile = source.getTile(0, 0, 0, 1, getProjection('EPSG:3857'));
|
||||||
expect(tile).to.be.a(VectorImageTile);
|
expect(tile).to.be.a(VectorRenderTile);
|
||||||
});
|
});
|
||||||
it('sets the correct tileCoord on the created tile', function() {
|
it('sets the correct tileCoord on the created tile', function() {
|
||||||
expect(tile.getTileCoord()).to.eql([0, 0, 0]);
|
expect(tile.getTileCoord()).to.eql([0, 0, 0]);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {getKey} from '../../../src/ol/tilecoord.js';
|
|||||||
import EventType from '../../../src/ol/events/EventType.js';
|
import EventType from '../../../src/ol/events/EventType.js';
|
||||||
|
|
||||||
|
|
||||||
describe('ol.VectorImageTile', function() {
|
describe('ol.VectorRenderTile', function() {
|
||||||
|
|
||||||
it('triggers "change" when previously failed source tiles are loaded', function(done) {
|
it('triggers "change" when previously failed source tiles are loaded', function(done) {
|
||||||
let sourceTile;
|
let sourceTile;
|
||||||
|
|||||||
Reference in New Issue
Block a user