Remove goog.isNull in overlay class

This commit is contained in:
Marc Jansen
2015-09-29 15:24:25 +02:00
parent 5502083af9
commit 2b84e0f245

View File

@@ -254,7 +254,7 @@ ol.Overlay.prototype.handleElementChanged = function() {
* @protected
*/
ol.Overlay.prototype.handleMapChanged = function() {
if (!goog.isNull(this.mapPostrenderListenerKey_)) {
if (this.mapPostrenderListenerKey_) {
goog.dom.removeNode(this.element_);
goog.events.unlistenByKey(this.mapPostrenderListenerKey_);
this.mapPostrenderListenerKey_ = null;
@@ -366,7 +366,7 @@ ol.Overlay.prototype.panIntoView_ = function() {
goog.asserts.assert(this.autoPan, 'this.autoPan should be true');
var map = this.getMap();
if (map === undefined || goog.isNull(map.getTargetElement())) {
if (map === undefined || !map.getTargetElement()) {
return;
}
@@ -409,7 +409,7 @@ ol.Overlay.prototype.panIntoView_ = function() {
centerPx[1] + delta[1]
];
if (!goog.isNull(this.autoPanAnimation_)) {
if (this.autoPanAnimation_) {
this.autoPanAnimation_.source = center;
map.beforeRender(ol.animation.pan(this.autoPanAnimation_));
}
@@ -489,7 +489,7 @@ ol.Overlay.prototype.updatePixelPosition = function() {
* @protected
*/
ol.Overlay.prototype.updateRenderedPosition = function(pixel, mapSize) {
goog.asserts.assert(!goog.isNull(pixel), 'pixel should not be null');
goog.asserts.assert(pixel, 'pixel should not be null');
goog.asserts.assert(mapSize !== undefined, 'mapSize should be defined');
var style = this.element_.style;
var offset = this.getOffset();