Merge pull request #5801 from fredj/rm_ol.style.ImageState

Remove ol.style.ImageState and use ol.ImageState instead
This commit is contained in:
Frédéric Junod
2016-08-29 11:16:48 +02:00
committed by GitHub
13 changed files with 79 additions and 93 deletions

View File

@@ -2,7 +2,7 @@ goog.provide('ol.source.Image');
goog.provide('ol.source.ImageEvent');
goog.require('ol');
goog.require('ol.ImageState');
goog.require('ol.Image');
goog.require('ol.array');
goog.require('ol.events.Event');
goog.require('ol.extent');
@@ -148,17 +148,17 @@ ol.source.Image.prototype.getImageInternal = function(extent, resolution, pixelR
ol.source.Image.prototype.handleImageChange = function(event) {
var image = /** @type {ol.Image} */ (event.target);
switch (image.getState()) {
case ol.ImageState.LOADING:
case ol.Image.State.LOADING:
this.dispatchEvent(
new ol.source.ImageEvent(ol.source.ImageEventType.IMAGELOADSTART,
image));
break;
case ol.ImageState.LOADED:
case ol.Image.State.LOADED:
this.dispatchEvent(
new ol.source.ImageEvent(ol.source.ImageEventType.IMAGELOADEND,
image));
break;
case ol.ImageState.ERROR:
case ol.Image.State.ERROR:
this.dispatchEvent(
new ol.source.ImageEvent(ol.source.ImageEventType.IMAGELOADERROR,
image));

View File

@@ -2,7 +2,6 @@ goog.provide('ol.source.ImageStatic');
goog.require('ol');
goog.require('ol.Image');
goog.require('ol.ImageState');
goog.require('ol.dom');
goog.require('ol.events');
goog.require('ol.events.EventType');
@@ -71,7 +70,7 @@ ol.source.ImageStatic.prototype.getImageInternal = function(extent, resolution,
* @inheritDoc
*/
ol.source.ImageStatic.prototype.handleImageChange = function(evt) {
if (this.image_.getState() == ol.ImageState.LOADED) {
if (this.image_.getState() == ol.Image.State.LOADED) {
var imageExtent = this.image_.getExtent();
var image = this.image_.getImage();
var imageWidth, imageHeight;