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

@@ -35,7 +35,8 @@ goog.inherits(ol.geom.MultiPoint, ol.geom.SimpleGeometry);
* @api stable
*/
ol.geom.MultiPoint.prototype.appendPoint = function(point) {
goog.asserts.assert(point.getLayout() == this.layout);
goog.asserts.assert(point.getLayout() == this.layout,
'the layout of point should match layout');
if (goog.isNull(this.flatCoordinates)) {
this.flatCoordinates = point.getFlatCoordinates().slice();
} else {
@@ -102,7 +103,8 @@ ol.geom.MultiPoint.prototype.getCoordinates = function() {
ol.geom.MultiPoint.prototype.getPoint = function(index) {
var n = goog.isNull(this.flatCoordinates) ?
0 : this.flatCoordinates.length / this.stride;
goog.asserts.assert(0 <= index && index < n);
goog.asserts.assert(0 <= index && index < n,
'index should be in between 0 and n');
if (index < 0 || n <= index) {
return null;
}