Prefer single line assignment to 80 character limit
This commit is contained in:
@@ -36,8 +36,7 @@ goog.require('ol.vec.Mat4');
|
||||
* @param {number} viewRotation View rotation.
|
||||
* @struct
|
||||
*/
|
||||
ol.render.canvas.Immediate =
|
||||
function(context, pixelRatio, extent, transform, viewRotation) {
|
||||
ol.render.canvas.Immediate = function(context, pixelRatio, extent, transform, viewRotation) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -248,8 +247,7 @@ ol.render.canvas.Immediate =
|
||||
* @param {number} stride Stride.
|
||||
* @private
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawImages_ =
|
||||
function(flatCoordinates, offset, end, stride) {
|
||||
ol.render.canvas.Immediate.prototype.drawImages_ = function(flatCoordinates, offset, end, stride) {
|
||||
if (!this.image_) {
|
||||
return;
|
||||
}
|
||||
@@ -311,8 +309,7 @@ ol.render.canvas.Immediate.prototype.drawImages_ =
|
||||
* @param {number} stride Stride.
|
||||
* @private
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawText_ =
|
||||
function(flatCoordinates, offset, end, stride) {
|
||||
ol.render.canvas.Immediate.prototype.drawText_ = function(flatCoordinates, offset, end, stride) {
|
||||
if (!this.textState_ || this.text_ === '') {
|
||||
return;
|
||||
}
|
||||
@@ -366,8 +363,7 @@ ol.render.canvas.Immediate.prototype.drawText_ =
|
||||
* @private
|
||||
* @return {number} end End.
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.moveToLineTo_ =
|
||||
function(flatCoordinates, offset, end, stride, close) {
|
||||
ol.render.canvas.Immediate.prototype.moveToLineTo_ = function(flatCoordinates, offset, end, stride, close) {
|
||||
var context = this.context_;
|
||||
var pixelCoordinates = ol.geom.flat.transform.transform2D(
|
||||
flatCoordinates, offset, end, stride, this.transform_,
|
||||
@@ -392,8 +388,7 @@ ol.render.canvas.Immediate.prototype.moveToLineTo_ =
|
||||
* @private
|
||||
* @return {number} End.
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawRings_ =
|
||||
function(flatCoordinates, offset, ends, stride) {
|
||||
ol.render.canvas.Immediate.prototype.drawRings_ = function(flatCoordinates, offset, ends, stride) {
|
||||
var context = this.context_;
|
||||
var i, ii;
|
||||
for (i = 0, ii = ends.length; i < ii; ++i) {
|
||||
@@ -432,8 +427,7 @@ ol.render.canvas.Immediate.prototype.drawAsync = function(zIndex, callback) {
|
||||
* @param {ol.geom.Circle} circleGeometry Circle geometry.
|
||||
* @api
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawCircleGeometry =
|
||||
function(circleGeometry) {
|
||||
ol.render.canvas.Immediate.prototype.drawCircleGeometry = function(circleGeometry) {
|
||||
if (!ol.extent.intersects(this.extent_, circleGeometry.getExtent())) {
|
||||
return;
|
||||
}
|
||||
@@ -508,8 +502,7 @@ ol.render.canvas.Immediate.prototype.drawFeature = function(feature, style) {
|
||||
* collection.
|
||||
* @param {ol.Feature} feature Feature.
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawGeometryCollectionGeometry =
|
||||
function(geometryCollectionGeometry, feature) {
|
||||
ol.render.canvas.Immediate.prototype.drawGeometryCollectionGeometry = function(geometryCollectionGeometry, feature) {
|
||||
var geometries = geometryCollectionGeometry.getGeometriesArray();
|
||||
var i, ii;
|
||||
for (i = 0, ii = geometries.length; i < ii; ++i) {
|
||||
@@ -530,8 +523,7 @@ ol.render.canvas.Immediate.prototype.drawGeometryCollectionGeometry =
|
||||
* @param {ol.geom.Point|ol.render.Feature} pointGeometry Point geometry.
|
||||
* @api
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawPointGeometry =
|
||||
function(pointGeometry) {
|
||||
ol.render.canvas.Immediate.prototype.drawPointGeometry = function(pointGeometry) {
|
||||
var flatCoordinates = pointGeometry.getFlatCoordinates();
|
||||
var stride = pointGeometry.getStride();
|
||||
if (this.image_) {
|
||||
@@ -551,8 +543,7 @@ ol.render.canvas.Immediate.prototype.drawPointGeometry =
|
||||
* geometry.
|
||||
* @api
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawMultiPointGeometry =
|
||||
function(multiPointGeometry) {
|
||||
ol.render.canvas.Immediate.prototype.drawMultiPointGeometry = function(multiPointGeometry) {
|
||||
var flatCoordinates = multiPointGeometry.getFlatCoordinates();
|
||||
var stride = multiPointGeometry.getStride();
|
||||
if (this.image_) {
|
||||
@@ -572,8 +563,7 @@ ol.render.canvas.Immediate.prototype.drawMultiPointGeometry =
|
||||
* string geometry.
|
||||
* @api
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawLineStringGeometry =
|
||||
function(lineStringGeometry) {
|
||||
ol.render.canvas.Immediate.prototype.drawLineStringGeometry = function(lineStringGeometry) {
|
||||
if (!ol.extent.intersects(this.extent_, lineStringGeometry.getExtent())) {
|
||||
return;
|
||||
}
|
||||
@@ -601,8 +591,7 @@ ol.render.canvas.Immediate.prototype.drawLineStringGeometry =
|
||||
* MultiLineString geometry.
|
||||
* @api
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawMultiLineStringGeometry =
|
||||
function(multiLineStringGeometry) {
|
||||
ol.render.canvas.Immediate.prototype.drawMultiLineStringGeometry = function(multiLineStringGeometry) {
|
||||
var geometryExtent = multiLineStringGeometry.getExtent();
|
||||
if (!ol.extent.intersects(this.extent_, geometryExtent)) {
|
||||
return;
|
||||
@@ -637,8 +626,7 @@ ol.render.canvas.Immediate.prototype.drawMultiLineStringGeometry =
|
||||
* geometry.
|
||||
* @api
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawPolygonGeometry =
|
||||
function(polygonGeometry) {
|
||||
ol.render.canvas.Immediate.prototype.drawPolygonGeometry = function(polygonGeometry) {
|
||||
if (!ol.extent.intersects(this.extent_, polygonGeometry.getExtent())) {
|
||||
return;
|
||||
}
|
||||
@@ -673,8 +661,7 @@ ol.render.canvas.Immediate.prototype.drawPolygonGeometry =
|
||||
* @param {ol.geom.MultiPolygon} multiPolygonGeometry MultiPolygon geometry.
|
||||
* @api
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawMultiPolygonGeometry =
|
||||
function(multiPolygonGeometry) {
|
||||
ol.render.canvas.Immediate.prototype.drawMultiPolygonGeometry = function(multiPolygonGeometry) {
|
||||
if (!ol.extent.intersects(this.extent_, multiPolygonGeometry.getExtent())) {
|
||||
return;
|
||||
}
|
||||
@@ -737,8 +724,7 @@ ol.render.canvas.Immediate.prototype.flush = function() {
|
||||
* @param {ol.render.canvas.FillState} fillState Fill state.
|
||||
* @private
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.setContextFillState_ =
|
||||
function(fillState) {
|
||||
ol.render.canvas.Immediate.prototype.setContextFillState_ = function(fillState) {
|
||||
var context = this.context_;
|
||||
var contextFillState = this.contextFillState_;
|
||||
if (!contextFillState) {
|
||||
@@ -758,8 +744,7 @@ ol.render.canvas.Immediate.prototype.setContextFillState_ =
|
||||
* @param {ol.render.canvas.StrokeState} strokeState Stroke state.
|
||||
* @private
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.setContextStrokeState_ =
|
||||
function(strokeState) {
|
||||
ol.render.canvas.Immediate.prototype.setContextStrokeState_ = function(strokeState) {
|
||||
var context = this.context_;
|
||||
var contextStrokeState = this.contextStrokeState_;
|
||||
if (!contextStrokeState) {
|
||||
@@ -811,8 +796,7 @@ ol.render.canvas.Immediate.prototype.setContextStrokeState_ =
|
||||
* @param {ol.render.canvas.TextState} textState Text state.
|
||||
* @private
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.setContextTextState_ =
|
||||
function(textState) {
|
||||
ol.render.canvas.Immediate.prototype.setContextTextState_ = function(textState) {
|
||||
var context = this.context_;
|
||||
var contextTextState = this.contextTextState_;
|
||||
if (!contextTextState) {
|
||||
@@ -847,8 +831,7 @@ ol.render.canvas.Immediate.prototype.setContextTextState_ =
|
||||
* @param {ol.style.Stroke} strokeStyle Stroke style.
|
||||
* @api
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.setFillStrokeStyle =
|
||||
function(fillStyle, strokeStyle) {
|
||||
ol.render.canvas.Immediate.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
|
||||
if (!fillStyle) {
|
||||
this.fillState_ = null;
|
||||
} else {
|
||||
|
||||
@@ -158,8 +158,7 @@ goog.inherits(ol.render.canvas.Replay, ol.render.VectorContext);
|
||||
* @protected
|
||||
* @return {number} My end.
|
||||
*/
|
||||
ol.render.canvas.Replay.prototype.appendFlatCoordinates =
|
||||
function(flatCoordinates, offset, end, stride, close) {
|
||||
ol.render.canvas.Replay.prototype.appendFlatCoordinates = function(flatCoordinates, offset, end, stride, close) {
|
||||
|
||||
var myEnd = this.coordinates.length;
|
||||
var extent = this.getBufferedMaxExtent();
|
||||
@@ -601,8 +600,7 @@ ol.render.canvas.Replay.prototype.replayHitDetection = function(
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
ol.render.canvas.Replay.prototype.reverseHitDetectionInstructions_ =
|
||||
function() {
|
||||
ol.render.canvas.Replay.prototype.reverseHitDetectionInstructions_ = function() {
|
||||
var hitDetectionInstructions = this.hitDetectionInstructions;
|
||||
// step 1 - reverse array
|
||||
hitDetectionInstructions.reverse();
|
||||
@@ -770,8 +768,7 @@ goog.inherits(ol.render.canvas.ImageReplay, ol.render.canvas.Replay);
|
||||
* @private
|
||||
* @return {number} My end.
|
||||
*/
|
||||
ol.render.canvas.ImageReplay.prototype.drawCoordinates_ =
|
||||
function(flatCoordinates, offset, end, stride) {
|
||||
ol.render.canvas.ImageReplay.prototype.drawCoordinates_ = function(flatCoordinates, offset, end, stride) {
|
||||
return this.appendFlatCoordinates(
|
||||
flatCoordinates, offset, end, stride, false);
|
||||
};
|
||||
@@ -780,8 +777,7 @@ ol.render.canvas.ImageReplay.prototype.drawCoordinates_ =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.render.canvas.ImageReplay.prototype.drawPointGeometry =
|
||||
function(pointGeometry, feature) {
|
||||
ol.render.canvas.ImageReplay.prototype.drawPointGeometry = function(pointGeometry, feature) {
|
||||
if (!this.image_) {
|
||||
return;
|
||||
}
|
||||
@@ -833,8 +829,7 @@ ol.render.canvas.ImageReplay.prototype.drawPointGeometry =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.render.canvas.ImageReplay.prototype.drawMultiPointGeometry =
|
||||
function(multiPointGeometry, feature) {
|
||||
ol.render.canvas.ImageReplay.prototype.drawMultiPointGeometry = function(multiPointGeometry, feature) {
|
||||
if (!this.image_) {
|
||||
return;
|
||||
}
|
||||
@@ -995,8 +990,7 @@ goog.inherits(ol.render.canvas.LineStringReplay, ol.render.canvas.Replay);
|
||||
* @private
|
||||
* @return {number} end.
|
||||
*/
|
||||
ol.render.canvas.LineStringReplay.prototype.drawFlatCoordinates_ =
|
||||
function(flatCoordinates, offset, end, stride) {
|
||||
ol.render.canvas.LineStringReplay.prototype.drawFlatCoordinates_ = function(flatCoordinates, offset, end, stride) {
|
||||
var myBegin = this.coordinates.length;
|
||||
var myEnd = this.appendFlatCoordinates(
|
||||
flatCoordinates, offset, end, stride, false);
|
||||
@@ -1069,8 +1063,7 @@ ol.render.canvas.LineStringReplay.prototype.setStrokeStyle_ = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.render.canvas.LineStringReplay.prototype.drawLineStringGeometry =
|
||||
function(lineStringGeometry, feature) {
|
||||
ol.render.canvas.LineStringReplay.prototype.drawLineStringGeometry = function(lineStringGeometry, feature) {
|
||||
var state = this.state_;
|
||||
goog.asserts.assert(state, 'state should not be null');
|
||||
var strokeStyle = state.strokeStyle;
|
||||
@@ -1097,8 +1090,7 @@ ol.render.canvas.LineStringReplay.prototype.drawLineStringGeometry =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.render.canvas.LineStringReplay.prototype.drawMultiLineStringGeometry =
|
||||
function(multiLineStringGeometry, feature) {
|
||||
ol.render.canvas.LineStringReplay.prototype.drawMultiLineStringGeometry = function(multiLineStringGeometry, feature) {
|
||||
var state = this.state_;
|
||||
goog.asserts.assert(state, 'state should not be null');
|
||||
var strokeStyle = state.strokeStyle;
|
||||
@@ -1144,8 +1136,7 @@ ol.render.canvas.LineStringReplay.prototype.finish = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.render.canvas.LineStringReplay.prototype.setFillStrokeStyle =
|
||||
function(fillStyle, strokeStyle) {
|
||||
ol.render.canvas.LineStringReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
|
||||
goog.asserts.assert(this.state_, 'this.state_ should not be null');
|
||||
goog.asserts.assert(!fillStyle, 'fillStyle should be null');
|
||||
goog.asserts.assert(strokeStyle, 'strokeStyle should not be null');
|
||||
@@ -1236,8 +1227,7 @@ goog.inherits(ol.render.canvas.PolygonReplay, ol.render.canvas.Replay);
|
||||
* @private
|
||||
* @return {number} End.
|
||||
*/
|
||||
ol.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_ =
|
||||
function(flatCoordinates, offset, ends, stride) {
|
||||
ol.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_ = function(flatCoordinates, offset, ends, stride) {
|
||||
var state = this.state_;
|
||||
var beginPathInstruction = [ol.render.canvas.Instruction.BEGIN_PATH];
|
||||
this.instructions.push(beginPathInstruction);
|
||||
@@ -1277,8 +1267,7 @@ ol.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_ =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.render.canvas.PolygonReplay.prototype.drawCircleGeometry =
|
||||
function(circleGeometry, feature) {
|
||||
ol.render.canvas.PolygonReplay.prototype.drawCircleGeometry = function(circleGeometry, feature) {
|
||||
var state = this.state_;
|
||||
goog.asserts.assert(state, 'state should not be null');
|
||||
var fillStyle = state.fillStyle;
|
||||
@@ -1330,8 +1319,7 @@ ol.render.canvas.PolygonReplay.prototype.drawCircleGeometry =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.render.canvas.PolygonReplay.prototype.drawPolygonGeometry =
|
||||
function(polygonGeometry, feature) {
|
||||
ol.render.canvas.PolygonReplay.prototype.drawPolygonGeometry = function(polygonGeometry, feature) {
|
||||
var state = this.state_;
|
||||
goog.asserts.assert(state, 'state should not be null');
|
||||
var fillStyle = state.fillStyle;
|
||||
@@ -1366,8 +1354,7 @@ ol.render.canvas.PolygonReplay.prototype.drawPolygonGeometry =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.render.canvas.PolygonReplay.prototype.drawMultiPolygonGeometry =
|
||||
function(multiPolygonGeometry, feature) {
|
||||
ol.render.canvas.PolygonReplay.prototype.drawMultiPolygonGeometry = function(multiPolygonGeometry, feature) {
|
||||
var state = this.state_;
|
||||
goog.asserts.assert(state, 'state should not be null');
|
||||
var fillStyle = state.fillStyle;
|
||||
@@ -1444,8 +1431,7 @@ ol.render.canvas.PolygonReplay.prototype.getBufferedMaxExtent = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.render.canvas.PolygonReplay.prototype.setFillStrokeStyle =
|
||||
function(fillStyle, strokeStyle) {
|
||||
ol.render.canvas.PolygonReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
|
||||
goog.asserts.assert(this.state_, 'this.state_ should not be null');
|
||||
goog.asserts.assert(fillStyle || strokeStyle,
|
||||
'fillStyle or strokeStyle should not be null');
|
||||
@@ -1624,8 +1610,7 @@ goog.inherits(ol.render.canvas.TextReplay, ol.render.canvas.Replay);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.render.canvas.TextReplay.prototype.drawText =
|
||||
function(flatCoordinates, offset, end, stride, geometry, feature) {
|
||||
ol.render.canvas.TextReplay.prototype.drawText = function(flatCoordinates, offset, end, stride, geometry, feature) {
|
||||
if (this.text_ === '' || !this.textState_ ||
|
||||
(!this.textFillState_ && !this.textStrokeState_)) {
|
||||
return;
|
||||
@@ -1657,8 +1642,7 @@ ol.render.canvas.TextReplay.prototype.drawText =
|
||||
* @param {ol.render.canvas.FillState} fillState Fill state.
|
||||
* @private
|
||||
*/
|
||||
ol.render.canvas.TextReplay.prototype.setReplayFillState_ =
|
||||
function(fillState) {
|
||||
ol.render.canvas.TextReplay.prototype.setReplayFillState_ = function(fillState) {
|
||||
var replayFillState = this.replayFillState_;
|
||||
if (replayFillState &&
|
||||
replayFillState.fillStyle == fillState.fillStyle) {
|
||||
@@ -1682,8 +1666,7 @@ ol.render.canvas.TextReplay.prototype.setReplayFillState_ =
|
||||
* @param {ol.render.canvas.StrokeState} strokeState Stroke state.
|
||||
* @private
|
||||
*/
|
||||
ol.render.canvas.TextReplay.prototype.setReplayStrokeState_ =
|
||||
function(strokeState) {
|
||||
ol.render.canvas.TextReplay.prototype.setReplayStrokeState_ = function(strokeState) {
|
||||
var replayStrokeState = this.replayStrokeState_;
|
||||
if (replayStrokeState &&
|
||||
replayStrokeState.lineCap == strokeState.lineCap &&
|
||||
@@ -1725,8 +1708,7 @@ ol.render.canvas.TextReplay.prototype.setReplayStrokeState_ =
|
||||
* @param {ol.render.canvas.TextState} textState Text state.
|
||||
* @private
|
||||
*/
|
||||
ol.render.canvas.TextReplay.prototype.setReplayTextState_ =
|
||||
function(textState) {
|
||||
ol.render.canvas.TextReplay.prototype.setReplayTextState_ = function(textState) {
|
||||
var replayTextState = this.replayTextState_;
|
||||
if (replayTextState &&
|
||||
replayTextState.font == textState.font &&
|
||||
@@ -1979,8 +1961,7 @@ ol.render.canvas.ReplayGroup.prototype.forEachFeatureAtCoordinate = function(
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.render.canvas.ReplayGroup.prototype.getReplay =
|
||||
function(zIndex, replayType) {
|
||||
ol.render.canvas.ReplayGroup.prototype.getReplay = function(zIndex, replayType) {
|
||||
var zIndexKey = zIndex !== undefined ? zIndex.toString() : '0';
|
||||
var replays = this.replaysByZIndex_[zIndexKey];
|
||||
if (replays === undefined) {
|
||||
|
||||
Reference in New Issue
Block a user