Get rid of goog.isFunction

This commit is contained in:
Frederic Junod
2016-06-20 16:09:25 +02:00
parent e916345e8c
commit b8ce70fbf0
7 changed files with 9 additions and 9 deletions

View File

@@ -294,7 +294,7 @@ ol.Feature.prototype.setGeometryName = function(name) {
ol.Feature.createStyleFunction = function(obj) {
var styleFunction;
if (goog.isFunction(obj)) {
if (typeof obj === 'function') {
styleFunction = obj;
} else {
/**

View File

@@ -31,7 +31,7 @@ ol.featureloader.loadFeaturesXhr = function(url, format, success, failure) {
function(extent, resolution, projection) {
var xhr = new XMLHttpRequest();
xhr.open('GET',
goog.isFunction(url) ? url(extent, resolution, projection) : url,
typeof url === 'function' ? url(extent, resolution, projection) : url,
true);
if (format.getType() == ol.format.FormatType.ARRAY_BUFFER) {
xhr.responseType = 'arraybuffer';

View File

@@ -158,7 +158,7 @@ ol.interaction.Select = function(opt_options) {
var layerFilter;
if (options.layers) {
if (goog.isFunction(options.layers)) {
if (typeof options.layers === 'function') {
/**
* @param {ol.layer.Layer} layer Layer.
* @return {boolean} Include.

View File

@@ -109,7 +109,7 @@ ol.interaction.Translate = function(options) {
var layerFilter;
if (options.layers) {
if (goog.isFunction(options.layers)) {
if (typeof options.layers === 'function') {
/**
* @param {ol.layer.Layer} layer Layer.
* @return {boolean} Include.

View File

@@ -101,7 +101,7 @@ ol.layer.Heatmap = function(opt_options) {
} else {
weightFunction = weight;
}
goog.asserts.assert(goog.isFunction(weightFunction),
goog.asserts.assert(typeof weightFunction === 'function',
'weightFunction should be a function');
this.setStyle(function(feature, resolution) {

View File

@@ -35,7 +35,7 @@ ol.layer.Vector = function(opt_options) {
goog.asserts.assert(
options.renderOrder === undefined || !options.renderOrder ||
goog.isFunction(options.renderOrder),
typeof options.renderOrder === 'function',
'renderOrder must be a comparator function');
var baseOptions = ol.object.assign({}, options);
@@ -161,7 +161,7 @@ ol.layer.Vector.prototype.getUpdateWhileInteracting = function() {
ol.layer.Vector.prototype.setRenderOrder = function(renderOrder) {
goog.asserts.assert(
renderOrder === undefined || !renderOrder ||
goog.isFunction(renderOrder),
typeof renderOrder === 'function',
'renderOrder must be a comparator function');
this.set(ol.layer.VectorProperty.RENDER_ORDER, renderOrder);
};

View File

@@ -156,7 +156,7 @@ ol.style.Style.prototype.getZIndex = function() {
* @api
*/
ol.style.Style.prototype.setGeometry = function(geometry) {
if (goog.isFunction(geometry)) {
if (typeof geometry === 'function') {
this.geometryFunction_ = geometry;
} else if (typeof geometry === 'string') {
this.geometryFunction_ = function(feature) {
@@ -202,7 +202,7 @@ ol.style.Style.prototype.setZIndex = function(zIndex) {
ol.style.createStyleFunction = function(obj) {
var styleFunction;
if (goog.isFunction(obj)) {
if (typeof obj === 'function') {
styleFunction = obj;
} else {
/**