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
-1
View File
@@ -148,7 +148,6 @@ ol.geom.flat.closest.getClosestPoint = function(flatCoordinates, offset, end,
return minSquaredDistance;
}
}
ol.DEBUG && console.assert(maxDelta > 0, 'maxDelta should be larger than 0');
var tmpPoint = opt_tmpPoint ? opt_tmpPoint : [NaN, NaN];
var index = offset + stride;
while (index < end) {
-2
View File
@@ -73,7 +73,6 @@ ol.geom.flat.contains.linearRingContainsXY = function(flatCoordinates, offset, e
* @return {boolean} Contains (x, y).
*/
ol.geom.flat.contains.linearRingsContainsXY = function(flatCoordinates, offset, ends, stride, x, y) {
ol.DEBUG && console.assert(ends.length > 0, 'ends should not be an empty array');
if (ends.length === 0) {
return false;
}
@@ -102,7 +101,6 @@ ol.geom.flat.contains.linearRingsContainsXY = function(flatCoordinates, offset,
* @return {boolean} Contains (x, y).
*/
ol.geom.flat.contains.linearRingssContainsXY = function(flatCoordinates, offset, endss, stride, x, y) {
ol.DEBUG && console.assert(endss.length > 0, 'endss should not be an empty array');
if (endss.length === 0) {
return false;
}
-4
View File
@@ -11,8 +11,6 @@ goog.require('ol');
* @return {number} offset Offset.
*/
ol.geom.flat.deflate.coordinate = function(flatCoordinates, offset, coordinate, stride) {
ol.DEBUG && console.assert(coordinate.length == stride,
'length of the coordinate array should match stride');
var i, ii;
for (i = 0, ii = coordinate.length; i < ii; ++i) {
flatCoordinates[offset++] = coordinate[i];
@@ -32,8 +30,6 @@ ol.geom.flat.deflate.coordinates = function(flatCoordinates, offset, coordinates
var i, ii;
for (i = 0, ii = coordinates.length; i < ii; ++i) {
var coordinate = coordinates[i];
ol.DEBUG && console.assert(coordinate.length == stride,
'length of coordinate array should match stride');
var j;
for (j = 0; j < stride; ++j) {
flatCoordinates[offset++] = coordinate[j];
-4
View File
@@ -65,8 +65,6 @@ ol.geom.flat.geodesic.line_ = function(interpolate, transform, squaredTolerance)
// segment.
flatCoordinates.push(b[0], b[1]);
key = fracB.toString();
ol.DEBUG && console.assert(!(key in fractions),
'fractions object should contain key : ' + key);
fractions[key] = true;
} else {
// Otherwise, we need to subdivide the current line segment. Split it
@@ -76,8 +74,6 @@ ol.geom.flat.geodesic.line_ = function(interpolate, transform, squaredTolerance)
geoStack.push(geoB, geoM, geoM, geoA);
}
}
ol.DEBUG && console.assert(maxIterations > 0,
'maxIterations should be more than 0');
return flatCoordinates;
};
-2
View File
@@ -79,8 +79,6 @@ ol.geom.flat.interiorpoint.linearRings = function(flatCoordinates, offset,
* @return {Array.<number>} Interior points.
*/
ol.geom.flat.interiorpoint.linearRingss = function(flatCoordinates, offset, endss, stride, flatCenters) {
ol.DEBUG && console.assert(2 * endss.length == flatCenters.length,
'endss.length times 2 should be flatCenters.length');
var interiorPoints = [];
var i, ii;
for (i = 0, ii = endss.length; i < ii; ++i) {
+2 -14
View File
@@ -15,16 +15,10 @@ goog.require('ol.math');
* @return {Array.<number>} Destination.
*/
ol.geom.flat.interpolate.lineString = function(flatCoordinates, offset, end, stride, fraction, opt_dest) {
// FIXME does not work when vertices are repeated
// FIXME interpolate extra dimensions
ol.DEBUG && console.assert(0 <= fraction && fraction <= 1,
'fraction should be in between 0 and 1');
var pointX = NaN;
var pointY = NaN;
var n = (end - offset) / stride;
if (n === 0) {
ol.DEBUG && console.assert(false, 'n cannot be 0');
} else if (n == 1) {
if (n === 1) {
pointX = flatCoordinates[offset];
pointY = flatCoordinates[offset + 1];
} else if (n == 2) {
@@ -32,7 +26,7 @@ ol.geom.flat.interpolate.lineString = function(flatCoordinates, offset, end, str
fraction * flatCoordinates[offset + stride];
pointY = (1 - fraction) * flatCoordinates[offset + 1] +
fraction * flatCoordinates[offset + stride + 1];
} else {
} else if (n !== 0) {
var x1 = flatCoordinates[offset];
var y1 = flatCoordinates[offset + 1];
var length = 0;
@@ -121,8 +115,6 @@ ol.geom.flat.interpolate.lineStringCoordinateAtM = function(flatCoordinates, off
return flatCoordinates.slice((lo - 1) * stride, (lo - 1) * stride + stride);
}
var m1 = flatCoordinates[(lo + 1) * stride - 1];
ol.DEBUG && console.assert(m0 < m, 'm0 should be less than m');
ol.DEBUG && console.assert(m <= m1, 'm should be less than or equal to m1');
var t = (m - m0) / (m1 - m0);
coordinate = [];
var i;
@@ -131,8 +123,6 @@ ol.geom.flat.interpolate.lineStringCoordinateAtM = function(flatCoordinates, off
flatCoordinates[lo * stride + i], t));
}
coordinate.push(m);
ol.DEBUG && console.assert(coordinate.length == stride,
'length of coordinate array should match stride');
return coordinate;
};
@@ -186,7 +176,5 @@ ol.geom.flat.interpolate.lineStringsCoordinateAtM = function(
}
offset = end;
}
ol.DEBUG && console.assert(false,
'ol.geom.flat.interpolate.lineStringsCoordinateAtM should have returned');
return null;
};
-2
View File
@@ -107,7 +107,6 @@ ol.geom.flat.intersectsextent.linearRing = function(flatCoordinates, offset, end
* @return {boolean} True if the geometry and the extent intersect.
*/
ol.geom.flat.intersectsextent.linearRings = function(flatCoordinates, offset, ends, stride, extent) {
ol.DEBUG && console.assert(ends.length > 0, 'ends should not be an empty array');
if (!ol.geom.flat.intersectsextent.linearRing(
flatCoordinates, offset, ends[0], stride, extent)) {
return false;
@@ -135,7 +134,6 @@ ol.geom.flat.intersectsextent.linearRings = function(flatCoordinates, offset, en
* @return {boolean} True if the geometry and the extent intersect.
*/
ol.geom.flat.intersectsextent.linearRingss = function(flatCoordinates, offset, endss, stride, extent) {
ol.DEBUG && console.assert(endss.length > 0, 'endss should not be an empty array');
var i, ii;
for (i = 0, ii = endss.length; i < ii; ++i) {
var ends = endss[i];