Replace goog.nullFunction with ol.nullFunction

This commit is contained in:
Marc Jansen
2015-09-29 16:39:35 +02:00
parent fbef99ae96
commit bc58c383ba
13 changed files with 37 additions and 20 deletions

View File

@@ -2,6 +2,7 @@ goog.provide('ol.control.Control');
goog.require('goog.dom');
goog.require('goog.events');
goog.require('ol');
goog.require('ol.MapEventType');
goog.require('ol.Object');
@@ -67,7 +68,7 @@ ol.control.Control = function(options) {
/**
* @type {function(ol.MapEvent)}
*/
this.render = options.render ? options.render : goog.nullFunction;
this.render = options.render ? options.render : ol.nullFunction;
if (options.target) {
this.setTarget(options.target);
@@ -116,7 +117,7 @@ ol.control.Control.prototype.setMap = function(map) {
var target = !goog.isNull(this.target_) ?
this.target_ : map.getOverlayContainerStopEvent();
goog.dom.appendChild(target, this.element);
if (this.render !== goog.nullFunction) {
if (this.render !== ol.nullFunction) {
this.listenerKeys.push(goog.events.listen(map,
ol.MapEventType.POSTRENDER, this.render, false, this));
}

View File

@@ -152,7 +152,7 @@ ol.interaction.DragBox.prototype.getGeometry = function() {
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @protected
*/
ol.interaction.DragBox.prototype.onBoxEnd = goog.nullFunction;
ol.interaction.DragBox.prototype.onBoxEnd = ol.nullFunction;
/**

View File

@@ -2,6 +2,7 @@ goog.provide('ol.interaction.Pointer');
goog.require('goog.functions');
goog.require('goog.object');
goog.require('ol');
goog.require('ol.MapBrowserEvent.EventType');
goog.require('ol.MapBrowserPointerEvent');
goog.require('ol.Pixel');
@@ -144,7 +145,7 @@ ol.interaction.Pointer.prototype.updateTrackedPointers_ =
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
* @this {ol.interaction.Pointer}
*/
ol.interaction.Pointer.handleDragEvent = goog.nullFunction;
ol.interaction.Pointer.handleDragEvent = ol.nullFunction;
/**
@@ -167,7 +168,7 @@ ol.interaction.Pointer.handleDownEvent = goog.functions.FALSE;
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
* @this {ol.interaction.Pointer}
*/
ol.interaction.Pointer.handleMoveEvent = goog.nullFunction;
ol.interaction.Pointer.handleMoveEvent = ol.nullFunction;
/**

View File

@@ -221,3 +221,11 @@ ol.WEBGL_EXTENSIONS; // value is set in `ol.has`
ol.inherits =
goog.inherits;
// note that the newline above is necessary to satisfy the linter
/**
* A reusable function, used e.g. as a default for callbacks.
*
* @return {undefined} Nothing.
*/
ol.nullFunction = function() {};

View File

@@ -12,6 +12,7 @@ goog.require('goog.array');
goog.require('goog.asserts');
goog.require('goog.object');
goog.require('goog.vec.Mat4');
goog.require('ol');
goog.require('ol.array');
goog.require('ol.color');
goog.require('ol.dom');
@@ -585,7 +586,7 @@ ol.render.canvas.Replay.prototype.endGeometry = function(geometry, feature) {
/**
* FIXME empty description for jsdoc
*/
ol.render.canvas.Replay.prototype.finish = goog.nullFunction;
ol.render.canvas.Replay.prototype.finish = ol.nullFunction;
/**

View File

@@ -1,5 +1,6 @@
goog.provide('ol.renderer.dom.Layer');
goog.require('ol');
goog.require('ol.layer.Layer');
goog.require('ol.renderer.Layer');
@@ -28,14 +29,14 @@ goog.inherits(ol.renderer.dom.Layer, ol.renderer.Layer);
/**
* Clear rendered elements.
*/
ol.renderer.dom.Layer.prototype.clearFrame = goog.nullFunction;
ol.renderer.dom.Layer.prototype.clearFrame = ol.nullFunction;
/**
* @param {olx.FrameState} frameState Frame state.
* @param {ol.layer.LayerState} layerState Layer state.
*/
ol.renderer.dom.Layer.prototype.composeFrame = goog.nullFunction;
ol.renderer.dom.Layer.prototype.composeFrame = ol.nullFunction;
/**

View File

@@ -4,6 +4,7 @@ goog.require('goog.asserts');
goog.require('goog.events');
goog.require('goog.events.EventType');
goog.require('goog.functions');
goog.require('ol');
goog.require('ol.ImageState');
goog.require('ol.Observable');
goog.require('ol.TileRange');
@@ -47,7 +48,7 @@ goog.inherits(ol.renderer.Layer, ol.Observable);
* @return {T|undefined} Callback result.
* @template S,T
*/
ol.renderer.Layer.prototype.forEachFeatureAtCoordinate = goog.nullFunction;
ol.renderer.Layer.prototype.forEachFeatureAtCoordinate = ol.nullFunction;
/**

View File

@@ -335,7 +335,7 @@ ol.renderer.Map.prototype.removeLayerRendererByKey_ = function(layerKey) {
* Render.
* @param {?olx.FrameState} frameState Frame state.
*/
ol.renderer.Map.prototype.renderFrame = goog.nullFunction;
ol.renderer.Map.prototype.renderFrame = ol.nullFunction;
/**

View File

@@ -1,6 +1,7 @@
goog.provide('ol.source.Source');
goog.provide('ol.source.State');
goog.require('ol');
goog.require('ol.Attribution');
goog.require('ol.Object');
goog.require('ol.proj');
@@ -92,8 +93,7 @@ goog.inherits(ol.source.Source, ol.Object);
* @return {T|undefined} Callback result.
* @template T
*/
ol.source.Source.prototype.forEachFeatureAtCoordinate =
goog.nullFunction;
ol.source.Source.prototype.forEachFeatureAtCoordinate = ol.nullFunction;
/**

View File

@@ -4,6 +4,7 @@ goog.provide('ol.source.TileOptions');
goog.require('goog.asserts');
goog.require('goog.events.Event');
goog.require('ol');
goog.require('ol.Attribution');
goog.require('ol.Extent');
goog.require('ol.TileCache');
@@ -244,7 +245,7 @@ ol.source.Tile.prototype.getTileCoordForTileUrlFunction =
* @param {number} x Tile coordinate x.
* @param {number} y Tile coordinate y.
*/
ol.source.Tile.prototype.useTile = goog.nullFunction;
ol.source.Tile.prototype.useTile = ol.nullFunction;

View File

@@ -11,6 +11,7 @@ goog.require('goog.events');
goog.require('goog.events.Event');
goog.require('goog.events.EventType');
goog.require('goog.object');
goog.require('ol');
goog.require('ol.Collection');
goog.require('ol.CollectionEventType');
goog.require('ol.Extent');
@@ -89,7 +90,7 @@ ol.source.Vector = function(opt_options) {
* @private
* @type {ol.FeatureLoader}
*/
this.loader_ = goog.nullFunction;
this.loader_ = ol.nullFunction;
if (options.loader !== undefined) {
this.loader_ = options.loader;

View File

@@ -3,6 +3,7 @@ goog.provide('ol.style.Circle');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('ol');
goog.require('ol.color');
goog.require('ol.has');
goog.require('ol.render.canvas');
@@ -214,19 +215,19 @@ ol.style.Circle.prototype.getStroke = function() {
/**
* @inheritDoc
*/
ol.style.Circle.prototype.listenImageChange = goog.nullFunction;
ol.style.Circle.prototype.listenImageChange = ol.nullFunction;
/**
* @inheritDoc
*/
ol.style.Circle.prototype.load = goog.nullFunction;
ol.style.Circle.prototype.load = ol.nullFunction;
/**
* @inheritDoc
*/
ol.style.Circle.prototype.unlistenImageChange = goog.nullFunction;
ol.style.Circle.prototype.unlistenImageChange = ol.nullFunction;
/**

View File

@@ -3,6 +3,7 @@ goog.provide('ol.style.RegularShape');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('ol');
goog.require('ol.color');
goog.require('ol.has');
goog.require('ol.render.canvas');
@@ -270,19 +271,19 @@ ol.style.RegularShape.prototype.getStroke = function() {
/**
* @inheritDoc
*/
ol.style.RegularShape.prototype.listenImageChange = goog.nullFunction;
ol.style.RegularShape.prototype.listenImageChange = ol.nullFunction;
/**
* @inheritDoc
*/
ol.style.RegularShape.prototype.load = goog.nullFunction;
ol.style.RegularShape.prototype.load = ol.nullFunction;
/**
* @inheritDoc
*/
ol.style.RegularShape.prototype.unlistenImageChange = goog.nullFunction;
ol.style.RegularShape.prototype.unlistenImageChange = ol.nullFunction;
/**