Remove the tilePixelRatio option from ol.source.VectorTile

This commit is contained in:
Andreas Hocevar
2017-08-02 23:57:29 +02:00
parent b3be7e7ba9
commit d4d371a4c2
8 changed files with 32 additions and 32 deletions
+14 -2
View File
@@ -93,7 +93,7 @@ ol.VectorTile.prototype.disposeInternal = function() {
* @return {ol.Extent} The extent.
*/
ol.VectorTile.prototype.getExtent = function() {
return this.extent_;
return this.extent_ || ol.VectorTile.DEFAULT_EXTENT;
};
@@ -180,7 +180,12 @@ ol.VectorTile.prototype.onError = function() {
/**
* Sets the extent of the vector tile.
* Sets the extent of the vector tile. For tiles in projections with
* `tile-pixels` as units, this should be set to
* `[0, 0, tilePixelSize, tilePixelSize]` by the source's `tileLoadFunction`.
* `tilePixelSize` is calculated by multiplying the tile size with the tile
* pixel ratio. When using `ol.format.MVT`, the format's `getLastExtent()`
* method returns the correct extent. The default is `[0, 0, 4096, 4096]`.
* @param {ol.Extent} extent The extent.
* @api
*/
@@ -227,3 +232,10 @@ ol.VectorTile.prototype.setReplayGroup = function(layer, key, replayGroup) {
ol.VectorTile.prototype.setLoader = function(loader) {
this.loader_ = loader;
};
/**
* @const
* @type {ol.Extent}
*/
ol.VectorTile.DEFAULT_EXTENT = [0, 0, 4096, 4096];