Remove goog.isNull in image classes
This commit is contained in:
+3
-3
@@ -38,7 +38,7 @@ ol.Image = function(extent, resolution, pixelRatio, attributions, src,
|
|||||||
* @type {Image}
|
* @type {Image}
|
||||||
*/
|
*/
|
||||||
this.image_ = new Image();
|
this.image_ = new Image();
|
||||||
if (!goog.isNull(crossOrigin)) {
|
if (crossOrigin) {
|
||||||
this.image_.crossOrigin = crossOrigin;
|
this.image_.crossOrigin = crossOrigin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ ol.Image.prototype.load = function() {
|
|||||||
if (this.state == ol.ImageState.IDLE) {
|
if (this.state == ol.ImageState.IDLE) {
|
||||||
this.state = ol.ImageState.LOADING;
|
this.state = ol.ImageState.LOADING;
|
||||||
this.changed();
|
this.changed();
|
||||||
goog.asserts.assert(goog.isNull(this.imageListenerKeys_),
|
goog.asserts.assert(!this.imageListenerKeys_,
|
||||||
'this.imageListenerKeys_ should be null');
|
'this.imageListenerKeys_ should be null');
|
||||||
this.imageListenerKeys_ = [
|
this.imageListenerKeys_ = [
|
||||||
goog.events.listenOnce(this.image_, goog.events.EventType.ERROR,
|
goog.events.listenOnce(this.image_, goog.events.EventType.ERROR,
|
||||||
@@ -148,7 +148,7 @@ ol.Image.prototype.load = function() {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.Image.prototype.unlistenImage_ = function() {
|
ol.Image.prototype.unlistenImage_ = function() {
|
||||||
goog.asserts.assert(!goog.isNull(this.imageListenerKeys_),
|
goog.asserts.assert(this.imageListenerKeys_,
|
||||||
'this.imageListenerKeys_ should not be null');
|
'this.imageListenerKeys_ should not be null');
|
||||||
this.imageListenerKeys_.forEach(goog.events.unlistenByKey);
|
this.imageListenerKeys_.forEach(goog.events.unlistenByKey);
|
||||||
this.imageListenerKeys_ = null;
|
this.imageListenerKeys_ = null;
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ ol.ImageCanvas.prototype.handleLoad_ = function(err) {
|
|||||||
*/
|
*/
|
||||||
ol.ImageCanvas.prototype.load = function() {
|
ol.ImageCanvas.prototype.load = function() {
|
||||||
if (this.state == ol.ImageState.IDLE) {
|
if (this.state == ol.ImageState.IDLE) {
|
||||||
goog.asserts.assert(!goog.isNull(this.loader_));
|
goog.asserts.assert(this.loader_, 'this.loader_ must be set');
|
||||||
this.state = ol.ImageState.LOADING;
|
this.state = ol.ImageState.LOADING;
|
||||||
this.changed();
|
this.changed();
|
||||||
this.loader_(goog.bind(this.handleLoad_, this));
|
this.loader_(goog.bind(this.handleLoad_, this));
|
||||||
|
|||||||
+3
-3
@@ -37,7 +37,7 @@ ol.ImageTile = function(tileCoord, state, src, crossOrigin, tileLoadFunction) {
|
|||||||
* @type {Image}
|
* @type {Image}
|
||||||
*/
|
*/
|
||||||
this.image_ = new Image();
|
this.image_ = new Image();
|
||||||
if (!goog.isNull(crossOrigin)) {
|
if (crossOrigin) {
|
||||||
this.image_.crossOrigin = crossOrigin;
|
this.image_.crossOrigin = crossOrigin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ ol.ImageTile.prototype.load = function() {
|
|||||||
if (this.state == ol.TileState.IDLE) {
|
if (this.state == ol.TileState.IDLE) {
|
||||||
this.state = ol.TileState.LOADING;
|
this.state = ol.TileState.LOADING;
|
||||||
this.changed();
|
this.changed();
|
||||||
goog.asserts.assert(goog.isNull(this.imageListenerKeys_),
|
goog.asserts.assert(!this.imageListenerKeys_,
|
||||||
'this.imageListenerKeys_ should be null');
|
'this.imageListenerKeys_ should be null');
|
||||||
this.imageListenerKeys_ = [
|
this.imageListenerKeys_ = [
|
||||||
goog.events.listenOnce(this.image_, goog.events.EventType.ERROR,
|
goog.events.listenOnce(this.image_, goog.events.EventType.ERROR,
|
||||||
@@ -160,7 +160,7 @@ ol.ImageTile.prototype.load = function() {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.ImageTile.prototype.unlistenImage_ = function() {
|
ol.ImageTile.prototype.unlistenImage_ = function() {
|
||||||
goog.asserts.assert(!goog.isNull(this.imageListenerKeys_),
|
goog.asserts.assert(this.imageListenerKeys_,
|
||||||
'this.imageListenerKeys_ should not be null');
|
'this.imageListenerKeys_ should not be null');
|
||||||
this.imageListenerKeys_.forEach(goog.events.unlistenByKey);
|
this.imageListenerKeys_.forEach(goog.events.unlistenByKey);
|
||||||
this.imageListenerKeys_ = null;
|
this.imageListenerKeys_ = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user