Prefer single line assignment to 80 character limit
This commit is contained in:
@@ -55,8 +55,7 @@ goog.inherits(ol.renderer.canvas.ImageLayer, ol.renderer.canvas.Layer);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.ImageLayer.prototype.forEachFeatureAtCoordinate =
|
||||
function(coordinate, frameState, callback, thisArg) {
|
||||
ol.renderer.canvas.ImageLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) {
|
||||
var layer = this.getLayer();
|
||||
var source = layer.getSource();
|
||||
var resolution = frameState.viewState.resolution;
|
||||
@@ -77,8 +76,7 @@ ol.renderer.canvas.ImageLayer.prototype.forEachFeatureAtCoordinate =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.ImageLayer.prototype.forEachLayerAtPixel =
|
||||
function(pixel, frameState, callback, thisArg) {
|
||||
ol.renderer.canvas.ImageLayer.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg) {
|
||||
if (!this.getImage()) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -144,8 +142,7 @@ ol.renderer.canvas.ImageLayer.prototype.getImageTransform = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.ImageLayer.prototype.prepareFrame =
|
||||
function(frameState, layerState) {
|
||||
ol.renderer.canvas.ImageLayer.prototype.prepareFrame = function(frameState, layerState) {
|
||||
|
||||
var pixelRatio = frameState.pixelRatio;
|
||||
var viewState = frameState.viewState;
|
||||
|
||||
@@ -38,8 +38,7 @@ goog.inherits(ol.renderer.canvas.Layer, ol.renderer.Layer);
|
||||
* @param {ol.layer.LayerState} layerState Layer state.
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
*/
|
||||
ol.renderer.canvas.Layer.prototype.composeFrame =
|
||||
function(frameState, layerState, context) {
|
||||
ol.renderer.canvas.Layer.prototype.composeFrame = function(frameState, layerState, context) {
|
||||
|
||||
this.dispatchPreComposeEvent(context, frameState);
|
||||
|
||||
@@ -122,8 +121,7 @@ ol.renderer.canvas.Layer.prototype.composeFrame =
|
||||
* @param {goog.vec.Mat4.Number=} opt_transform Transform.
|
||||
* @private
|
||||
*/
|
||||
ol.renderer.canvas.Layer.prototype.dispatchComposeEvent_ =
|
||||
function(type, context, frameState, opt_transform) {
|
||||
ol.renderer.canvas.Layer.prototype.dispatchComposeEvent_ = function(type, context, frameState, opt_transform) {
|
||||
var layer = this.getLayer();
|
||||
if (layer.hasListener(type)) {
|
||||
var transform = opt_transform !== undefined ?
|
||||
@@ -145,8 +143,7 @@ ol.renderer.canvas.Layer.prototype.dispatchComposeEvent_ =
|
||||
* @param {goog.vec.Mat4.Number=} opt_transform Transform.
|
||||
* @protected
|
||||
*/
|
||||
ol.renderer.canvas.Layer.prototype.dispatchPostComposeEvent =
|
||||
function(context, frameState, opt_transform) {
|
||||
ol.renderer.canvas.Layer.prototype.dispatchPostComposeEvent = function(context, frameState, opt_transform) {
|
||||
this.dispatchComposeEvent_(ol.render.EventType.POSTCOMPOSE, context,
|
||||
frameState, opt_transform);
|
||||
};
|
||||
@@ -158,8 +155,7 @@ ol.renderer.canvas.Layer.prototype.dispatchPostComposeEvent =
|
||||
* @param {goog.vec.Mat4.Number=} opt_transform Transform.
|
||||
* @protected
|
||||
*/
|
||||
ol.renderer.canvas.Layer.prototype.dispatchPreComposeEvent =
|
||||
function(context, frameState, opt_transform) {
|
||||
ol.renderer.canvas.Layer.prototype.dispatchPreComposeEvent = function(context, frameState, opt_transform) {
|
||||
this.dispatchComposeEvent_(ol.render.EventType.PRECOMPOSE, context,
|
||||
frameState, opt_transform);
|
||||
};
|
||||
@@ -171,8 +167,7 @@ ol.renderer.canvas.Layer.prototype.dispatchPreComposeEvent =
|
||||
* @param {goog.vec.Mat4.Number=} opt_transform Transform.
|
||||
* @protected
|
||||
*/
|
||||
ol.renderer.canvas.Layer.prototype.dispatchRenderEvent =
|
||||
function(context, frameState, opt_transform) {
|
||||
ol.renderer.canvas.Layer.prototype.dispatchRenderEvent = function(context, frameState, opt_transform) {
|
||||
this.dispatchComposeEvent_(ol.render.EventType.RENDER, context,
|
||||
frameState, opt_transform);
|
||||
};
|
||||
@@ -196,8 +191,7 @@ ol.renderer.canvas.Layer.prototype.getImageTransform = goog.abstractMethod;
|
||||
* @protected
|
||||
* @return {!goog.vec.Mat4.Number} Transform.
|
||||
*/
|
||||
ol.renderer.canvas.Layer.prototype.getTransform =
|
||||
function(frameState, offsetX) {
|
||||
ol.renderer.canvas.Layer.prototype.getTransform = function(frameState, offsetX) {
|
||||
var viewState = frameState.viewState;
|
||||
var pixelRatio = frameState.pixelRatio;
|
||||
return ol.vec.Mat4.makeTransform2D(this.transform_,
|
||||
@@ -226,8 +220,7 @@ ol.renderer.canvas.Layer.prototype.prepareFrame = goog.abstractMethod;
|
||||
* @return {ol.Pixel} The pixel.
|
||||
* @protected
|
||||
*/
|
||||
ol.renderer.canvas.Layer.prototype.getPixelOnCanvas =
|
||||
function(pixelOnMap, imageTransformInv) {
|
||||
ol.renderer.canvas.Layer.prototype.getPixelOnCanvas = function(pixelOnMap, imageTransformInv) {
|
||||
var pixelOnCanvas = [0, 0];
|
||||
ol.vec.Mat4.multVec2(imageTransformInv, pixelOnMap, pixelOnCanvas);
|
||||
return pixelOnCanvas;
|
||||
|
||||
@@ -97,8 +97,7 @@ ol.renderer.canvas.Map.prototype.createLayerRenderer = function(layer) {
|
||||
* @param {olx.FrameState} frameState Frame state.
|
||||
* @private
|
||||
*/
|
||||
ol.renderer.canvas.Map.prototype.dispatchComposeEvent_ =
|
||||
function(type, frameState) {
|
||||
ol.renderer.canvas.Map.prototype.dispatchComposeEvent_ = function(type, frameState) {
|
||||
var map = this.getMap();
|
||||
var context = this.context_;
|
||||
if (map.hasListener(type)) {
|
||||
|
||||
@@ -122,8 +122,7 @@ ol.renderer.canvas.TileLayer.prototype.getImageTransform = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.TileLayer.prototype.prepareFrame =
|
||||
function(frameState, layerState) {
|
||||
ol.renderer.canvas.TileLayer.prototype.prepareFrame = function(frameState, layerState) {
|
||||
|
||||
//
|
||||
// Warning! You're entering a dangerous zone!
|
||||
@@ -458,8 +457,7 @@ ol.renderer.canvas.TileLayer.prototype.prepareFrame =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.TileLayer.prototype.forEachLayerAtPixel =
|
||||
function(pixel, frameState, callback, thisArg) {
|
||||
ol.renderer.canvas.TileLayer.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg) {
|
||||
if (!this.context_) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -72,8 +72,7 @@ goog.inherits(ol.renderer.canvas.VectorLayer, ol.renderer.canvas.Layer);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.VectorLayer.prototype.composeFrame =
|
||||
function(frameState, layerState, context) {
|
||||
ol.renderer.canvas.VectorLayer.prototype.composeFrame = function(frameState, layerState, context) {
|
||||
|
||||
var extent = frameState.extent;
|
||||
var pixelRatio = frameState.pixelRatio;
|
||||
@@ -153,8 +152,7 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtCoordinate =
|
||||
function(coordinate, frameState, callback, thisArg) {
|
||||
ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) {
|
||||
if (!this.replayGroup_) {
|
||||
return undefined;
|
||||
} else {
|
||||
@@ -187,8 +185,7 @@ ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtCoordinate =
|
||||
* @param {goog.events.Event} event Image style change event.
|
||||
* @private
|
||||
*/
|
||||
ol.renderer.canvas.VectorLayer.prototype.handleStyleImageChange_ =
|
||||
function(event) {
|
||||
ol.renderer.canvas.VectorLayer.prototype.handleStyleImageChange_ = function(event) {
|
||||
this.renderIfReadyAndVisible();
|
||||
};
|
||||
|
||||
@@ -196,8 +193,7 @@ ol.renderer.canvas.VectorLayer.prototype.handleStyleImageChange_ =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
|
||||
function(frameState, layerState) {
|
||||
ol.renderer.canvas.VectorLayer.prototype.prepareFrame = function(frameState, layerState) {
|
||||
|
||||
var vectorLayer = /** @type {ol.layer.Vector} */ (this.getLayer());
|
||||
goog.asserts.assertInstanceof(vectorLayer, ol.layer.Vector,
|
||||
@@ -267,12 +263,11 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
|
||||
ol.renderer.vector.getTolerance(resolution, pixelRatio), extent,
|
||||
resolution, vectorLayer.getRenderBuffer());
|
||||
vectorSource.loadFeatures(extent, resolution, projection);
|
||||
var renderFeature =
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @this {ol.renderer.canvas.VectorLayer}
|
||||
*/
|
||||
function(feature) {
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @this {ol.renderer.canvas.VectorLayer}
|
||||
*/
|
||||
var renderFeature = function(feature) {
|
||||
var styles;
|
||||
var styleFunction = feature.getStyleFunction();
|
||||
if (styleFunction) {
|
||||
@@ -325,8 +320,7 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
|
||||
* @param {ol.render.canvas.ReplayGroup} replayGroup Replay group.
|
||||
* @return {boolean} `true` if an image is loading.
|
||||
*/
|
||||
ol.renderer.canvas.VectorLayer.prototype.renderFeature =
|
||||
function(feature, resolution, pixelRatio, styles, replayGroup) {
|
||||
ol.renderer.canvas.VectorLayer.prototype.renderFeature = function(feature, resolution, pixelRatio, styles, replayGroup) {
|
||||
if (!styles) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -76,8 +76,7 @@ goog.inherits(ol.renderer.canvas.VectorTileLayer, ol.renderer.canvas.Layer);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.composeFrame =
|
||||
function(frameState, layerState, context) {
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.composeFrame = function(frameState, layerState, context) {
|
||||
|
||||
var pixelRatio = frameState.pixelRatio;
|
||||
var skippedFeatureUids = layerState.managed ?
|
||||
@@ -292,8 +291,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.createReplayGroup = function(tile,
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.forEachFeatureAtCoordinate =
|
||||
function(coordinate, frameState, callback, thisArg) {
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) {
|
||||
var pixelRatio = frameState.pixelRatio;
|
||||
var resolution = frameState.viewState.resolution;
|
||||
var rotation = frameState.viewState.rotation;
|
||||
@@ -356,8 +354,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.forEachFeatureAtCoordinate =
|
||||
* @param {goog.events.Event} event Image style change event.
|
||||
* @private
|
||||
*/
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.handleStyleImageChange_ =
|
||||
function(event) {
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.handleStyleImageChange_ = function(event) {
|
||||
this.renderIfReadyAndVisible();
|
||||
};
|
||||
|
||||
@@ -365,8 +362,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.handleStyleImageChange_ =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.prepareFrame =
|
||||
function(frameState, layerState) {
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.prepareFrame = function(frameState, layerState) {
|
||||
var layer = /** @type {ol.layer.Vector} */ (this.getLayer());
|
||||
goog.asserts.assertInstanceof(layer, ol.layer.VectorTile,
|
||||
'layer is an instance of ol.layer.VectorTile');
|
||||
@@ -488,8 +484,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.prepareFrame =
|
||||
* @param {ol.render.canvas.ReplayGroup} replayGroup Replay group.
|
||||
* @return {boolean} `true` if an image is loading.
|
||||
*/
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.renderFeature =
|
||||
function(feature, squaredTolerance, styles, replayGroup) {
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.renderFeature = function(feature, squaredTolerance, styles, replayGroup) {
|
||||
if (!styles) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user