Add assert messages for all assertions up until ol.renderer.vector.

This commit is contained in:
Bart van den Eijnden
2015-03-30 16:41:32 +02:00
parent fb9ba22c30
commit 47ce127a10
74 changed files with 1173 additions and 682 deletions

View File

@@ -238,7 +238,8 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
}
cosLatitude = Math.cos(goog.math.toRadians(this.toEPSG4326_(center)[1]));
var radius = ol.sphere.NORMAL.radius;
goog.asserts.assert(goog.isDef(ol.proj.METERS_PER_UNIT[projectionUnits]));
goog.asserts.assert(goog.isDef(ol.proj.METERS_PER_UNIT[projectionUnits]),
'Meters per unit should be defined for the projection unit');
radius /= ol.proj.METERS_PER_UNIT[projectionUnits];
pointResolution *= 180 / (Math.PI * cosLatitude * radius);
projectionUnits = ol.proj.Units.DEGREES;
@@ -254,7 +255,8 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
units == ol.control.ScaleLineUnits.NAUTICAL) &&
projectionUnits == ol.proj.Units.METERS) ||
(units == ol.control.ScaleLineUnits.DEGREES &&
projectionUnits == ol.proj.Units.DEGREES));
projectionUnits == ol.proj.Units.DEGREES),
'Scale line units and projection units should match');
var nominalCount = this.minWidth_ * pointResolution;
var suffix = '';
@@ -304,7 +306,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
pointResolution /= 1609.3472;
}
} else {
goog.asserts.fail();
goog.asserts.fail('Scale line element cannot be updated');
}
var i = 3 * Math.floor(