Prefer single line assignment to 80 character limit
This commit is contained in:
@@ -213,8 +213,7 @@ ol.interaction.DragAndDropEventType = {
|
||||
* @param {Array.<ol.Feature>=} opt_features Features.
|
||||
* @param {ol.proj.Projection=} opt_projection Projection.
|
||||
*/
|
||||
ol.interaction.DragAndDropEvent =
|
||||
function(type, target, file, opt_features, opt_projection) {
|
||||
ol.interaction.DragAndDropEvent = function(type, target, file, opt_features, opt_projection) {
|
||||
|
||||
goog.base(this, type, target);
|
||||
|
||||
|
||||
@@ -131,8 +131,7 @@ ol.interaction.Interaction.pan = function(map, view, delta, opt_duration) {
|
||||
* @param {ol.Coordinate=} opt_anchor Anchor coordinate.
|
||||
* @param {number=} opt_duration Duration.
|
||||
*/
|
||||
ol.interaction.Interaction.rotate =
|
||||
function(map, view, rotation, opt_anchor, opt_duration) {
|
||||
ol.interaction.Interaction.rotate = function(map, view, rotation, opt_anchor, opt_duration) {
|
||||
rotation = view.constrainRotation(rotation, 0);
|
||||
ol.interaction.Interaction.rotateWithoutConstraints(
|
||||
map, view, rotation, opt_anchor, opt_duration);
|
||||
@@ -146,8 +145,7 @@ ol.interaction.Interaction.rotate =
|
||||
* @param {ol.Coordinate=} opt_anchor Anchor coordinate.
|
||||
* @param {number=} opt_duration Duration.
|
||||
*/
|
||||
ol.interaction.Interaction.rotateWithoutConstraints =
|
||||
function(map, view, rotation, opt_anchor, opt_duration) {
|
||||
ol.interaction.Interaction.rotateWithoutConstraints = function(map, view, rotation, opt_anchor, opt_duration) {
|
||||
if (rotation !== undefined) {
|
||||
var currentRotation = view.getRotation();
|
||||
var currentCenter = view.getCenter();
|
||||
@@ -186,8 +184,7 @@ ol.interaction.Interaction.rotateWithoutConstraints =
|
||||
* will select the nearest resolution. If not defined 0 is
|
||||
* assumed.
|
||||
*/
|
||||
ol.interaction.Interaction.zoom =
|
||||
function(map, view, resolution, opt_anchor, opt_duration, opt_direction) {
|
||||
ol.interaction.Interaction.zoom = function(map, view, resolution, opt_anchor, opt_duration, opt_direction) {
|
||||
resolution = view.constrainResolution(resolution, 0, opt_direction);
|
||||
ol.interaction.Interaction.zoomWithoutConstraints(
|
||||
map, view, resolution, opt_anchor, opt_duration);
|
||||
@@ -201,8 +198,7 @@ ol.interaction.Interaction.zoom =
|
||||
* @param {ol.Coordinate=} opt_anchor Anchor coordinate.
|
||||
* @param {number=} opt_duration Duration.
|
||||
*/
|
||||
ol.interaction.Interaction.zoomByDelta =
|
||||
function(map, view, delta, opt_anchor, opt_duration) {
|
||||
ol.interaction.Interaction.zoomByDelta = function(map, view, delta, opt_anchor, opt_duration) {
|
||||
var currentResolution = view.getResolution();
|
||||
var resolution = view.constrainResolution(currentResolution, delta, 0);
|
||||
ol.interaction.Interaction.zoomWithoutConstraints(
|
||||
@@ -217,8 +213,7 @@ ol.interaction.Interaction.zoomByDelta =
|
||||
* @param {ol.Coordinate=} opt_anchor Anchor coordinate.
|
||||
* @param {number=} opt_duration Duration.
|
||||
*/
|
||||
ol.interaction.Interaction.zoomWithoutConstraints =
|
||||
function(map, view, resolution, opt_anchor, opt_duration) {
|
||||
ol.interaction.Interaction.zoomWithoutConstraints = function(map, view, resolution, opt_anchor, opt_duration) {
|
||||
if (resolution) {
|
||||
var currentResolution = view.getResolution();
|
||||
var currentCenter = view.getCenter();
|
||||
|
||||
@@ -359,8 +359,7 @@ ol.interaction.Modify.prototype.handleFeatureRemove_ = function(evt) {
|
||||
* @param {ol.geom.Point} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Modify.prototype.writePointGeometry_ =
|
||||
function(feature, geometry) {
|
||||
ol.interaction.Modify.prototype.writePointGeometry_ = function(feature, geometry) {
|
||||
var coordinates = geometry.getCoordinates();
|
||||
var segmentData = /** @type {ol.interaction.SegmentDataType} */ ({
|
||||
feature: feature,
|
||||
@@ -376,8 +375,7 @@ ol.interaction.Modify.prototype.writePointGeometry_ =
|
||||
* @param {ol.geom.MultiPoint} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Modify.prototype.writeMultiPointGeometry_ =
|
||||
function(feature, geometry) {
|
||||
ol.interaction.Modify.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
|
||||
var points = geometry.getCoordinates();
|
||||
var coordinates, i, ii, segmentData;
|
||||
for (i = 0, ii = points.length; i < ii; ++i) {
|
||||
@@ -399,8 +397,7 @@ ol.interaction.Modify.prototype.writeMultiPointGeometry_ =
|
||||
* @param {ol.geom.LineString} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Modify.prototype.writeLineStringGeometry_ =
|
||||
function(feature, geometry) {
|
||||
ol.interaction.Modify.prototype.writeLineStringGeometry_ = function(feature, geometry) {
|
||||
var coordinates = geometry.getCoordinates();
|
||||
var i, ii, segment, segmentData;
|
||||
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
|
||||
@@ -421,8 +418,7 @@ ol.interaction.Modify.prototype.writeLineStringGeometry_ =
|
||||
* @param {ol.geom.MultiLineString} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Modify.prototype.writeMultiLineStringGeometry_ =
|
||||
function(feature, geometry) {
|
||||
ol.interaction.Modify.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
|
||||
var lines = geometry.getCoordinates();
|
||||
var coordinates, i, ii, j, jj, segment, segmentData;
|
||||
for (j = 0, jj = lines.length; j < jj; ++j) {
|
||||
@@ -447,8 +443,7 @@ ol.interaction.Modify.prototype.writeMultiLineStringGeometry_ =
|
||||
* @param {ol.geom.Polygon} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Modify.prototype.writePolygonGeometry_ =
|
||||
function(feature, geometry) {
|
||||
ol.interaction.Modify.prototype.writePolygonGeometry_ = function(feature, geometry) {
|
||||
var rings = geometry.getCoordinates();
|
||||
var coordinates, i, ii, j, jj, segment, segmentData;
|
||||
for (j = 0, jj = rings.length; j < jj; ++j) {
|
||||
@@ -473,8 +468,7 @@ ol.interaction.Modify.prototype.writePolygonGeometry_ =
|
||||
* @param {ol.geom.MultiPolygon} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Modify.prototype.writeMultiPolygonGeometry_ =
|
||||
function(feature, geometry) {
|
||||
ol.interaction.Modify.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
|
||||
var polygons = geometry.getCoordinates();
|
||||
var coordinates, i, ii, j, jj, k, kk, rings, segment, segmentData;
|
||||
for (k = 0, kk = polygons.length; k < kk; ++k) {
|
||||
@@ -502,8 +496,7 @@ ol.interaction.Modify.prototype.writeMultiPolygonGeometry_ =
|
||||
* @param {ol.geom.GeometryCollection} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Modify.prototype.writeGeometryCollectionGeometry_ =
|
||||
function(feature, geometry) {
|
||||
ol.interaction.Modify.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry) {
|
||||
var i, geometries = geometry.getGeometriesArray();
|
||||
for (i = 0; i < geometries.length; ++i) {
|
||||
this.SEGMENT_WRITERS_[geometries[i].getType()].call(
|
||||
@@ -517,8 +510,7 @@ ol.interaction.Modify.prototype.writeGeometryCollectionGeometry_ =
|
||||
* @return {ol.Feature} Vertex feature.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Modify.prototype.createOrUpdateVertexFeature_ =
|
||||
function(coordinates) {
|
||||
ol.interaction.Modify.prototype.createOrUpdateVertexFeature_ = function(coordinates) {
|
||||
var vertexFeature = this.vertexFeature_;
|
||||
if (!vertexFeature) {
|
||||
vertexFeature = new ol.Feature(new ol.geom.Point(coordinates));
|
||||
@@ -990,8 +982,7 @@ ol.interaction.Modify.prototype.removeVertex_ = function() {
|
||||
* @param {Array} coordinates Coordinates.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Modify.prototype.setGeometryCoordinates_ =
|
||||
function(geometry, coordinates) {
|
||||
ol.interaction.Modify.prototype.setGeometryCoordinates_ = function(geometry, coordinates) {
|
||||
this.changingFeature_ = true;
|
||||
geometry.setCoordinates(coordinates);
|
||||
this.changingFeature_ = false;
|
||||
|
||||
@@ -108,8 +108,7 @@ ol.interaction.Pointer.centroid = function(pointerEvents) {
|
||||
* or pointerup event.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Pointer.prototype.isPointerDraggingEvent_ =
|
||||
function(mapBrowserEvent) {
|
||||
ol.interaction.Pointer.prototype.isPointerDraggingEvent_ = function(mapBrowserEvent) {
|
||||
var type = mapBrowserEvent.type;
|
||||
return (
|
||||
type === ol.MapBrowserEvent.EventType.POINTERDOWN ||
|
||||
@@ -122,8 +121,7 @@ ol.interaction.Pointer.prototype.isPointerDraggingEvent_ =
|
||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Pointer.prototype.updateTrackedPointers_ =
|
||||
function(mapBrowserEvent) {
|
||||
ol.interaction.Pointer.prototype.updateTrackedPointers_ = function(mapBrowserEvent) {
|
||||
if (this.isPointerDraggingEvent_(mapBrowserEvent)) {
|
||||
var event = mapBrowserEvent.pointerEvent;
|
||||
|
||||
|
||||
@@ -58,8 +58,7 @@ ol.interaction.SelectFilterFunction;
|
||||
* @extends {goog.events.Event}
|
||||
* @constructor
|
||||
*/
|
||||
ol.interaction.SelectEvent =
|
||||
function(type, selected, deselected, mapBrowserEvent) {
|
||||
ol.interaction.SelectEvent = function(type, selected, deselected, mapBrowserEvent) {
|
||||
goog.base(this, type);
|
||||
|
||||
/**
|
||||
@@ -175,23 +174,21 @@ ol.interaction.Select = function(opt_options) {
|
||||
var layerFilter;
|
||||
if (options.layers) {
|
||||
if (goog.isFunction(options.layers)) {
|
||||
layerFilter =
|
||||
/**
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @return {boolean} Include.
|
||||
*/
|
||||
function(layer) {
|
||||
/**
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @return {boolean} Include.
|
||||
*/
|
||||
layerFilter = function(layer) {
|
||||
goog.asserts.assertFunction(options.layers);
|
||||
return layer === featureOverlay || options.layers(layer);
|
||||
};
|
||||
} else {
|
||||
var layers = options.layers;
|
||||
layerFilter =
|
||||
/**
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @return {boolean} Include.
|
||||
*/
|
||||
function(layer) {
|
||||
/**
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @return {boolean} Include.
|
||||
*/
|
||||
layerFilter = function(layer) {
|
||||
return layer === featureOverlay || ol.array.includes(layers, layer);
|
||||
};
|
||||
}
|
||||
@@ -228,8 +225,7 @@ goog.inherits(ol.interaction.Select, ol.interaction.Interaction);
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Select.prototype.addFeatureLayerAssociation_ =
|
||||
function(feature, layer) {
|
||||
ol.interaction.Select.prototype.addFeatureLayerAssociation_ = function(feature, layer) {
|
||||
var key = goog.getUid(feature);
|
||||
this.featureLayerAssociation_[key] = layer;
|
||||
};
|
||||
@@ -433,8 +429,7 @@ ol.interaction.Select.prototype.removeFeature_ = function(evt) {
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Select.prototype.removeFeatureLayerAssociation_ =
|
||||
function(feature) {
|
||||
ol.interaction.Select.prototype.removeFeatureLayerAssociation_ = function(feature) {
|
||||
var key = goog.getUid(feature);
|
||||
delete this.featureLayerAssociation_[key];
|
||||
};
|
||||
|
||||
@@ -416,8 +416,7 @@ ol.interaction.Snap.prototype.updateFeature_ = function(feature) {
|
||||
* @param {ol.geom.GeometryCollection} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Snap.prototype.writeGeometryCollectionGeometry_ =
|
||||
function(feature, geometry) {
|
||||
ol.interaction.Snap.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry) {
|
||||
var i, geometries = geometry.getGeometriesArray();
|
||||
for (i = 0; i < geometries.length; ++i) {
|
||||
this.SEGMENT_WRITERS_[geometries[i].getType()].call(
|
||||
@@ -431,8 +430,7 @@ ol.interaction.Snap.prototype.writeGeometryCollectionGeometry_ =
|
||||
* @param {ol.geom.LineString} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Snap.prototype.writeLineStringGeometry_ =
|
||||
function(feature, geometry) {
|
||||
ol.interaction.Snap.prototype.writeLineStringGeometry_ = function(feature, geometry) {
|
||||
var coordinates = geometry.getCoordinates();
|
||||
var i, ii, segment, segmentData;
|
||||
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
|
||||
@@ -451,8 +449,7 @@ ol.interaction.Snap.prototype.writeLineStringGeometry_ =
|
||||
* @param {ol.geom.MultiLineString} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Snap.prototype.writeMultiLineStringGeometry_ =
|
||||
function(feature, geometry) {
|
||||
ol.interaction.Snap.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
|
||||
var lines = geometry.getCoordinates();
|
||||
var coordinates, i, ii, j, jj, segment, segmentData;
|
||||
for (j = 0, jj = lines.length; j < jj; ++j) {
|
||||
@@ -474,8 +471,7 @@ ol.interaction.Snap.prototype.writeMultiLineStringGeometry_ =
|
||||
* @param {ol.geom.MultiPoint} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Snap.prototype.writeMultiPointGeometry_ =
|
||||
function(feature, geometry) {
|
||||
ol.interaction.Snap.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
|
||||
var points = geometry.getCoordinates();
|
||||
var coordinates, i, ii, segmentData;
|
||||
for (i = 0, ii = points.length; i < ii; ++i) {
|
||||
@@ -494,8 +490,7 @@ ol.interaction.Snap.prototype.writeMultiPointGeometry_ =
|
||||
* @param {ol.geom.MultiPolygon} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Snap.prototype.writeMultiPolygonGeometry_ =
|
||||
function(feature, geometry) {
|
||||
ol.interaction.Snap.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
|
||||
var polygons = geometry.getCoordinates();
|
||||
var coordinates, i, ii, j, jj, k, kk, rings, segment, segmentData;
|
||||
for (k = 0, kk = polygons.length; k < kk; ++k) {
|
||||
@@ -520,8 +515,7 @@ ol.interaction.Snap.prototype.writeMultiPolygonGeometry_ =
|
||||
* @param {ol.geom.Point} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Snap.prototype.writePointGeometry_ =
|
||||
function(feature, geometry) {
|
||||
ol.interaction.Snap.prototype.writePointGeometry_ = function(feature, geometry) {
|
||||
var coordinates = geometry.getCoordinates();
|
||||
var segmentData = /** @type {ol.interaction.Snap.SegmentDataType} */ ({
|
||||
feature: feature,
|
||||
@@ -536,8 +530,7 @@ ol.interaction.Snap.prototype.writePointGeometry_ =
|
||||
* @param {ol.geom.Polygon} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Snap.prototype.writePolygonGeometry_ =
|
||||
function(feature, geometry) {
|
||||
ol.interaction.Snap.prototype.writePolygonGeometry_ = function(feature, geometry) {
|
||||
var rings = geometry.getCoordinates();
|
||||
var coordinates, i, ii, j, jj, segment, segmentData;
|
||||
for (j = 0, jj = rings.length; j < jj; ++j) {
|
||||
|
||||
Reference in New Issue
Block a user