Consistently handle not implemented methods

This commit is contained in:
Guillaume Beraudo
2017-01-31 09:21:01 +01:00
parent c9d33fb03a
commit 1c353061fe
4 changed files with 21 additions and 31 deletions

View File

@@ -256,40 +256,35 @@ ol.format.MVT.readGeometry_ = function(rawFeature) {
/** /**
* Not implemented.
* @override * @override
*/ */
ol.format.MVT.prototype.readFeature = function() { ol.format.MVT.prototype.readFeature = function() {};
throw new Error('Not implemented');
};
/** /**
* Not implemented.
* @override * @override
*/ */
ol.format.MVT.prototype.readGeometry = function() { ol.format.MVT.prototype.readGeometry = function() {};
throw new Error('Not implemented');
};
/** /**
* Not implemented.
* @override * @override
*/ */
ol.format.MVT.prototype.writeFeature = function() { ol.format.MVT.prototype.writeFeature = function() {};
throw new Error('Not implemented');
};
/** /**
* Not implemented.
* @override * @override
*/ */
ol.format.MVT.prototype.writeGeometry = function() { ol.format.MVT.prototype.writeGeometry = function() {};
throw new Error('Not implemented');
};
/** /**
* Not implemented.
* @override * @override
*/ */
ol.format.MVT.prototype.writeFeatures = function() { ol.format.MVT.prototype.writeFeatures = function() {};
throw new Error('Not implemented');
};

View File

@@ -419,16 +419,14 @@ ol.format.TopoJSON.prototype.writeGeometryObject = function(geometry, opt_option
/** /**
* Not implemented.
* @override * @override
*/ */
ol.format.TopoJSON.prototype.readGeometryFromObject = function() { ol.format.TopoJSON.prototype.readGeometryFromObject = function() {};
throw new Error('Not implemented');
};
/** /**
* Not implemented.
* @override * @override
*/ */
ol.format.TopoJSON.prototype.readFeatureFromObject = function() { ol.format.TopoJSON.prototype.readFeatureFromObject = function() {};
throw new Error('Not implemented');
};

View File

@@ -7,9 +7,6 @@ goog.require('ol.format.FormatType');
goog.require('ol.xml'); goog.require('ol.xml');
/* eslint-disable valid-jsdoc */
/** /**
* @classdesc * @classdesc
* Abstract base class; normally only used for creating subclasses and not * Abstract base class; normally only used for creating subclasses and not
@@ -81,7 +78,7 @@ ol.format.XMLFeature.prototype.readFeatureFromDocument = function(
* @return {ol.Feature} Feature. * @return {ol.Feature} Feature.
*/ */
ol.format.XMLFeature.prototype.readFeatureFromNode = function(node, opt_options) { ol.format.XMLFeature.prototype.readFeatureFromNode = function(node, opt_options) {
throw new Error('Not implemented'); return null; // not implemented
}; };
@@ -158,7 +155,7 @@ ol.format.XMLFeature.prototype.readGeometry = function(source, opt_options) {
* @return {ol.geom.Geometry} Geometry. * @return {ol.geom.Geometry} Geometry.
*/ */
ol.format.XMLFeature.prototype.readGeometryFromDocument = function(doc, opt_options) { ol.format.XMLFeature.prototype.readGeometryFromDocument = function(doc, opt_options) {
throw new Error('Not implemented'); return null; // not implemented
}; };
@@ -169,7 +166,7 @@ ol.format.XMLFeature.prototype.readGeometryFromDocument = function(doc, opt_opti
* @return {ol.geom.Geometry} Geometry. * @return {ol.geom.Geometry} Geometry.
*/ */
ol.format.XMLFeature.prototype.readGeometryFromNode = function(node, opt_options) { ol.format.XMLFeature.prototype.readGeometryFromNode = function(node, opt_options) {
throw new Error('Not implemented'); return null; // not implemented
}; };
@@ -226,7 +223,7 @@ ol.format.XMLFeature.prototype.writeFeature = function(feature, opt_options) {
* @return {Node} Node. * @return {Node} Node.
*/ */
ol.format.XMLFeature.prototype.writeFeatureNode = function(feature, opt_options) { ol.format.XMLFeature.prototype.writeFeatureNode = function(feature, opt_options) {
throw new Error('Not implemented'); return null; // not implemented
}; };
@@ -245,7 +242,7 @@ ol.format.XMLFeature.prototype.writeFeatures = function(features, opt_options) {
* @return {Node} Node. * @return {Node} Node.
*/ */
ol.format.XMLFeature.prototype.writeFeaturesNode = function(features, opt_options) { ol.format.XMLFeature.prototype.writeFeaturesNode = function(features, opt_options) {
throw new Error('Not implemented'); return null; // not implemented
}; };
@@ -264,5 +261,5 @@ ol.format.XMLFeature.prototype.writeGeometry = function(geometry, opt_options) {
* @return {Node} Node. * @return {Node} Node.
*/ */
ol.format.XMLFeature.prototype.writeGeometryNode = function(geometry, opt_options) { ol.format.XMLFeature.prototype.writeGeometryNode = function(geometry, opt_options) {
throw new Error('Not implemented'); return null; // not implemented
}; };

View File

@@ -489,7 +489,7 @@ ol.inherits(ol.source.Raster.Event, ol.events.Event);
* @override * @override
*/ */
ol.source.Raster.prototype.getImageInternal = function() { ol.source.Raster.prototype.getImageInternal = function() {
throw new Error('Not implemented'); return null; // not implemented
}; };