Move constants from ol.has to ol

This commit is contained in:
tsauerwein
2014-11-24 09:42:10 +01:00
parent 3ed46c50cc
commit e307579d49
4 changed files with 22 additions and 23 deletions

View File

@@ -15,7 +15,7 @@ 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.has.WEBGL_MAX_TEXTURE_SIZE
maxSize: ol.WEBGL_MAX_TEXTURE_SIZE
});
var symbolInfo = [{

View File

@@ -122,24 +122,6 @@ ol.has.MSPOINTER = !!(goog.global.navigator.msPointerEnabled);
ol.has.WEBGL;
/**
* The maximum supported WebGL texture size in pixels. If WebGL is not
* supported, the value is set to `undefined`.
* @const
* @type {number|undefined}
* @api
*/
ol.has.WEBGL_MAX_TEXTURE_SIZE;
/**
* List of supported WebGL extensions.
* @const
* @type {Array.<string>}
*/
ol.has.WEBGL_EXTENSIONS;
(function() {
if (ol.ENABLE_WEBGL) {
var hasWebGL = false;
@@ -162,7 +144,7 @@ ol.has.WEBGL_EXTENSIONS;
} catch (e) {}
}
ol.has.WEBGL = hasWebGL;
ol.has.WEBGL_MAX_TEXTURE_SIZE = textureSize;
ol.has.WEBGL_EXTENSIONS = extensions;
ol.WEBGL_EXTENSIONS = extensions;
ol.WEBGL_MAX_TEXTURE_SIZE = textureSize;
}
})();

View File

@@ -219,6 +219,24 @@ ol.SIMPLIFY_TOLERANCE = 0.5;
ol.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK = 1024;
/**
* The maximum supported WebGL texture size in pixels. If WebGL is not
* supported, the value is set to `undefined`.
* @const
* @type {number|undefined}
* @api
*/
ol.WEBGL_MAX_TEXTURE_SIZE; // value is set in `ol.has`
/**
* List of supported WebGL extensions.
* @const
* @type {Array.<string>}
*/
ol.WEBGL_EXTENSIONS; // value is set in `ol.has`
/**
* @define {number} Zoom slider animation duration.
*/

View File

@@ -5,7 +5,6 @@ goog.require('goog.asserts');
goog.require('goog.events');
goog.require('goog.log');
goog.require('goog.object');
goog.require('ol.has');
goog.require('ol.webgl.Buffer');
goog.require('ol.webgl.WebGLContextEventType');
@@ -70,7 +69,7 @@ ol.webgl.Context = function(canvas, gl) {
* @type {boolean}
*/
this.hasOESElementIndexUint = goog.array.contains(
ol.has.WEBGL_EXTENSIONS, 'OES_element_index_uint');
ol.WEBGL_EXTENSIONS, 'OES_element_index_uint');
// use the OES_element_index_uint extension if available
if (this.hasOESElementIndexUint) {