diff --git a/src/ol/format/igc.js b/src/ol/format/igc.js index 907673eb3a..6f03844c1e 100644 --- a/src/ol/format/igc.js +++ b/src/ol/format/igc.js @@ -223,3 +223,11 @@ ol.format.IGC.prototype.writeFeaturesText = function(features, opt_options) {}; * @inheritDoc */ ol.format.IGC.prototype.writeGeometryText = function(geometry, opt_options) {}; + + +/** + * @override + */ +ol.format.IGC.prototype.readGeometryFromText = function() { + throw new Error('Not implemented'); +}; diff --git a/src/ol/format/mvt.js b/src/ol/format/mvt.js index c3217627fb..64d113bbce 100644 --- a/src/ol/format/mvt.js +++ b/src/ol/format/mvt.js @@ -253,3 +253,43 @@ ol.format.MVT.readGeometry_ = function(rawFeature) { return geom; }; + + +/** + * @override + */ +ol.format.MVT.prototype.readFeature = function() { + throw new Error('Not implemented'); +}; + + +/** + * @override + */ +ol.format.MVT.prototype.readGeometry = function() { + throw new Error('Not implemented'); +}; + + +/** + * @override + */ +ol.format.MVT.prototype.writeFeature = function() { + throw new Error('Not implemented'); +}; + + +/** + * @override + */ +ol.format.MVT.prototype.writeGeometry = function() { + throw new Error('Not implemented'); +}; + + +/** + * @override + */ +ol.format.MVT.prototype.writeFeatures = function() { + throw new Error('Not implemented'); +}; diff --git a/src/ol/format/topojson.js b/src/ol/format/topojson.js index c52f2b31f7..97d23bc240 100644 --- a/src/ol/format/topojson.js +++ b/src/ol/format/topojson.js @@ -416,3 +416,19 @@ ol.format.TopoJSON.prototype.writeFeaturesObject = function(features, opt_option * @inheritDoc */ ol.format.TopoJSON.prototype.writeGeometryObject = function(geometry, opt_options) {}; + + +/** + * @override + */ +ol.format.TopoJSON.prototype.readGeometryFromObject = function() { + throw new Error('Not implemented'); +}; + + +/** + * @override + */ +ol.format.TopoJSON.prototype.readFeatureFromObject = function() { + throw new Error('Not implemented'); +}; diff --git a/src/ol/format/xmlfeature.js b/src/ol/format/xmlfeature.js index 8c02308f2d..ec57f14c3f 100644 --- a/src/ol/format/xmlfeature.js +++ b/src/ol/format/xmlfeature.js @@ -7,6 +7,9 @@ goog.require('ol.format.FormatType'); goog.require('ol.xml'); +/* eslint-disable valid-jsdoc */ + + /** * @classdesc * Abstract base class; normally only used for creating subclasses and not @@ -73,12 +76,13 @@ ol.format.XMLFeature.prototype.readFeatureFromDocument = function( /** - * @abstract * @param {Node} node Node. * @param {olx.format.ReadOptions=} opt_options Options. * @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'); +}; /** @@ -148,23 +152,25 @@ ol.format.XMLFeature.prototype.readGeometry = function(source, opt_options) { /** - * @abstract * @param {Document} doc Document. * @param {olx.format.ReadOptions=} opt_options Options. * @protected * @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'); +}; /** - * @abstract * @param {Node} node Node. * @param {olx.format.ReadOptions=} opt_options Options. * @protected * @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'); +}; /** @@ -214,13 +220,14 @@ ol.format.XMLFeature.prototype.writeFeature = function(feature, opt_options) { /** - * @abstract * @param {ol.Feature} feature Feature. * @param {olx.format.WriteOptions=} opt_options Options. * @protected * @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'); +}; /** @@ -233,12 +240,13 @@ ol.format.XMLFeature.prototype.writeFeatures = function(features, opt_options) { /** - * @abstract * @param {Array.} features Features. * @param {olx.format.WriteOptions=} opt_options Options. * @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'); +}; /** @@ -251,9 +259,10 @@ ol.format.XMLFeature.prototype.writeGeometry = function(geometry, opt_options) { /** - * @abstract * @param {ol.geom.Geometry} geometry Geometry. * @param {olx.format.WriteOptions=} opt_options Options. * @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'); +}; diff --git a/src/ol/interaction/draganddrop.js b/src/ol/interaction/draganddrop.js index f2973371b0..25dbcf771b 100644 --- a/src/ol/interaction/draganddrop.js +++ b/src/ol/interaction/draganddrop.js @@ -101,11 +101,19 @@ ol.interaction.DragAndDrop.prototype.handleResult_ = function(file, event) { var view = map.getView(); projection = view.getProjection(); } + var formatConstructors = this.formatConstructors_; var features = []; var i, ii; for (i = 0, ii = formatConstructors.length; i < ii; ++i) { + /** + * Avoid "cannot instantiate abstract class" error. + * @type {Function} + */ var formatConstructor = formatConstructors[i]; + /** + * @type {ol.format.Feature} + */ var format = new formatConstructor(); features = this.tryReadFeatures_(format, result, { featureProjection: projection diff --git a/src/ol/map.js b/src/ol/map.js index 88e2265bf4..3c235faa03 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -331,7 +331,7 @@ ol.Map = function(options) { * @type {ol.renderer.Map} * @private */ - this.renderer_ = new optionsInternal.rendererConstructor(this.viewport_, this); + this.renderer_ = new /** @type {Function} */ (optionsInternal.rendererConstructor)(this.viewport_, this); /** * @type {function(Event)|undefined} diff --git a/src/ol/render/webgl/replaygroup.js b/src/ol/render/webgl/replaygroup.js index ad5e2db400..8312118ee8 100644 --- a/src/ol/render/webgl/replaygroup.js +++ b/src/ol/render/webgl/replaygroup.js @@ -109,6 +109,9 @@ if (ol.ENABLE_WEBGL) { } var replay = replays[replayType]; if (replay === undefined) { + /** + * @type {Function} + */ var Constructor = ol.render.webgl.ReplayGroup.BATCH_CONSTRUCTORS_[replayType]; replay = new Constructor(this.tolerance_, this.maxExtent_); replays[replayType] = replay; diff --git a/src/ol/source/raster.js b/src/ol/source/raster.js index 0ef86ebe39..0d6e95ca5f 100644 --- a/src/ol/source/raster.js +++ b/src/ol/source/raster.js @@ -485,6 +485,14 @@ ol.source.Raster.Event = function(type, frameState, data) { ol.inherits(ol.source.Raster.Event, ol.events.Event); +/** + * @override + */ +ol.source.Raster.prototype.getImageInternal = function() { + throw new Error('Not implemented'); +}; + + /** * @enum {string} * @private