Use goog.DEBUG instead of ol.DEBUG for now

This commit is contained in:
Andreas Hocevar
2016-08-04 09:37:42 +02:00
parent 55ab5704d4
commit e0015b3d4e
121 changed files with 712 additions and 721 deletions

View File

@@ -54,7 +54,7 @@ ol.interaction.DoubleClickZoom.handleEvent = function(mapBrowserEvent) {
var anchor = mapBrowserEvent.coordinate;
var delta = browserEvent.shiftKey ? -this.delta_ : this.delta_;
var view = map.getView();
ol.DEBUG && console.assert(view, 'map must have a view');
goog.DEBUG && console.assert(view, 'map must have a view');
ol.interaction.Interaction.zoomByDelta(
map, view, delta, anchor, this.duration_);
mapBrowserEvent.preventDefault();

View File

@@ -96,13 +96,13 @@ ol.interaction.DragAndDrop.handleStop_ = function(event) {
ol.interaction.DragAndDrop.prototype.handleResult_ = function(file, event) {
var result = event.target.result;
var map = this.getMap();
ol.DEBUG && console.assert(map, 'map must be set');
goog.DEBUG && console.assert(map, 'map must be set');
var projection = this.projection_;
if (!projection) {
var view = map.getView();
ol.DEBUG && console.assert(view, 'map must have view');
goog.DEBUG && console.assert(view, 'map must have view');
projection = view.getProjection();
ol.DEBUG && console.assert(projection !== undefined,
goog.DEBUG && console.assert(projection !== undefined,
'projection should be defined');
}
var formatConstructors = this.formatConstructors_;

View File

@@ -68,7 +68,7 @@ ol.inherits(ol.interaction.DragPan, ol.interaction.Pointer);
* @private
*/
ol.interaction.DragPan.handleDragEvent_ = function(mapBrowserEvent) {
ol.DEBUG && console.assert(this.targetPointers.length >= 1,
goog.DEBUG && console.assert(this.targetPointers.length >= 1,
'the length of this.targetPointers should be more than 1');
var centroid =
ol.interaction.Pointer.centroid(this.targetPointers);

View File

@@ -515,7 +515,7 @@ ol.interaction.Draw.prototype.startDrawing_ = function(event) {
new ol.geom.LineString(this.sketchLineCoords_));
}
var geometry = this.geometryFunction_(this.sketchCoords_);
ol.DEBUG && console.assert(geometry !== undefined, 'geometry should be defined');
goog.DEBUG && console.assert(geometry !== undefined, 'geometry should be defined');
this.sketchFeature_ = new ol.Feature();
if (this.geometryName_) {
this.sketchFeature_.setGeometryName(this.geometryName_);
@@ -551,7 +551,7 @@ ol.interaction.Draw.prototype.modifyDrawing_ = function(event) {
}
last[0] = coordinate[0];
last[1] = coordinate[1];
ol.DEBUG && console.assert(this.sketchCoords_, 'sketchCoords_ expected');
goog.DEBUG && console.assert(this.sketchCoords_, 'sketchCoords_ expected');
this.geometryFunction_(
/** @type {!ol.Coordinate|!Array.<ol.Coordinate>|!Array.<Array.<ol.Coordinate>>} */ (this.sketchCoords_),
geometry);
@@ -644,7 +644,7 @@ ol.interaction.Draw.prototype.removeLastPoint = function() {
*/
ol.interaction.Draw.prototype.finishDrawing = function() {
var sketchFeature = this.abortDrawing_();
ol.DEBUG && console.assert(sketchFeature, 'sketchFeature expected to be truthy');
goog.DEBUG && console.assert(sketchFeature, 'sketchFeature expected to be truthy');
var coordinates = this.sketchCoords_;
var geometry = /** @type {ol.geom.SimpleGeometry} */ (sketchFeature.getGeometry());
if (this.mode_ === ol.interaction.DrawMode.LINE_STRING) {
@@ -710,10 +710,10 @@ ol.interaction.Draw.prototype.abortDrawing_ = function() {
*/
ol.interaction.Draw.prototype.extend = function(feature) {
var geometry = feature.getGeometry();
ol.DEBUG && console.assert(this.mode_ == ol.interaction.DrawMode.LINE_STRING,
goog.DEBUG && console.assert(this.mode_ == ol.interaction.DrawMode.LINE_STRING,
'interaction mode must be "line"');
ol.DEBUG && console.assert(geometry, 'feature must have a geometry');
ol.DEBUG && console.assert(geometry.getType() == ol.geom.GeometryType.LINE_STRING,
goog.DEBUG && console.assert(geometry, 'feature must have a geometry');
goog.DEBUG && console.assert(geometry.getType() == ol.geom.GeometryType.LINE_STRING,
'feature geometry must be a line string');
var lineString = /** @type {ol.geom.LineString} */ (geometry);
this.sketchFeature_ = feature;

View File

@@ -87,7 +87,7 @@ ol.interaction.KeyboardPan.handleEvent = function(mapBrowserEvent) {
keyCode == ol.events.KeyCode.UP)) {
var map = mapBrowserEvent.map;
var view = map.getView();
ol.DEBUG && console.assert(view, 'map must have view');
goog.DEBUG && console.assert(view, 'map must have view');
var mapUnitsDelta = view.getResolution() * this.pixelDelta_;
var deltaX = 0, deltaY = 0;
if (keyCode == ol.events.KeyCode.DOWN) {

View File

@@ -74,7 +74,7 @@ ol.interaction.KeyboardZoom.handleEvent = function(mapBrowserEvent) {
var delta = (charCode == '+'.charCodeAt(0)) ? this.delta_ : -this.delta_;
map.render();
var view = map.getView();
ol.DEBUG && console.assert(view, 'map must have view');
goog.DEBUG && console.assert(view, 'map must have view');
ol.interaction.Interaction.zoomByDelta(
map, view, delta, undefined, this.duration_);
mapBrowserEvent.preventDefault();

View File

@@ -841,7 +841,7 @@ ol.interaction.Modify.prototype.insertVertex_ = function(segmentData, vertex) {
this.setGeometryCoordinates_(geometry, coordinates);
var rTree = this.rBush_;
ol.DEBUG && console.assert(segment !== undefined, 'segment should be defined');
goog.DEBUG && console.assert(segment !== undefined, 'segment should be defined');
rTree.remove(segmentData);
this.updateSegmentIndices_(geometry, index, depth, 1);
var newSegmentData = /** @type {ol.ModifySegmentDataType} */ ({
@@ -982,7 +982,7 @@ ol.interaction.Modify.prototype.removeVertex_ = function() {
segments.push(right.segment[1]);
}
if (left !== undefined && right !== undefined) {
ol.DEBUG && console.assert(newIndex >= 0, 'newIndex should be larger than 0');
goog.DEBUG && console.assert(newIndex >= 0, 'newIndex should be larger than 0');
var newSegmentData = /** @type {ol.ModifySegmentDataType} */ ({
depth: segmentData.depth,

View File

@@ -131,7 +131,7 @@ ol.interaction.MouseWheelZoom.prototype.doZoom_ = function(map) {
var delta = ol.math.clamp(this.delta_, -maxDelta, maxDelta);
var view = map.getView();
ol.DEBUG && console.assert(view, 'map must have view');
goog.DEBUG && console.assert(view, 'map must have view');
map.render();
ol.interaction.Interaction.zoomByDelta(map, view, -delta, this.lastAnchor_,

View File

@@ -73,7 +73,7 @@ ol.inherits(ol.interaction.PinchRotate, ol.interaction.Pointer);
* @private
*/
ol.interaction.PinchRotate.handleDragEvent_ = function(mapBrowserEvent) {
ol.DEBUG && console.assert(this.targetPointers.length >= 2,
goog.DEBUG && console.assert(this.targetPointers.length >= 2,
'length of this.targetPointers should be greater than or equal to 2');
var rotationDelta = 0.0;

View File

@@ -61,7 +61,7 @@ ol.inherits(ol.interaction.PinchZoom, ol.interaction.Pointer);
* @private
*/
ol.interaction.PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
ol.DEBUG && console.assert(this.targetPointers.length >= 2,
goog.DEBUG && console.assert(this.targetPointers.length >= 2,
'length of this.targetPointers should be 2 or more');
var scaleDelta = 1.0;