From b8b48afc8237ed552de06234c238ab5b7ba86954 Mon Sep 17 00:00:00 2001 From: tsauerwein Date: Mon, 24 Nov 2014 09:57:09 +0100 Subject: [PATCH] Use WEBGL_MAX_TEXTURE_SIZE as default --- examples/symbol-atlas-webgl.js | 3 +-- externs/olx.js | 4 +++- src/ol/style/atlasmanager.js | 9 ++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/symbol-atlas-webgl.js b/examples/symbol-atlas-webgl.js index 4b1ece67f7..77e9fda7da 100644 --- a/examples/symbol-atlas-webgl.js +++ b/examples/symbol-atlas-webgl.js @@ -14,8 +14,7 @@ goog.require('ol.style.Style'); var atlasManager = new ol.style.AtlasManager({ // we increase the default size so that all symbols fit into // a single atlas image - size: 512, - maxSize: ol.WEBGL_MAX_TEXTURE_SIZE + size: 512 }); var symbolInfo = [{ diff --git a/externs/olx.js b/externs/olx.js index 9697bb9332..ed6df1401c 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -6271,7 +6271,9 @@ olx.style.AtlasManagerOptions.prototype.size; /** - * The maximum size in pixels of atlas images (default: 2048). + * The maximum size in pixels of atlas images. If no value is given, + * `ol.WEBGL_MAX_TEXTURE_SIZE` will be used (if WebGL is supported), otherwise + * the default is 2048. * @type {number|undefined} * @api */ diff --git a/src/ol/style/atlasmanager.js b/src/ol/style/atlasmanager.js index 5eb7bf9ce4..f300ee0cce 100644 --- a/src/ol/style/atlasmanager.js +++ b/src/ol/style/atlasmanager.js @@ -30,10 +30,8 @@ ol.style.AtlasManagerInfo; * atlas. After that, when new atlases are created, they will have * twice the size as the latest atlas (until `maxSize` is reached). * - * When used for WebGL, it is recommended to use `ol.has.WEBGL_MAX_TEXTURE_SIZE` - * as `maxSize` value. Also, if an application uses a lot, or a lot of - * large images, it is recommend to set a higher `size` value to avoid - * the creation of too many atlases. + * If an application uses a lot, or a lot of large images, it is recommend to + * set a higher `size` value to avoid the creation of too many atlases. * * @constructor * @struct @@ -56,7 +54,8 @@ ol.style.AtlasManager = function(opt_options) { * @private * @type {number} */ - this.maxSize_ = goog.isDef(options.maxSize) ? options.maxSize : 2048; + this.maxSize_ = goog.isDef(options.maxSize) ? options.maxSize : + goog.isDef(ol.WEBGL_MAX_TEXTURE_SIZE) ? ol.WEBGL_MAX_TEXTURE_SIZE : 2048; /** * The size in pixels between images.