Merge pull request #4190 from marcjansen/no-goog-functions-constant

Remove use of goog.functions.constant
This commit is contained in:
Marc Jansen
2015-09-29 22:11:50 +02:00
3 changed files with 7 additions and 6 deletions

View File

@@ -4,7 +4,6 @@ goog.provide('ol.FeatureStyleFunction');
goog.require('goog.asserts');
goog.require('goog.events');
goog.require('goog.events.EventType');
goog.require('goog.functions');
goog.require('ol');
goog.require('ol.Object');
goog.require('ol.geom.Geometry');
@@ -322,7 +321,9 @@ ol.Feature.createStyleFunction = function(obj) {
'obj should be an ol.style.Style');
styles = [obj];
}
styleFunction = goog.functions.constant(styles);
styleFunction = function() {
return styles;
};
}
return styleFunction;
};

View File

@@ -6,7 +6,6 @@ goog.require('goog.asserts');
goog.require('goog.events');
goog.require('goog.events.Event');
goog.require('goog.events.EventType');
goog.require('goog.functions');
goog.require('goog.object');
goog.require('goog.vec.Mat4');
goog.require('ol.ImageCanvas');
@@ -79,7 +78,7 @@ ol.source.Raster = function(options) {
* @type {ol.TileQueue}
*/
this.tileQueue_ = new ol.TileQueue(
goog.functions.constant(1),
function() { return 1; },
goog.bind(this.changed, this));
var layerStatesArray = ol.source.Raster.getLayerStatesArray_(this.renderers_);

View File

@@ -4,7 +4,6 @@ goog.provide('ol.style.StyleFunction');
goog.provide('ol.style.defaultGeometryFunction');
goog.require('goog.asserts');
goog.require('goog.functions');
goog.require('ol.geom.Geometry');
goog.require('ol.geom.GeometryType');
goog.require('ol.style.Circle');
@@ -230,7 +229,9 @@ ol.style.createStyleFunction = function(obj) {
'obj geometry must be an ol.style.Style instance');
styles = [obj];
}
styleFunction = goog.functions.constant(styles);
styleFunction = function() {
return styles;
};
}
return styleFunction;
};