Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor tweaks.

  • Loading branch information...
commit a3dae845d3597bd085799a7e1e83cc8af3c06b22 1 parent 1f7c18b
@kring kring authored
View
18 Source/Scene/ImageryLayer.js
@@ -736,6 +736,9 @@ define([
imagery.state = ImageryState.READY;
};
+ var tileTextureWidth = 256;
+ var tileTextureHeight = 256;
+
/**
* Copies an imagery tile to the terrain tile's texture for the corresponding layer, reprojecting
* from Web Mercator to Geographic along the way, if necessary. Mip levels are not filled until
@@ -758,8 +761,8 @@ define([
// the texture before using it, because imagery might not completely overlap this
// terrain tile.
tile.textures[this._layerIndex] = tileTexture = context.createTexture2D({
- width : 256,
- height : 256
+ width : tileTextureWidth,
+ height : tileTextureHeight
});
if (typeof this._mipmapSampler === 'undefined') {
@@ -922,11 +925,8 @@ define([
texture.setSampler(imageryLayer._copySampler);
- var width = 256;
- var height = 256;
-
- uniformMap.textureDimensions.x = width;
- uniformMap.textureDimensions.y = height;
+ uniformMap.textureDimensions.x = tileTextureWidth;
+ uniformMap.textureDimensions.y = tileTextureHeight;
uniformMap.texture = texture;
// Reproject this texture if it is not already in a geographic projection and
@@ -965,8 +965,8 @@ define([
viewport = new BoundingRectangle();
renderState.viewport = viewport;
}
- viewport.width = width;
- viewport.height = height;
+ viewport.width = tileTextureWidth;
+ viewport.height = tileTextureHeight;
context.draw({
framebuffer : imageryLayer._fbCopy,
View
6 Source/Scene/TileCoordinatesImageryProvider.js
@@ -44,6 +44,8 @@ define([
this._tilingScheme = defaultValue(description.tilingScheme, new GeographicTilingScheme());
this._color = defaultValue(description.color, 'yellow');
this._errorEvent = new Event();
+ this._tileWidth = defaultValue(description.tileWidth, 256);
+ this._tileHeight = defaultValue(description.tileHeight, 256);
};
/**
@@ -57,7 +59,7 @@ define([
* @exception {DeveloperError} <code>getTileWidth</code> must not be called before the imagery provider is ready.
*/
TileCoordinatesImageryProvider.prototype.getTileWidth = function() {
- return 256;
+ return this._tileWidth;
};
/**
@@ -71,7 +73,7 @@ define([
* @exception {DeveloperError} <code>getTileHeight</code> must not be called before the imagery provider is ready.
*/
TileCoordinatesImageryProvider.prototype.getTileHeight = function() {
- return 256;
+ return this._tileHeight;
};
/**
Please sign in to comment.
Something went wrong with that request. Please try again.