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

@@ -365,7 +365,7 @@ ol.View.prototype.getResolutionForValueFunction = function(opt_power) {
*/
function(value) {
var resolution = maxResolution / Math.pow(power, value * max);
goog.DEBUG && console.assert(resolution >= minResolution &&
ol.DEBUG && console.assert(resolution >= minResolution &&
resolution <= maxResolution,
'calculated resolution outside allowed bounds (%s <= %s <= %s)',
minResolution, resolution, maxResolution);
@@ -404,7 +404,7 @@ ol.View.prototype.getValueForResolutionFunction = function(opt_power) {
function(resolution) {
var value =
(Math.log(maxResolution / resolution) / Math.log(power)) / max;
goog.DEBUG && console.assert(value >= 0 && value <= 1,
ol.DEBUG && console.assert(value >= 0 && value <= 1,
'calculated value (%s) ouside allowed range (0-1)', value);
return value;
});
@@ -415,7 +415,7 @@ ol.View.prototype.getValueForResolutionFunction = function(opt_power) {
* @return {olx.ViewState} View state.
*/
ol.View.prototype.getState = function() {
goog.DEBUG && console.assert(this.isDef(),
ol.DEBUG && console.assert(this.isDef(),
'the view was not defined (had no center and/or resolution)');
var center = /** @type {ol.Coordinate} */ (this.getCenter());
var projection = this.getProjection();
@@ -499,7 +499,7 @@ ol.View.prototype.fit = function(geometry, size, opt_options) {
// calculate rotated extent
var rotation = this.getRotation();
goog.DEBUG && console.assert(rotation !== undefined, 'rotation was not defined');
ol.DEBUG && console.assert(rotation !== undefined, 'rotation was not defined');
var cosAngle = Math.cos(-rotation);
var sinAngle = Math.sin(-rotation);
var minRotX = +Infinity;
@@ -612,10 +612,10 @@ ol.View.prototype.setCenter = function(center) {
* @return {number} New value.
*/
ol.View.prototype.setHint = function(hint, delta) {
goog.DEBUG && console.assert(0 <= hint && hint < this.hints_.length,
ol.DEBUG && console.assert(0 <= hint && hint < this.hints_.length,
'illegal hint (%s), must be between 0 and %s', hint, this.hints_.length);
this.hints_[hint] += delta;
goog.DEBUG && console.assert(this.hints_[hint] >= 0,
ol.DEBUG && console.assert(this.hints_[hint] >= 0,
'Hint at %s must be positive, was %s', hint, this.hints_[hint]);
return this.hints_[hint];
};
@@ -768,7 +768,7 @@ ol.View.createRotationConstraint_ = function(options) {
} else if (typeof constrainRotation === 'number') {
return ol.RotationConstraint.createSnapToN(constrainRotation);
} else {
goog.DEBUG && console.assert(false,
ol.DEBUG && console.assert(false,
'illegal option for constrainRotation (%s)', constrainRotation);
return ol.RotationConstraint.none;
}