Skip to content

Commit

Permalink
Merge pull request CesiumGS#1 from oterral/c2c_c2c_patches_maxlevel
Browse files Browse the repository at this point in the history
Add maximumRetrievingLevel property to UrlTemplateImageryProvider
  • Loading branch information
gberaudo committed Oct 27, 2015
2 parents 9e67416 + 279551f commit 30af3e8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/Scene/UrlTemplateImageryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ define([
this._minimumLevel = defaultValue(options.minimumLevel, 0);
this._maximumLevel = options.maximumLevel;
this._minimumRetrievingLevel = defaultValue(options.minimumRetrievingLevel, 0);
this._maximumRetrievingLevel = defaultValue(options.maximumRetrievingLevel, Infinity);
this._tilingScheme = defaultValue(options.tilingScheme, new WebMercatorTilingScheme({ ellipsoid : options.ellipsoid }));
this._rectangle = defaultValue(options.rectangle, this._tilingScheme.rectangle);
this._rectangle = Rectangle.intersection(this._rectangle, this._tilingScheme.rectangle);
Expand Down Expand Up @@ -458,8 +459,8 @@ define([
* Image or a Canvas DOM object.
*/
UrlTemplateImageryProvider.prototype.requestImage = function(x, y, level) {
if (level < this._minimumRetrievingLevel) {
return UrlTemplateImageryProvider.transparentCanvas;
if (level < this._minimumRetrievingLevel || level > this._maximumRetrievingLevel)) {
return UrlTemplateImageryProvider.transparentCanvas;
}
var url = buildImageUrl(this, x, y, level);
return ImageryProvider.loadImage(this, url);
Expand Down

0 comments on commit 30af3e8

Please # to comment.