Rename goog.DEBUG to ol.DEBUG
This commit is contained in:
+12
-12
@@ -30,7 +30,7 @@ ol.structs.RBush = function(opt_maxEntries) {
|
||||
*/
|
||||
this.items_ = {};
|
||||
|
||||
if (goog.DEBUG) {
|
||||
if (ol.DEBUG) {
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
@@ -46,7 +46,7 @@ ol.structs.RBush = function(opt_maxEntries) {
|
||||
* @param {T} value Value.
|
||||
*/
|
||||
ol.structs.RBush.prototype.insert = function(extent, value) {
|
||||
if (goog.DEBUG && this.readers_) {
|
||||
if (ol.DEBUG && this.readers_) {
|
||||
throw new Error('Can not insert value while reading');
|
||||
}
|
||||
/** @type {ol.RBushEntry} */
|
||||
@@ -60,7 +60,7 @@ ol.structs.RBush.prototype.insert = function(extent, value) {
|
||||
|
||||
this.rbush_.insert(item);
|
||||
// remember the object that was added to the internal rbush
|
||||
goog.DEBUG && console.assert(!(ol.getUid(value) in this.items_),
|
||||
ol.DEBUG && console.assert(!(ol.getUid(value) in this.items_),
|
||||
'uid (%s) of value (%s) already exists', ol.getUid(value), value);
|
||||
this.items_[ol.getUid(value)] = item;
|
||||
};
|
||||
@@ -72,10 +72,10 @@ ol.structs.RBush.prototype.insert = function(extent, value) {
|
||||
* @param {Array.<T>} values Values.
|
||||
*/
|
||||
ol.structs.RBush.prototype.load = function(extents, values) {
|
||||
if (goog.DEBUG && this.readers_) {
|
||||
if (ol.DEBUG && this.readers_) {
|
||||
throw new Error('Can not insert values while reading');
|
||||
}
|
||||
goog.DEBUG && console.assert(extents.length === values.length,
|
||||
ol.DEBUG && console.assert(extents.length === values.length,
|
||||
'extens and values must have same length (%s === %s)',
|
||||
extents.length, values.length);
|
||||
|
||||
@@ -93,7 +93,7 @@ ol.structs.RBush.prototype.load = function(extents, values) {
|
||||
value: value
|
||||
};
|
||||
items[i] = item;
|
||||
goog.DEBUG && console.assert(!(ol.getUid(value) in this.items_),
|
||||
ol.DEBUG && console.assert(!(ol.getUid(value) in this.items_),
|
||||
'uid (%s) of value (%s) already exists', ol.getUid(value), value);
|
||||
this.items_[ol.getUid(value)] = item;
|
||||
}
|
||||
@@ -107,11 +107,11 @@ ol.structs.RBush.prototype.load = function(extents, values) {
|
||||
* @return {boolean} Removed.
|
||||
*/
|
||||
ol.structs.RBush.prototype.remove = function(value) {
|
||||
if (goog.DEBUG && this.readers_) {
|
||||
if (ol.DEBUG && this.readers_) {
|
||||
throw new Error('Can not remove value while reading');
|
||||
}
|
||||
var uid = ol.getUid(value);
|
||||
goog.DEBUG && console.assert(uid in this.items_,
|
||||
ol.DEBUG && console.assert(uid in this.items_,
|
||||
'uid (%s) of value (%s) does not exist', uid, value);
|
||||
|
||||
// get the object in which the value was wrapped when adding to the
|
||||
@@ -128,13 +128,13 @@ ol.structs.RBush.prototype.remove = function(value) {
|
||||
* @param {T} value Value.
|
||||
*/
|
||||
ol.structs.RBush.prototype.update = function(extent, value) {
|
||||
goog.DEBUG && console.assert(ol.getUid(value) in this.items_,
|
||||
ol.DEBUG && console.assert(ol.getUid(value) in this.items_,
|
||||
'uid (%s) of value (%s) does not exist', ol.getUid(value), value);
|
||||
|
||||
var item = this.items_[ol.getUid(value)];
|
||||
var bbox = [item.minX, item.minY, item.maxX, item.maxY];
|
||||
if (!ol.extent.equals(bbox, extent)) {
|
||||
if (goog.DEBUG && this.readers_) {
|
||||
if (ol.DEBUG && this.readers_) {
|
||||
throw new Error('Can not update extent while reading');
|
||||
}
|
||||
this.remove(value);
|
||||
@@ -185,7 +185,7 @@ ol.structs.RBush.prototype.getInExtent = function(extent) {
|
||||
* @template S
|
||||
*/
|
||||
ol.structs.RBush.prototype.forEach = function(callback, opt_this) {
|
||||
if (goog.DEBUG) {
|
||||
if (ol.DEBUG) {
|
||||
++this.readers_;
|
||||
try {
|
||||
return this.forEach_(this.getAll(), callback, opt_this);
|
||||
@@ -207,7 +207,7 @@ ol.structs.RBush.prototype.forEach = function(callback, opt_this) {
|
||||
* @template S
|
||||
*/
|
||||
ol.structs.RBush.prototype.forEachInExtent = function(extent, callback, opt_this) {
|
||||
if (goog.DEBUG) {
|
||||
if (ol.DEBUG) {
|
||||
++this.readers_;
|
||||
try {
|
||||
return this.forEach_(this.getInExtent(extent), callback, opt_this);
|
||||
|
||||
Reference in New Issue
Block a user