Get tilePixelRatio from MVT tiles

This commit is contained in:
Andreas Hocevar
2017-08-02 17:45:55 +02:00
parent 007d8c2d5e
commit b3be7e7ba9
11 changed files with 113 additions and 25 deletions
+29 -2
View File
@@ -23,6 +23,12 @@ ol.VectorTile = function(tileCoord, state, src, format, tileLoadFunction) {
*/
this.consumers = 0;
/**
* @private
* @type {ol.Extent}
*/
this.extent_ = null;
/**
* @private
* @type {ol.format.Feature}
@@ -82,6 +88,15 @@ ol.VectorTile.prototype.disposeInternal = function() {
};
/**
* Gets the extent of the vector tile.
* @return {ol.Extent} The extent.
*/
ol.VectorTile.prototype.getExtent = function() {
return this.extent_;
};
/**
* Get the feature format assigned for reading this tile's features.
* @return {ol.format.Feature} Feature format.
@@ -147,21 +162,33 @@ ol.VectorTile.prototype.load = function() {
* Handler for successful tile load.
* @param {Array.<ol.Feature>} features The loaded features.
* @param {ol.proj.Projection} dataProjection Data projection.
* @param {ol.Extent} extent Extent.
*/
ol.VectorTile.prototype.onLoad_ = function(features, dataProjection) {
ol.VectorTile.prototype.onLoad = function(features, dataProjection, extent) {
this.setProjection(dataProjection);
this.setFeatures(features);
this.setExtent(extent);
};
/**
* Handler for tile load errors.
*/
ol.VectorTile.prototype.onError_ = function() {
ol.VectorTile.prototype.onError = function() {
this.setState(ol.TileState.ERROR);
};
/**
* Sets the extent of the vector tile.
* @param {ol.Extent} extent The extent.
* @api
*/
ol.VectorTile.prototype.setExtent = function(extent) {
this.extent_ = extent;
};
/**
* @param {Array.<ol.Feature>} features Features.
* @api