Add render options for vector tile layers

This commit is contained in:
Andreas Hocevar
2016-04-05 23:18:13 +02:00
parent 0e4692e69e
commit f7147960a9
12 changed files with 510 additions and 403 deletions
+7 -2
View File
@@ -472,10 +472,15 @@ ol.tilegrid.TileGrid.prototype.getFullTileRange = function(z) {
/**
* @param {number} resolution Resolution.
* @param {number=} opt_direction If 0, the nearest resolution will be used.
* If 1, the nearest lower resolution will be used. If -1, the nearest
* higher resolution will be used. Default is 0.
* @return {number} Z.
*/
ol.tilegrid.TileGrid.prototype.getZForResolution = function(resolution) {
var z = ol.array.linearFindNearest(this.resolutions_, resolution, 0);
ol.tilegrid.TileGrid.prototype.getZForResolution = function(
resolution, opt_direction) {
var z = ol.array.linearFindNearest(this.resolutions_, resolution,
opt_direction || 0);
return ol.math.clamp(z, this.minZoom, this.maxZoom);
};