Add tile error handling
This commit is contained in:
+11
-4
@@ -134,8 +134,7 @@ ol.VectorTile.prototype.getProjection = function() {
|
||||
*/
|
||||
ol.VectorTile.prototype.load = function() {
|
||||
if (this.state == ol.TileState.IDLE) {
|
||||
this.state = ol.TileState.LOADING;
|
||||
this.changed();
|
||||
this.setState(ol.TileState.LOADING);
|
||||
this.tileLoadFunction_(this, this.url_);
|
||||
this.loader_(null, NaN, null);
|
||||
}
|
||||
@@ -147,8 +146,7 @@ ol.VectorTile.prototype.load = function() {
|
||||
*/
|
||||
ol.VectorTile.prototype.setFeatures = function(features) {
|
||||
this.features_ = features;
|
||||
this.state = ol.TileState.LOADED;
|
||||
this.changed();
|
||||
this.setState(ol.TileState.LOADED);
|
||||
};
|
||||
|
||||
|
||||
@@ -160,6 +158,15 @@ ol.VectorTile.prototype.setProjection = function(projection) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.TileState} tileState Tile state.
|
||||
*/
|
||||
ol.VectorTile.prototype.setState = function(tileState) {
|
||||
this.state = tileState;
|
||||
this.changed();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Set the feeature loader for reading this tile's features.
|
||||
* @param {ol.FeatureLoader} loader Feature loader.
|
||||
|
||||
Reference in New Issue
Block a user