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
+8 -4
View File
@@ -80,7 +80,8 @@ ol.FeatureOverlay = function(opt_options) {
if (goog.isArray(options.features)) {
this.setFeatures(new ol.Collection(options.features.slice()));
} else {
goog.asserts.assertInstanceof(options.features, ol.Collection);
goog.asserts.assertInstanceof(options.features, ol.Collection,
'options.features should be an ol.Collection');
this.setFeatures(options.features);
}
} else {
@@ -134,7 +135,8 @@ ol.FeatureOverlay.prototype.handleFeatureChange_ = function() {
* @param {ol.CollectionEvent} collectionEvent Collection event.
*/
ol.FeatureOverlay.prototype.handleFeaturesAdd_ = function(collectionEvent) {
goog.asserts.assert(!goog.isNull(this.featureChangeListenerKeys_));
goog.asserts.assert(!goog.isNull(this.featureChangeListenerKeys_),
'this.featureChangeListenerKeys_ should not be null');
var feature = /** @type {ol.Feature} */ (collectionEvent.element);
this.featureChangeListenerKeys_[goog.getUid(feature).toString()] =
goog.events.listen(feature, goog.events.EventType.CHANGE,
@@ -148,7 +150,8 @@ ol.FeatureOverlay.prototype.handleFeaturesAdd_ = function(collectionEvent) {
* @param {ol.CollectionEvent} collectionEvent Collection event.
*/
ol.FeatureOverlay.prototype.handleFeaturesRemove_ = function(collectionEvent) {
goog.asserts.assert(!goog.isNull(this.featureChangeListenerKeys_));
goog.asserts.assert(!goog.isNull(this.featureChangeListenerKeys_),
'this.featureChangeListenerKeys_ should not be null');
var feature = /** @type {ol.Feature} */ (collectionEvent.element);
var key = goog.getUid(feature).toString();
goog.events.unlistenByKey(this.featureChangeListenerKeys_[key]);
@@ -181,7 +184,8 @@ ol.FeatureOverlay.prototype.handleMapPostCompose_ = function(event) {
}
var replayGroup = /** @type {ol.render.IReplayGroup} */
(event.replayGroup);
goog.asserts.assert(goog.isDef(replayGroup));
goog.asserts.assert(goog.isDef(replayGroup),
'replayGroup should be defined');
var frameState = event.frameState;
var pixelRatio = frameState.pixelRatio;
var resolution = frameState.viewState.resolution;