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

@@ -358,7 +358,7 @@ ol.format.Polyline.prototype.writeFeatureText = function(feature, opt_options) {
if (goog.isDefAndNotNull(geometry)) {
return this.writeGeometryText(geometry, opt_options);
} else {
goog.asserts.fail();
goog.asserts.fail('geometry needs to be defined');
return '';
}
};
@@ -369,7 +369,8 @@ ol.format.Polyline.prototype.writeFeatureText = function(feature, opt_options) {
*/
ol.format.Polyline.prototype.writeFeaturesText =
function(features, opt_options) {
goog.asserts.assert(features.length == 1);
goog.asserts.assert(features.length == 1,
'features array should have 1 item');
return this.writeFeatureText(features[0], opt_options);
};
@@ -391,7 +392,8 @@ ol.format.Polyline.prototype.writeGeometry;
*/
ol.format.Polyline.prototype.writeGeometryText =
function(geometry, opt_options) {
goog.asserts.assertInstanceof(geometry, ol.geom.LineString);
goog.asserts.assertInstanceof(geometry, ol.geom.LineString,
'geometry should be an ol.geom.LineString');
geometry = /** @type {ol.geom.LineString} */
(ol.format.Feature.transformWithOptions(
geometry, true, this.adaptOptions(opt_options)));