Use super.method instead of prototype.method.call

This commit is contained in:
ahocevar
2018-08-06 15:22:22 +02:00
parent c5b42c49d5
commit 2f92e48e93
18 changed files with 25 additions and 25 deletions
+2 -2
View File
@@ -69,7 +69,7 @@ class CanvasImageLayerRenderer extends IntermediateCanvasRenderer {
if (this.vectorRenderer_) {
this.vectorRenderer_.dispose();
}
IntermediateCanvasRenderer.prototype.disposeInternal.call(this);
super.disposeInternal();
}
/**
@@ -184,7 +184,7 @@ class CanvasImageLayerRenderer extends IntermediateCanvasRenderer {
if (this.vectorRenderer_) {
return this.vectorRenderer_.forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, callback, thisArg);
} else {
return IntermediateCanvasRenderer.prototype.forEachFeatureAtCoordinate.call(this, coordinate, frameState, hitTolerance, callback, thisArg);
return super.forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, callback, thisArg);
}
}
}
+1 -1
View File
@@ -118,7 +118,7 @@ class IntermediateCanvasRenderer extends CanvasLayerRenderer {
if (this.getLayer().getSource().forEachFeatureAtCoordinate !== VOID) {
// for ImageCanvas sources use the original hit-detection logic,
// so that for example also transparent polygons are detected
return CanvasLayerRenderer.prototype.forEachLayerAtCoordinate.apply(this, arguments);
return super.forEachLayerAtCoordinate(arguments);
} else {
const pixel = applyTransform(this.coordinateToCanvasPixelTransform, coordinate.slice());
scaleCoordinate(pixel, frameState.viewState.resolution / this.renderedResolution);
+1 -1
View File
@@ -209,7 +209,7 @@ class CanvasMapRenderer extends MapRenderer {
* @inheritDoc
*/
registerLayerRenderers(constructors) {
MapRenderer.prototype.registerLayerRenderers.call(this, constructors);
super.registerLayerRenderers(constructors);
for (let i = 0, ii = constructors.length; i < ii; ++i) {
const ctor = constructors[i];
if (!includes(layerRendererConstructors, ctor)) {
+1 -1
View File
@@ -91,7 +91,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
*/
disposeInternal() {
unlisten(labelCache, EventType.CLEAR, this.handleFontsChanged_, this);
CanvasLayerRenderer.prototype.disposeInternal.call(this);
super.disposeInternal();
}
/**
+4 -4
View File
@@ -97,14 +97,14 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
*/
disposeInternal() {
unlisten(labelCache, EventType.CLEAR, this.handleFontsChanged_, this);
CanvasTileLayerRenderer.prototype.disposeInternal.call(this);
super.disposeInternal();
}
/**
* @inheritDoc
*/
getTile(z, x, y, pixelRatio, projection) {
const tile = CanvasTileLayerRenderer.prototype.getTile.call(this, z, x, y, pixelRatio, projection);
const tile = super.getTile(z, x, y, pixelRatio, projection);
if (tile.getState() === TileState.LOADED) {
this.createReplayGroup_(tile, pixelRatio, projection);
if (this.context) {
@@ -131,7 +131,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
}
}
this.renderedLayerRevision_ = layerRevision;
return CanvasTileLayerRenderer.prototype.prepareFrame.apply(this, arguments);
return super.prepareFrame(frameState, layerState);
}
/**
@@ -404,7 +404,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
/** @type {number} */ (offsetX), /** @type {number} */ (offsetY));
}
}
CanvasTileLayerRenderer.prototype.postCompose.apply(this, arguments);
super.postCompose(context, frameState, layerState);
}
/**
+1 -1
View File
@@ -291,7 +291,7 @@ class WebGLMapRenderer extends MapRenderer {
});
}
this.context_.dispose();
MapRenderer.prototype.disposeInternal.call(this);
super.disposeInternal();
}
/**
+2 -2
View File
@@ -100,7 +100,7 @@ class WebGLTileLayerRenderer extends WebGLLayerRenderer {
disposeInternal() {
const context = this.mapRenderer.getContext();
context.deleteBuffer(this.renderArrayBuffer_);
WebGLLayerRenderer.prototype.disposeInternal.call(this);
super.disposeInternal();
}
/**
@@ -135,7 +135,7 @@ class WebGLTileLayerRenderer extends WebGLLayerRenderer {
* @inheritDoc
*/
handleWebGLContextLost() {
WebGLLayerRenderer.prototype.handleWebGLContextLost.call(this);
super.handleWebGLContextLost();
this.locations_ = null;
}
+1 -1
View File
@@ -103,7 +103,7 @@ class WebGLVectorLayerRenderer extends WebGLLayerRenderer {
replayGroup.getDeleteResourcesFunction(context)();
this.replayGroup_ = null;
}
WebGLLayerRenderer.prototype.disposeInternal.call(this);
super.disposeInternal();
}
/**