Remove unneeded type cast

This commit is contained in:
Frederic Junod
2019-01-28 15:33:57 +01:00
parent 5318d52036
commit 0b53a3229b
10 changed files with 24 additions and 24 deletions

View File

@@ -44,7 +44,7 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
const viewResolution = viewState.resolution;
const imageLayer = /** @type {import("../../layer/Image.js").default} */ (this.getLayer());
const imageSource = /** @type {import("../../source/Image.js").default} */ (imageLayer.getSource());
const imageSource = imageLayer.getSource();
const hints = frameState.viewHints;

View File

@@ -88,7 +88,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
*/
getTile(z, x, y, pixelRatio, projection) {
const tileLayer = /** @type {import("../../layer/Tile.js").default} */ (this.getLayer());
const tileSource = /** @type {import("../../source/Tile.js").default} */ (tileLayer.getSource());
const tileSource = tileLayer.getSource();
let tile = tileSource.getTile(z, x, y, pixelRatio, projection);
if (tile.getState() == TileState.ERROR) {
if (!tileLayer.getUseInterimTilesOnError()) {
@@ -130,7 +130,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
const pixelRatio = frameState.pixelRatio;
const tileLayer = /** @type {import("../../layer/Tile.js").default} */ (this.getLayer());
const tileSource = /** @type {import("../../source/Tile.js").default} */ (tileLayer.getSource());
const tileSource = tileLayer.getSource();
const sourceRevision = tileSource.getRevision();
const tileGrid = tileSource.getTileGridForProjection(projection);
const z = tileGrid.getZForResolution(viewResolution, this.zDirection);
@@ -334,7 +334,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
const uid = getUid(this);
const alpha = transition ? tile.getAlpha(uid, frameState.time) : 1;
const tileLayer = /** @type {import("../../layer/Tile.js").default} */ (this.getLayer());
const tileSource = /** @type {import("../../source/Tile.js").default} */ (tileLayer.getSource());
const tileSource = tileLayer.getSource();
if (alpha === 1 && !tileSource.getOpaque(frameState.viewState.projection)) {
this.context.clearRect(x, y, w, h);
}

View File

@@ -129,7 +129,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
const projection = viewState.projection;
const rotation = viewState.rotation;
const projectionExtent = projection.getExtent();
const vectorSource = /** @type {import("../../source/Vector.js").default} */ (this.getLayer().getSource());
const vectorSource = this.getLayer().getSource();
// clipped rendering if layer extent is set
const clipExtent = layerState.extent;
@@ -239,7 +239,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
*/
prepareFrame(frameState, layerState) {
const vectorLayer = /** @type {import("../../layer/Vector.js").default} */ (this.getLayer());
const vectorSource = /** @type {import("../../source/Vector.js").default} */ (vectorLayer.getSource());
const vectorSource = vectorLayer.getSource();
const animating = frameState.viewHints[ViewHint.ANIMATING];
const interacting = frameState.viewHints[ViewHint.INTERACTING];

View File

@@ -229,7 +229,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
* @private
*/
updateExecutorGroup_(tile, pixelRatio, projection) {
const layer = /** @type {import("../../layer/Vector.js").default} */ (this.getLayer());
const layer = /** @type {import("../../layer/VectorTile.js").default} */ (this.getLayer());
const revision = layer.getRevision();
const renderOrder = /** @type {import("../../render.js").OrderFunction} */ (layer.getRenderOrder()) || null;
@@ -239,7 +239,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
return;
}
const source = /** @type {import("../../source/VectorTile.js").default} */ (layer.getSource());
const source = layer.getSource();
const sourceTileGrid = source.getTileGrid();
const tileGrid = source.getTileGridForProjection(projection);
const zoom = tile.tileCoord[0];
@@ -334,7 +334,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
const rotation = frameState.viewState.rotation;
hitTolerance = hitTolerance == undefined ? 0 : hitTolerance;
const layer = this.getLayer();
const source = /** @type {import("../../source/VectorTile").default} */ (layer.getSource());
const source = layer.getSource();
const tileGrid = source.getTileGridForProjection(frameState.viewState.projection);
/** @type {!Object<string, boolean>} */
const features = {};
@@ -378,7 +378,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
*/
getReplayTransform_(tile, frameState) {
const layer = this.getLayer();
const source = /** @type {import("../../source/VectorTile.js").default} */ (layer.getSource());
const source = layer.getSource();
const tileGrid = source.getTileGrid();
const tileCoord = tile.tileCoord;
const tileResolution = tileGrid.getResolution(tileCoord[0]);
@@ -435,7 +435,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
const context = this.overlayContext_;
const declutterReplays = layer.getDeclutter() ? {} : null;
const source = /** @type {import("../../source/VectorTile.js").default} */ (layer.getSource());
const source = layer.getSource();
const replayTypes = VECTOR_REPLAYS[renderMode];
const pixelRatio = frameState.pixelRatio;
const rotation = frameState.viewState.rotation;
@@ -608,7 +608,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
replayState.renderedTileZ = tile.sourceZ;
const tileCoord = tile.wrappedTileCoord;
const z = tileCoord[0];
const source = /** @type {import("../../source/VectorTile.js").default} */ (layer.getSource());
const source = layer.getSource();
const tileGrid = source.getTileGridForProjection(projection);
const resolution = tileGrid.getResolution(z);
const context = tile.getContext(layer);

View File

@@ -264,7 +264,7 @@ class WebGLPointsLayerRenderer extends LayerRenderer {
*/
prepareFrame(frameState) {
const vectorLayer = /** @type {import("../../layer/Vector.js").default} */ (this.getLayer());
const vectorSource = /** @type {import("../../source/Vector.js").default} */ (vectorLayer.getSource());
const vectorSource = vectorLayer.getSource();
const stride = 12;