Rename goog.DEBUG to ol.DEBUG

This commit is contained in:
Andreas Hocevar
2016-08-28 17:02:49 +02:00
parent 92ab5a079c
commit d1e4b33760
115 changed files with 701 additions and 691 deletions

View File

@@ -130,7 +130,7 @@ ol.layer.Group.prototype.handleLayersChanged_ = function(event) {
ol.layer.Group.prototype.handleLayersAdd_ = function(collectionEvent) {
var layer = /** @type {ol.layer.Base} */ (collectionEvent.element);
var key = ol.getUid(layer).toString();
goog.DEBUG && console.assert(!(key in this.listenerKeys_),
ol.DEBUG && console.assert(!(key in this.listenerKeys_),
'listeners already registered');
this.listenerKeys_[key] = [
ol.events.listen(layer, ol.ObjectEventType.PROPERTYCHANGE,
@@ -149,7 +149,7 @@ ol.layer.Group.prototype.handleLayersAdd_ = function(collectionEvent) {
ol.layer.Group.prototype.handleLayersRemove_ = function(collectionEvent) {
var layer = /** @type {ol.layer.Base} */ (collectionEvent.element);
var key = ol.getUid(layer).toString();
goog.DEBUG && console.assert(key in this.listenerKeys_, 'no listeners to unregister');
ol.DEBUG && console.assert(key in this.listenerKeys_, 'no listeners to unregister');
this.listenerKeys_[key].forEach(ol.events.unlistenByKey);
delete this.listenerKeys_[key];
this.changed();

View File

@@ -100,12 +100,12 @@ ol.layer.Heatmap = function(opt_options) {
} else {
weightFunction = weight;
}
goog.DEBUG && console.assert(typeof weightFunction === 'function',
ol.DEBUG && console.assert(typeof weightFunction === 'function',
'weightFunction should be a function');
this.setStyle(function(feature, resolution) {
goog.DEBUG && console.assert(this.styleCache_, 'this.styleCache_ expected');
goog.DEBUG && console.assert(this.circleImage_ !== undefined,
ol.DEBUG && console.assert(this.styleCache_, 'this.styleCache_ expected');
ol.DEBUG && console.assert(this.circleImage_ !== undefined,
'this.circleImage_ should be defined');
var weight = weightFunction(feature);
var opacity = weight !== undefined ? ol.math.clamp(weight, 0, 1) : 1;
@@ -173,7 +173,7 @@ ol.layer.Heatmap.createGradient_ = function(colors) {
ol.layer.Heatmap.prototype.createCircle_ = function() {
var radius = this.getRadius();
var blur = this.getBlur();
goog.DEBUG && console.assert(radius !== undefined && blur !== undefined,
ol.DEBUG && console.assert(radius !== undefined && blur !== undefined,
'radius and blur should be defined');
var halfSize = radius + blur + 1;
var size = 2 * halfSize;
@@ -246,9 +246,9 @@ ol.layer.Heatmap.prototype.handleStyleChanged_ = function() {
* @private
*/
ol.layer.Heatmap.prototype.handleRender_ = function(event) {
goog.DEBUG && console.assert(event.type == ol.render.EventType.RENDER,
ol.DEBUG && console.assert(event.type == ol.render.EventType.RENDER,
'event.type should be RENDER');
goog.DEBUG && console.assert(this.gradient_, 'this.gradient_ expected');
ol.DEBUG && console.assert(this.gradient_, 'this.gradient_ expected');
var context = event.context;
var canvas = context.canvas;
var image = context.getImageData(0, 0, canvas.width, canvas.height);

View File

@@ -32,7 +32,7 @@ ol.layer.Vector = function(opt_options) {
var options = opt_options ?
opt_options : /** @type {olx.layer.VectorOptions} */ ({});
goog.DEBUG && console.assert(
ol.DEBUG && console.assert(
options.renderOrder === undefined || !options.renderOrder ||
typeof options.renderOrder === 'function',
'renderOrder must be a comparator function');
@@ -158,7 +158,7 @@ ol.layer.Vector.prototype.getUpdateWhileInteracting = function() {
* Render order.
*/
ol.layer.Vector.prototype.setRenderOrder = function(renderOrder) {
goog.DEBUG && console.assert(
ol.DEBUG && console.assert(
renderOrder === undefined || !renderOrder ||
typeof renderOrder === 'function',
'renderOrder must be a comparator function');