Remove goog.isNull in layer classes

This commit is contained in:
Marc Jansen
2015-09-29 15:19:27 +02:00
parent be2e4a33ae
commit f5788a32a7
3 changed files with 10 additions and 12 deletions
+5 -5
View File
@@ -118,7 +118,7 @@ ol.layer.Layer.prototype.getSource = function() {
*/
ol.layer.Layer.prototype.getSourceState = function() {
var source = this.getSource();
return goog.isNull(source) ? ol.source.State.UNDEFINED : source.getState();
return !source ? ol.source.State.UNDEFINED : source.getState();
};
@@ -134,12 +134,12 @@ ol.layer.Layer.prototype.handleSourceChange_ = function() {
* @private
*/
ol.layer.Layer.prototype.handleSourcePropertyChange_ = function() {
if (!goog.isNull(this.sourceChangeKey_)) {
if (this.sourceChangeKey_) {
goog.events.unlistenByKey(this.sourceChangeKey_);
this.sourceChangeKey_ = null;
}
var source = this.getSource();
if (!goog.isNull(source)) {
if (source) {
this.sourceChangeKey_ = goog.events.listen(source,
goog.events.EventType.CHANGE, this.handleSourceChange_, false, this);
}
@@ -162,12 +162,12 @@ ol.layer.Layer.prototype.handleSourcePropertyChange_ = function() {
ol.layer.Layer.prototype.setMap = function(map) {
goog.events.unlistenByKey(this.mapPrecomposeKey_);
this.mapPrecomposeKey_ = null;
if (goog.isNull(map)) {
if (!map) {
this.changed();
}
goog.events.unlistenByKey(this.mapRenderKey_);
this.mapRenderKey_ = null;
if (!goog.isNull(map)) {
if (map) {
this.mapPrecomposeKey_ = goog.events.listen(
map, ol.render.EventType.PRECOMPOSE, function(evt) {
var layerState = this.getLayerState();