Replace source ready flag with loading/ready/error enum
This commit is contained in:
@@ -9,6 +9,7 @@ goog.require('ol.TileRange');
|
||||
goog.require('ol.TileUrlFunction');
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.State');
|
||||
goog.require('ol.source.TileImage');
|
||||
goog.require('ol.tilegrid.XYZ');
|
||||
|
||||
@@ -25,6 +26,7 @@ ol.source.BingMaps = function(options) {
|
||||
crossOrigin: 'anonymous',
|
||||
opaque: true,
|
||||
projection: ol.proj.get('EPSG:3857'),
|
||||
state: ol.source.State.LOADING,
|
||||
tileLoadFunction: options.tileLoadFunction
|
||||
});
|
||||
|
||||
@@ -34,12 +36,6 @@ ol.source.BingMaps = function(options) {
|
||||
*/
|
||||
this.culture_ = goog.isDef(options.culture) ? options.culture : 'en-us';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.ready_ = false;
|
||||
|
||||
var uri = new goog.Uri(
|
||||
'//dev.virtualearth.net/REST/v1/Imagery/Metadata/' + options.style);
|
||||
var jsonp = new goog.net.Jsonp(uri, 'jsonp');
|
||||
@@ -139,16 +135,6 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse =
|
||||
|
||||
this.setLogo(brandLogoUri);
|
||||
|
||||
this.ready_ = true;
|
||||
|
||||
this.dispatchChangeEvent();
|
||||
this.setState(ol.source.State.READY);
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.source.BingMaps.prototype.isReady = function() {
|
||||
return this.ready_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user