Remove goog.isNull in feature class

This commit is contained in:
Marc Jansen
2015-09-29 15:22:52 +02:00
parent f360080fa7
commit e479411614
+4 -4
View File
@@ -98,7 +98,7 @@ ol.Feature = function(opt_geometryOrProperties) {
if (opt_geometryOrProperties !== undefined) { if (opt_geometryOrProperties !== undefined) {
if (opt_geometryOrProperties instanceof ol.geom.Geometry || if (opt_geometryOrProperties instanceof ol.geom.Geometry ||
goog.isNull(opt_geometryOrProperties)) { !opt_geometryOrProperties) {
var geometry = /** @type {ol.geom.Geometry} */ (opt_geometryOrProperties); var geometry = /** @type {ol.geom.Geometry} */ (opt_geometryOrProperties);
this.setGeometry(geometry); this.setGeometry(geometry);
} else { } else {
@@ -127,7 +127,7 @@ ol.Feature.prototype.clone = function() {
clone.setGeometry(geometry.clone()); clone.setGeometry(geometry.clone());
} }
var style = this.getStyle(); var style = this.getStyle();
if (!goog.isNull(style)) { if (style) {
clone.setStyle(style); clone.setStyle(style);
} }
return clone; return clone;
@@ -209,7 +209,7 @@ ol.Feature.prototype.handleGeometryChange_ = function() {
* @private * @private
*/ */
ol.Feature.prototype.handleGeometryChanged_ = function() { ol.Feature.prototype.handleGeometryChanged_ = function() {
if (!goog.isNull(this.geometryChangeKey_)) { if (this.geometryChangeKey_) {
goog.events.unlistenByKey(this.geometryChangeKey_); goog.events.unlistenByKey(this.geometryChangeKey_);
this.geometryChangeKey_ = null; this.geometryChangeKey_ = null;
} }
@@ -245,7 +245,7 @@ ol.Feature.prototype.setGeometry = function(geometry) {
*/ */
ol.Feature.prototype.setStyle = function(style) { ol.Feature.prototype.setStyle = function(style) {
this.style_ = style; this.style_ = style;
this.styleFunction_ = goog.isNull(style) ? this.styleFunction_ = !style ?
undefined : ol.Feature.createStyleFunction(style); undefined : ol.Feature.createStyleFunction(style);
this.changed(); this.changed();
}; };