Remove ol.DEBUG

This commit is contained in:
Tim Schaub
2016-12-29 09:09:24 -07:00
parent 7b9690a691
commit 137cdc04c8
128 changed files with 309 additions and 2027 deletions

View File

@@ -88,8 +88,6 @@ ol.inherits(ol.geom.MultiPolygon, ol.geom.SimpleGeometry);
* @api stable
*/
ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) {
ol.DEBUG && console.assert(polygon.getLayout() == this.layout,
'layout of polygon should match layout');
/** @type {Array.<number>} */
var ends;
if (!this.flatCoordinates) {
@@ -279,8 +277,6 @@ ol.geom.MultiPolygon.prototype.getSimplifiedGeometryInternal = function(squaredT
* @api stable
*/
ol.geom.MultiPolygon.prototype.getPolygon = function(index) {
ol.DEBUG && console.assert(0 <= index && index < this.endss_.length,
'index should be in between 0 and the length of this.endss_');
if (index < 0 || this.endss_.length <= index) {
return null;
}
@@ -389,15 +385,6 @@ ol.geom.MultiPolygon.prototype.setCoordinates = function(coordinates, opt_layout
* @param {Array.<Array.<number>>} endss Endss.
*/
ol.geom.MultiPolygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, endss) {
ol.DEBUG && console.assert(endss, 'endss must be truthy');
if (!flatCoordinates || flatCoordinates.length === 0) {
ol.DEBUG && console.assert(endss.length === 0, 'the length of endss should be 0');
} else {
ol.DEBUG && console.assert(endss.length > 0, 'endss cannot be an empty array');
var ends = endss[endss.length - 1];
ol.DEBUG && console.assert(flatCoordinates.length == ends[ends.length - 1],
'the length of flatCoordinates should be the last value of ends');
}
this.setFlatCoordinatesInternal(layout, flatCoordinates);
this.endss_ = endss;
this.changed();
@@ -416,10 +403,6 @@ ol.geom.MultiPolygon.prototype.setPolygons = function(polygons) {
var polygon = polygons[i];
if (i === 0) {
layout = polygon.getLayout();
} else {
// FIXME better handle the case of non-matching layouts
ol.DEBUG && console.assert(polygon.getLayout() == layout,
'layout of polygon should be layout');
}
var offset = flatCoordinates.length;
ends = polygon.getEnds();