From 49796090fad1de1f8bc72a90a83fd938b0522dfe Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sat, 11 Oct 2014 18:16:14 -0600 Subject: [PATCH] Allow renderer to load the image --- src/ol/source/imagestaticsource.js | 31 ++---------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/src/ol/source/imagestaticsource.js b/src/ol/source/imagestaticsource.js index efff819218..4aea4b4b81 100644 --- a/src/ol/source/imagestaticsource.js +++ b/src/ol/source/imagestaticsource.js @@ -1,13 +1,10 @@ goog.provide('ol.source.ImageStatic'); goog.require('goog.events'); -goog.require('goog.events.EventType'); goog.require('ol.Image'); -goog.require('ol.ImageState'); goog.require('ol.extent'); goog.require('ol.proj'); goog.require('ol.source.Image'); -goog.require('ol.source.State'); @@ -28,13 +25,10 @@ ol.source.ImageStatic = function(options) { var imageExtent = options.imageExtent; - var state, resolution, resolutions; + var resolution, resolutions; if (goog.isDef(options.imageSize)) { - state = ol.source.State.READY; resolution = ol.extent.getHeight(imageExtent) / options.imageSize[1]; resolutions = [resolution]; - } else { - state = ol.source.State.LOADING; } var crossOrigin = goog.isDef(options.crossOrigin) ? @@ -44,8 +38,7 @@ ol.source.ImageStatic = function(options) { attributions: attributions, logo: options.logo, projection: ol.proj.get(options.projection), - resolutions: resolutions, - state: state + resolutions: resolutions }); /** @@ -55,12 +48,6 @@ ol.source.ImageStatic = function(options) { this.image_ = new ol.Image(imageExtent, resolution, 1, attributions, options.url, crossOrigin); - if (state !== ol.source.State.READY) { - goog.events.listen(this.image_, goog.events.EventType.CHANGE, - this.handleImageChange_, false, this); - this.image_.load(); - } - }; goog.inherits(ol.source.ImageStatic, ol.source.Image); @@ -75,17 +62,3 @@ ol.source.ImageStatic.prototype.getImage = } return null; }; - - -/** - * Handle image change events. - * @private - */ -ol.source.ImageStatic.prototype.handleImageChange_ = function() { - var imageState = this.image_.getState(); - if (imageState === ol.ImageState.LOADED) { - this.setState(ol.source.State.READY); - } else if (imageState === ol.ImageState.ERROR) { - this.setState(ol.source.State.ERROR); - } -};