Remove ol.DEBUG
This commit is contained in:
@@ -123,8 +123,6 @@ 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();
|
||||
ol.DEBUG && console.assert(!(key in this.listenerKeys_),
|
||||
'listeners already registered');
|
||||
this.listenerKeys_[key] = [
|
||||
ol.events.listen(layer, ol.ObjectEventType.PROPERTYCHANGE,
|
||||
this.handleLayerChange_, this),
|
||||
@@ -142,7 +140,6 @@ 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();
|
||||
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();
|
||||
|
||||
@@ -90,13 +90,8 @@ ol.layer.Heatmap = function(opt_options) {
|
||||
} else {
|
||||
weightFunction = weight;
|
||||
}
|
||||
ol.DEBUG && console.assert(typeof weightFunction === 'function',
|
||||
'weightFunction should be a function');
|
||||
|
||||
this.setStyle(function(feature, resolution) {
|
||||
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;
|
||||
// cast to 8 bits
|
||||
@@ -121,7 +116,6 @@ ol.layer.Heatmap = function(opt_options) {
|
||||
this.setRenderOrder(null);
|
||||
|
||||
ol.events.listen(this, ol.render.EventType.RENDER, this.handleRender_, this);
|
||||
|
||||
};
|
||||
ol.inherits(ol.layer.Heatmap, ol.layer.Vector);
|
||||
|
||||
@@ -163,8 +157,6 @@ ol.layer.Heatmap.createGradient_ = function(colors) {
|
||||
ol.layer.Heatmap.prototype.createCircle_ = function() {
|
||||
var radius = this.getRadius();
|
||||
var blur = this.getBlur();
|
||||
ol.DEBUG && console.assert(radius !== undefined && blur !== undefined,
|
||||
'radius and blur should be defined');
|
||||
var halfSize = radius + blur + 1;
|
||||
var size = 2 * halfSize;
|
||||
var context = ol.dom.createCanvasContext2D(size, size);
|
||||
@@ -236,9 +228,6 @@ ol.layer.Heatmap.prototype.handleStyleChanged_ = function() {
|
||||
* @private
|
||||
*/
|
||||
ol.layer.Heatmap.prototype.handleRender_ = function(event) {
|
||||
ol.DEBUG && console.assert(event.type == ol.render.EventType.RENDER,
|
||||
'event.type should be RENDER');
|
||||
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);
|
||||
|
||||
@@ -23,14 +23,8 @@ goog.require('ol.style.Style');
|
||||
* @api stable
|
||||
*/
|
||||
ol.layer.Vector = function(opt_options) {
|
||||
|
||||
var options = opt_options ?
|
||||
opt_options : /** @type {olx.layer.VectorOptions} */ ({});
|
||||
|
||||
ol.DEBUG && console.assert(
|
||||
options.renderOrder === undefined || !options.renderOrder ||
|
||||
typeof options.renderOrder === 'function',
|
||||
'renderOrder must be a comparator function');
|
||||
opt_options : /** @type {olx.layer.VectorOptions} */ ({});
|
||||
|
||||
var baseOptions = ol.obj.assign({}, options);
|
||||
|
||||
@@ -40,43 +34,42 @@ ol.layer.Vector = function(opt_options) {
|
||||
delete baseOptions.updateWhileInteracting;
|
||||
ol.layer.Layer.call(this, /** @type {olx.layer.LayerOptions} */ (baseOptions));
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
* @private
|
||||
*/
|
||||
/**
|
||||
* @type {number}
|
||||
* @private
|
||||
*/
|
||||
this.renderBuffer_ = options.renderBuffer !== undefined ?
|
||||
options.renderBuffer : 100;
|
||||
options.renderBuffer : 100;
|
||||
|
||||
/**
|
||||
* User provided style.
|
||||
* @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction}
|
||||
* @private
|
||||
*/
|
||||
/**
|
||||
* User provided style.
|
||||
* @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction}
|
||||
* @private
|
||||
*/
|
||||
this.style_ = null;
|
||||
|
||||
/**
|
||||
* Style function for use within the library.
|
||||
* @type {ol.StyleFunction|undefined}
|
||||
* @private
|
||||
*/
|
||||
/**
|
||||
* Style function for use within the library.
|
||||
* @type {ol.StyleFunction|undefined}
|
||||
* @private
|
||||
*/
|
||||
this.styleFunction_ = undefined;
|
||||
|
||||
this.setStyle(options.style);
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
* @private
|
||||
*/
|
||||
/**
|
||||
* @type {boolean}
|
||||
* @private
|
||||
*/
|
||||
this.updateWhileAnimating_ = options.updateWhileAnimating !== undefined ?
|
||||
options.updateWhileAnimating : false;
|
||||
options.updateWhileAnimating : false;
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
* @private
|
||||
*/
|
||||
/**
|
||||
* @type {boolean}
|
||||
* @private
|
||||
*/
|
||||
this.updateWhileInteracting_ = options.updateWhileInteracting !== undefined ?
|
||||
options.updateWhileInteracting : false;
|
||||
|
||||
options.updateWhileInteracting : false;
|
||||
};
|
||||
ol.inherits(ol.layer.Vector, ol.layer.Layer);
|
||||
|
||||
@@ -168,10 +161,6 @@ ol.layer.Vector.prototype.getUpdateWhileInteracting = function() {
|
||||
* Render order.
|
||||
*/
|
||||
ol.layer.Vector.prototype.setRenderOrder = function(renderOrder) {
|
||||
ol.DEBUG && console.assert(
|
||||
renderOrder === undefined || !renderOrder ||
|
||||
typeof renderOrder === 'function',
|
||||
'renderOrder must be a comparator function');
|
||||
this.set(ol.layer.Vector.Property_.RENDER_ORDER, renderOrder);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user