From a8cade7cf8b5b8b0f0d0f42583aa11e8139732a0 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Fri, 16 Dec 2016 15:12:40 +0100 Subject: [PATCH 01/23] Add ol.source.TileDebug.Tile_#load function --- src/ol/source/tiledebug.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ol/source/tiledebug.js b/src/ol/source/tiledebug.js index a62d962da0..4325f16124 100644 --- a/src/ol/source/tiledebug.js +++ b/src/ol/source/tiledebug.js @@ -112,3 +112,9 @@ ol.source.TileDebug.Tile_.prototype.getImage = function() { return context.canvas; } }; + + +/** + * @override + */ +ol.source.TileDebug.Tile_.prototype.load = function() {}; From 2e635907912c5fb442a533d731a6a05da89daef3 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Fri, 16 Dec 2016 15:13:56 +0100 Subject: [PATCH 02/23] Don't use ol.nullFunction in ol.style.RegularShape The closure compiler doesn't recognize this as an implementation of an abstract function. --- src/ol/style/regularshape.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ol/style/regularshape.js b/src/ol/style/regularshape.js index e84815c68e..0303dc86a4 100644 --- a/src/ol/style/regularshape.js +++ b/src/ol/style/regularshape.js @@ -293,19 +293,19 @@ ol.style.RegularShape.prototype.getStroke = function() { /** * @inheritDoc */ -ol.style.RegularShape.prototype.listenImageChange = ol.nullFunction; +ol.style.RegularShape.prototype.listenImageChange = function(listener, thisArg) {}; /** * @inheritDoc */ -ol.style.RegularShape.prototype.load = ol.nullFunction; +ol.style.RegularShape.prototype.load = function() {}; /** * @inheritDoc */ -ol.style.RegularShape.prototype.unlistenImageChange = ol.nullFunction; +ol.style.RegularShape.prototype.unlistenImageChange = function(listener, thisArg) {}; /** From 546fc97cd441674949d9bcb0531e4d260e6105cc Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Fri, 16 Dec 2016 15:42:53 +0100 Subject: [PATCH 03/23] Add abstract tag at class level --- src/ol/format/feature.js | 1 + src/ol/format/gmlbase.js | 1 + src/ol/format/jsonfeature.js | 1 + src/ol/format/textfeature.js | 1 + src/ol/format/xml.js | 1 + src/ol/format/xmlfeature.js | 1 + src/ol/geom/geometry.js | 1 + src/ol/geom/simplegeometry.js | 1 + src/ol/imagebase.js | 1 + src/ol/layer/base.js | 1 + src/ol/layer/layer.js | 1 + src/ol/render/replaygroup.js | 1 + src/ol/render/vectorcontext.js | 1 + src/ol/render/webgl/replay.js | 1 + src/ol/render/webgl/textreplay.js | 1 + src/ol/renderer/canvas/intermediatecanvas.js | 1 + src/ol/renderer/canvas/layer.js | 1 + src/ol/renderer/map.js | 1 + src/ol/renderer/webgl/layer.js | 1 + src/ol/source/image.js | 1 + src/ol/source/source.js | 1 + src/ol/source/tile.js | 1 + src/ol/source/urltile.js | 1 + src/ol/style/image.js | 1 + src/ol/tile.js | 1 + src/ol/webgl/shader.js | 1 + 26 files changed, 26 insertions(+) diff --git a/src/ol/format/feature.js b/src/ol/format/feature.js index 6a4f30b2c9..770da1dcc3 100644 --- a/src/ol/format/feature.js +++ b/src/ol/format/feature.js @@ -15,6 +15,7 @@ goog.require('ol.proj'); * file formats. See the documentation for each format for more details. * * @constructor + * @abstract * @api stable */ ol.format.Feature = function() { diff --git a/src/ol/format/gmlbase.js b/src/ol/format/gmlbase.js index ef90cc412e..257122155c 100644 --- a/src/ol/format/gmlbase.js +++ b/src/ol/format/gmlbase.js @@ -31,6 +31,7 @@ goog.require('ol.xml'); * ol.format.GML3. * * @constructor + * @abstract * @param {olx.format.GMLOptions=} opt_options * Optional configuration object. * @extends {ol.format.XMLFeature} diff --git a/src/ol/format/jsonfeature.js b/src/ol/format/jsonfeature.js index 7439c08e6b..95ec963001 100644 --- a/src/ol/format/jsonfeature.js +++ b/src/ol/format/jsonfeature.js @@ -12,6 +12,7 @@ goog.require('ol.format.FormatType'); * Base class for JSON feature formats. * * @constructor + * @abstract * @extends {ol.format.Feature} */ ol.format.JSONFeature = function() { diff --git a/src/ol/format/textfeature.js b/src/ol/format/textfeature.js index 1bfb0f3676..3651d25b26 100644 --- a/src/ol/format/textfeature.js +++ b/src/ol/format/textfeature.js @@ -12,6 +12,7 @@ goog.require('ol.format.FormatType'); * Base class for text feature formats. * * @constructor + * @abstract * @extends {ol.format.Feature} */ ol.format.TextFeature = function() { diff --git a/src/ol/format/xml.js b/src/ol/format/xml.js index dd814078c2..9fa5eef5e8 100644 --- a/src/ol/format/xml.js +++ b/src/ol/format/xml.js @@ -8,6 +8,7 @@ goog.require('ol.xml'); * Generic format for reading non-feature XML data * * @constructor + * @abstract * @struct */ ol.format.XML = function() { diff --git a/src/ol/format/xmlfeature.js b/src/ol/format/xmlfeature.js index ce4c7a3f62..8c02308f2d 100644 --- a/src/ol/format/xmlfeature.js +++ b/src/ol/format/xmlfeature.js @@ -14,6 +14,7 @@ goog.require('ol.xml'); * Base class for XML feature formats. * * @constructor + * @abstract * @extends {ol.format.Feature} */ ol.format.XMLFeature = function() { diff --git a/src/ol/geom/geometry.js b/src/ol/geom/geometry.js index 86fedac283..47715d79fd 100644 --- a/src/ol/geom/geometry.js +++ b/src/ol/geom/geometry.js @@ -17,6 +17,7 @@ goog.require('ol.proj'); * generic `change` event on your geometry instance. * * @constructor + * @abstract * @extends {ol.Object} * @api stable */ diff --git a/src/ol/geom/simplegeometry.js b/src/ol/geom/simplegeometry.js index 478cd23432..87bb61fcca 100644 --- a/src/ol/geom/simplegeometry.js +++ b/src/ol/geom/simplegeometry.js @@ -15,6 +15,7 @@ goog.require('ol.obj'); * in apps, as cannot be rendered. * * @constructor + * @abstract * @extends {ol.geom.Geometry} * @api stable */ diff --git a/src/ol/imagebase.js b/src/ol/imagebase.js index 9351ab7274..f69507467b 100644 --- a/src/ol/imagebase.js +++ b/src/ol/imagebase.js @@ -7,6 +7,7 @@ goog.require('ol.events.EventType'); /** * @constructor + * @abstract * @extends {ol.events.EventTarget} * @param {ol.Extent} extent Extent. * @param {number|undefined} resolution Resolution. diff --git a/src/ol/layer/base.js b/src/ol/layer/base.js index b16210563c..a5c5dc9fd7 100644 --- a/src/ol/layer/base.js +++ b/src/ol/layer/base.js @@ -16,6 +16,7 @@ goog.require('ol.obj'); * is observable, and has get/set accessors. * * @constructor + * @abstract * @extends {ol.Object} * @param {olx.layer.BaseOptions} options Layer options. * @api stable diff --git a/src/ol/layer/layer.js b/src/ol/layer/layer.js index 05cb5cdb8a..09886207bb 100644 --- a/src/ol/layer/layer.js +++ b/src/ol/layer/layer.js @@ -27,6 +27,7 @@ goog.require('ol.source.State'); * A generic `change` event is fired when the state of the source changes. * * @constructor + * @abstract * @extends {ol.layer.Base} * @fires ol.render.Event * @param {olx.layer.LayerOptions} options Layer options. diff --git a/src/ol/render/replaygroup.js b/src/ol/render/replaygroup.js index 6f7b286021..46a6a9b9a6 100644 --- a/src/ol/render/replaygroup.js +++ b/src/ol/render/replaygroup.js @@ -4,6 +4,7 @@ goog.provide('ol.render.ReplayGroup'); /** * Base class for replay groups. * @constructor + * @abstract */ ol.render.ReplayGroup = function() {}; diff --git a/src/ol/render/vectorcontext.js b/src/ol/render/vectorcontext.js index 26b8fad6ce..9e76c6ba33 100644 --- a/src/ol/render/vectorcontext.js +++ b/src/ol/render/vectorcontext.js @@ -5,6 +5,7 @@ goog.provide('ol.render.VectorContext'); * Context for drawing geometries. A vector context is available on render * events and does not need to be constructed directly. * @constructor + * @abstract * @struct * @api */ diff --git a/src/ol/render/webgl/replay.js b/src/ol/render/webgl/replay.js index 5de048d50e..9e36d9a87b 100644 --- a/src/ol/render/webgl/replay.js +++ b/src/ol/render/webgl/replay.js @@ -12,6 +12,7 @@ if (ol.ENABLE_WEBGL) { /** * @constructor + * @abstract * @extends {ol.render.VectorContext} * @param {number} tolerance Tolerance. * @param {ol.Extent} maxExtent Max extent. diff --git a/src/ol/render/webgl/textreplay.js b/src/ol/render/webgl/textreplay.js index 733e620567..429b03a923 100644 --- a/src/ol/render/webgl/textreplay.js +++ b/src/ol/render/webgl/textreplay.js @@ -7,6 +7,7 @@ if (ol.ENABLE_WEBGL) { /** * @constructor + * @abstract * @param {number} tolerance Tolerance. * @param {ol.Extent} maxExtent Max extent. * @struct diff --git a/src/ol/renderer/canvas/intermediatecanvas.js b/src/ol/renderer/canvas/intermediatecanvas.js index fe915771ab..534af2d453 100644 --- a/src/ol/renderer/canvas/intermediatecanvas.js +++ b/src/ol/renderer/canvas/intermediatecanvas.js @@ -9,6 +9,7 @@ goog.require('ol.transform'); /** * @constructor + * @abstract * @extends {ol.renderer.canvas.Layer} * @param {ol.layer.Layer} layer Layer. */ diff --git a/src/ol/renderer/canvas/layer.js b/src/ol/renderer/canvas/layer.js index fecbb784f1..7ff2f07e65 100644 --- a/src/ol/renderer/canvas/layer.js +++ b/src/ol/renderer/canvas/layer.js @@ -13,6 +13,7 @@ goog.require('ol.transform'); /** * @constructor + * @abstract * @extends {ol.renderer.Layer} * @param {ol.layer.Layer} layer Layer. */ diff --git a/src/ol/renderer/map.js b/src/ol/renderer/map.js index a136ab52af..6a3373334e 100644 --- a/src/ol/renderer/map.js +++ b/src/ol/renderer/map.js @@ -13,6 +13,7 @@ goog.require('ol.transform'); /** * @constructor + * @abstract * @extends {ol.Disposable} * @param {Element} container Container. * @param {ol.Map} map Map. diff --git a/src/ol/renderer/webgl/layer.js b/src/ol/renderer/webgl/layer.js index 40bf6fd2a6..80bd79d7e7 100644 --- a/src/ol/renderer/webgl/layer.js +++ b/src/ol/renderer/webgl/layer.js @@ -17,6 +17,7 @@ if (ol.ENABLE_WEBGL) { /** * @constructor + * @abstract * @extends {ol.renderer.Layer} * @param {ol.renderer.webgl.Map} mapRenderer Map renderer. * @param {ol.layer.Layer} layer Layer. diff --git a/src/ol/source/image.js b/src/ol/source/image.js index e9e2383844..8712cb42db 100644 --- a/src/ol/source/image.js +++ b/src/ol/source/image.js @@ -17,6 +17,7 @@ goog.require('ol.source.Source'); * Base class for sources providing a single image. * * @constructor + * @abstract * @extends {ol.source.Source} * @param {ol.SourceImageOptions} options Single image source options. * @api diff --git a/src/ol/source/source.js b/src/ol/source/source.js index 596794566c..b5f355d687 100644 --- a/src/ol/source/source.js +++ b/src/ol/source/source.js @@ -16,6 +16,7 @@ goog.require('ol.source.State'); * A generic `change` event is triggered when the state of the source changes. * * @constructor + * @abstract * @extends {ol.Object} * @param {ol.SourceSourceOptions} options Source options. * @api stable diff --git a/src/ol/source/tile.js b/src/ol/source/tile.js index 3873841270..32f9e6c8bb 100644 --- a/src/ol/source/tile.js +++ b/src/ol/source/tile.js @@ -18,6 +18,7 @@ goog.require('ol.tilegrid'); * Base class for sources providing images divided into a tile grid. * * @constructor + * @abstract * @extends {ol.source.Source} * @param {ol.SourceTileOptions} options Tile source options. * @api diff --git a/src/ol/source/urltile.js b/src/ol/source/urltile.js index 56768d6868..4cd74e521f 100644 --- a/src/ol/source/urltile.js +++ b/src/ol/source/urltile.js @@ -12,6 +12,7 @@ goog.require('ol.source.TileEventType'); * Base class for sources providing tiles divided into a tile grid over http. * * @constructor + * @abstract * @fires ol.source.Tile.Event * @extends {ol.source.Tile} * @param {ol.SourceUrlTileOptions} options Image tile options. diff --git a/src/ol/style/image.js b/src/ol/style/image.js index 894a88f960..9ba000d07e 100644 --- a/src/ol/style/image.js +++ b/src/ol/style/image.js @@ -8,6 +8,7 @@ goog.provide('ol.style.Image'); * {@link ol.style.RegularShape}. * * @constructor + * @abstract * @param {ol.StyleImageOptions} options Options. * @api */ diff --git a/src/ol/tile.js b/src/ol/tile.js index 33960638fd..c329c33017 100644 --- a/src/ol/tile.js +++ b/src/ol/tile.js @@ -11,6 +11,7 @@ goog.require('ol.events.EventType'); * Base class for tiles. * * @constructor + * @abstract * @extends {ol.events.EventTarget} * @param {ol.TileCoord} tileCoord Tile coordinate. * @param {ol.TileState} state State. diff --git a/src/ol/webgl/shader.js b/src/ol/webgl/shader.js index da3ebcdc8a..7daf7ae4f8 100644 --- a/src/ol/webgl/shader.js +++ b/src/ol/webgl/shader.js @@ -8,6 +8,7 @@ if (ol.ENABLE_WEBGL) { /** * @constructor + * @abstract * @param {string} source Source. * @struct */ From d59224f5eb718c68a7bcc31f4aa8dcf9aac00caf Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Fri, 16 Dec 2016 15:49:53 +0100 Subject: [PATCH 04/23] Add missing override and inheritDoc jsdoc tags --- src/ol/control/control.js | 1 + src/ol/events/event.js | 2 ++ src/ol/format/esrijson.js | 3 +++ src/ol/format/geojson.js | 4 ++++ src/ol/format/gml3.js | 2 ++ src/ol/format/gpx.js | 1 + src/ol/format/kml.js | 1 + src/ol/format/ows.js | 6 ++---- src/ol/format/topojson.js | 2 +- src/ol/format/wmscapabilities.js | 6 ++---- src/ol/format/wmtscapabilities.js | 6 ++---- src/ol/geom/circle.js | 1 + src/ol/geom/geometrycollection.js | 2 ++ src/ol/geom/linearring.js | 3 +++ src/ol/geom/linestring.js | 3 +++ src/ol/geom/multilinestring.js | 3 +++ src/ol/geom/multipoint.js | 3 +++ src/ol/geom/multipolygon.js | 3 +++ src/ol/geom/point.js | 6 +++--- src/ol/geom/polygon.js | 3 +++ src/ol/image.js | 5 ++--- src/ol/imagecanvas.js | 2 +- src/ol/imagetile.js | 4 +--- src/ol/interaction/select.js | 1 + src/ol/render/canvas/immediate.js | 14 ++++++++++++++ src/ol/render/vectorcontext.js | 2 +- src/ol/render/webgl/immediate.js | 2 ++ src/ol/renderer/webgl/tilelayer.js | 10 +--------- src/ol/source/image.js | 1 + src/ol/source/tiledebug.js | 1 + src/ol/source/tileutfgrid.js | 3 ++- src/ol/style/circle.js | 1 + src/ol/style/icon.js | 5 +++-- src/ol/vectortile.js | 2 +- 34 files changed, 77 insertions(+), 37 deletions(-) diff --git a/src/ol/control/control.js b/src/ol/control/control.js index eaaefbfc7f..8f7ffb176b 100644 --- a/src/ol/control/control.js +++ b/src/ol/control/control.js @@ -101,6 +101,7 @@ ol.control.Control.prototype.getMap = function() { * Subclasses may set up event handlers to get notified about changes to * the map here. * @param {ol.Map} map Map. + * @override * @api stable */ ol.control.Control.prototype.setMap = function(map) { diff --git a/src/ol/events/event.js b/src/ol/events/event.js index 90301d236b..6b571364f9 100644 --- a/src/ol/events/event.js +++ b/src/ol/events/event.js @@ -42,6 +42,7 @@ ol.events.Event = function(type) { /** * Stop event propagation. * @function + * @override * @api stable */ ol.events.Event.prototype.preventDefault = @@ -49,6 +50,7 @@ ol.events.Event.prototype.preventDefault = /** * Stop event propagation. * @function + * @override * @api stable */ ol.events.Event.prototype.stopPropagation = function() { diff --git a/src/ol/format/esrijson.js b/src/ol/format/esrijson.js index a304cacec9..ce0e5e6d1a 100644 --- a/src/ol/format/esrijson.js +++ b/src/ol/format/esrijson.js @@ -582,6 +582,7 @@ ol.format.EsriJSON.prototype.writeGeometry; * @param {ol.geom.Geometry} geometry Geometry. * @param {olx.format.WriteOptions=} opt_options Write options. * @return {EsriJSONGeometry} Object. + * @override * @api */ ol.format.EsriJSON.prototype.writeGeometryObject = function(geometry, @@ -609,6 +610,7 @@ ol.format.EsriJSON.prototype.writeFeature; * @param {ol.Feature} feature Feature. * @param {olx.format.WriteOptions=} opt_options Write options. * @return {Object} Object. + * @override * @api */ ol.format.EsriJSON.prototype.writeFeatureObject = function( @@ -655,6 +657,7 @@ ol.format.EsriJSON.prototype.writeFeatures; * @param {Array.} features Features. * @param {olx.format.WriteOptions=} opt_options Write options. * @return {Object} EsriJSON Object. + * @override * @api */ ol.format.EsriJSON.prototype.writeFeaturesObject = function(features, opt_options) { diff --git a/src/ol/format/geojson.js b/src/ol/format/geojson.js index f93175eb6d..172814154b 100644 --- a/src/ol/format/geojson.js +++ b/src/ol/format/geojson.js @@ -479,6 +479,7 @@ ol.format.GeoJSON.prototype.readProjectionFromObject = function(object) { * @param {ol.Feature} feature Feature. * @param {olx.format.WriteOptions=} opt_options Write options. * @return {string} GeoJSON. + * @override * @api stable */ ol.format.GeoJSON.prototype.writeFeature; @@ -490,6 +491,7 @@ ol.format.GeoJSON.prototype.writeFeature; * @param {ol.Feature} feature Feature. * @param {olx.format.WriteOptions=} opt_options Write options. * @return {GeoJSONFeature} Object. + * @override * @api stable */ ol.format.GeoJSON.prototype.writeFeatureObject = function(feature, opt_options) { @@ -538,6 +540,7 @@ ol.format.GeoJSON.prototype.writeFeatures; * @param {Array.} features Features. * @param {olx.format.WriteOptions=} opt_options Write options. * @return {GeoJSONFeatureCollection} GeoJSON Object. + * @override * @api stable */ ol.format.GeoJSON.prototype.writeFeaturesObject = function(features, opt_options) { @@ -572,6 +575,7 @@ ol.format.GeoJSON.prototype.writeGeometry; * @param {ol.geom.Geometry} geometry Geometry. * @param {olx.format.WriteOptions=} opt_options Write options. * @return {GeoJSONGeometry|GeoJSONGeometryCollection} Object. + * @override * @api stable */ ol.format.GeoJSON.prototype.writeGeometryObject = function(geometry, diff --git a/src/ol/format/gml3.js b/src/ol/format/gml3.js index 01e745d6c8..531ef3fccf 100644 --- a/src/ol/format/gml3.js +++ b/src/ol/format/gml3.js @@ -1162,6 +1162,7 @@ ol.format.GML3.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, o * @param {ol.geom.Geometry} geometry Geometry. * @param {olx.format.WriteOptions=} opt_options Options. * @return {Node} Node. + * @override * @api */ ol.format.GML3.prototype.writeGeometryNode = function(geometry, opt_options) { @@ -1196,6 +1197,7 @@ ol.format.GML3.prototype.writeFeatures; * @param {Array.} features Features. * @param {olx.format.WriteOptions=} opt_options Options. * @return {Node} Node. + * @override * @api */ ol.format.GML3.prototype.writeFeaturesNode = function(features, opt_options) { diff --git a/src/ol/format/gpx.js b/src/ol/format/gpx.js index b7b1340607..cbca26a1b4 100644 --- a/src/ol/format/gpx.js +++ b/src/ol/format/gpx.js @@ -926,6 +926,7 @@ ol.format.GPX.prototype.writeFeatures; * @param {Array.} features Features. * @param {olx.format.WriteOptions=} opt_options Options. * @return {Node} Node. + * @override * @api */ ol.format.GPX.prototype.writeFeaturesNode = function(features, opt_options) { diff --git a/src/ol/format/kml.js b/src/ol/format/kml.js index 49583d6075..3107de95e8 100644 --- a/src/ol/format/kml.js +++ b/src/ol/format/kml.js @@ -3018,6 +3018,7 @@ ol.format.KML.prototype.writeFeatures; * @param {Array.} features Features. * @param {olx.format.WriteOptions=} opt_options Options. * @return {Node} Node. + * @override * @api */ ol.format.KML.prototype.writeFeaturesNode = function(features, opt_options) { diff --git a/src/ol/format/ows.js b/src/ol/format/ows.js index 3f9b079df3..3ed2be4e83 100644 --- a/src/ol/format/ows.js +++ b/src/ol/format/ows.js @@ -18,8 +18,7 @@ ol.inherits(ol.format.OWS, ol.format.XML); /** - * @param {Document} doc Document. - * @return {Object} OWS object. + * @inheritDoc */ ol.format.OWS.prototype.readFromDocument = function(doc) { for (var n = doc.firstChild; n; n = n.nextSibling) { @@ -32,8 +31,7 @@ ol.format.OWS.prototype.readFromDocument = function(doc) { /** - * @param {Node} node Node. - * @return {Object} OWS object. + * @inheritDoc */ ol.format.OWS.prototype.readFromNode = function(node) { var owsObject = ol.xml.pushParseAndPop({}, diff --git a/src/ol/format/topojson.js b/src/ol/format/topojson.js index c0c4a5b263..c7244dd5f4 100644 --- a/src/ol/format/topojson.js +++ b/src/ol/format/topojson.js @@ -366,9 +366,9 @@ ol.format.TopoJSON.transformVertex_ = function(vertex, scale, translate) { /** * Read the projection from a TopoJSON source. * - * @function * @param {Document|Node|Object|string} object Source. * @return {ol.proj.Projection} Projection. + * @override * @api stable */ ol.format.TopoJSON.prototype.readProjection = function(object) { diff --git a/src/ol/format/wmscapabilities.js b/src/ol/format/wmscapabilities.js index 5f39a3861b..e7607ee62f 100644 --- a/src/ol/format/wmscapabilities.js +++ b/src/ol/format/wmscapabilities.js @@ -39,8 +39,7 @@ ol.format.WMSCapabilities.prototype.read; /** - * @param {Document} doc Document. - * @return {Object} WMS Capability object. + * @inheritDoc */ ol.format.WMSCapabilities.prototype.readFromDocument = function(doc) { for (var n = doc.firstChild; n; n = n.nextSibling) { @@ -53,8 +52,7 @@ ol.format.WMSCapabilities.prototype.readFromDocument = function(doc) { /** - * @param {Node} node Node. - * @return {Object} WMS Capability object. + * @inheritDoc */ ol.format.WMSCapabilities.prototype.readFromNode = function(node) { this.version = node.getAttribute('version').trim(); diff --git a/src/ol/format/wmtscapabilities.js b/src/ol/format/wmtscapabilities.js index 12fb18f611..02d2c32fda 100644 --- a/src/ol/format/wmtscapabilities.js +++ b/src/ol/format/wmtscapabilities.js @@ -41,8 +41,7 @@ ol.format.WMTSCapabilities.prototype.read; /** - * @param {Document} doc Document. - * @return {Object} WMTS Capability object. + * @inheritDoc */ ol.format.WMTSCapabilities.prototype.readFromDocument = function(doc) { for (var n = doc.firstChild; n; n = n.nextSibling) { @@ -55,8 +54,7 @@ ol.format.WMTSCapabilities.prototype.readFromDocument = function(doc) { /** - * @param {Node} node Node. - * @return {Object} WMTS Capability object. + * @inheritDoc */ ol.format.WMTSCapabilities.prototype.readFromNode = function(node) { var version = node.getAttribute('version').trim(); diff --git a/src/ol/geom/circle.js b/src/ol/geom/circle.js index f199cc9018..75c73dbb69 100644 --- a/src/ol/geom/circle.js +++ b/src/ol/geom/circle.js @@ -30,6 +30,7 @@ ol.inherits(ol.geom.Circle, ol.geom.SimpleGeometry); /** * Make a complete copy of the geometry. * @return {!ol.geom.Circle} Clone. + * @override * @api */ ol.geom.Circle.prototype.clone = function() { diff --git a/src/ol/geom/geometrycollection.js b/src/ol/geom/geometrycollection.js index c43a40d08d..23f960ab54 100644 --- a/src/ol/geom/geometrycollection.js +++ b/src/ol/geom/geometrycollection.js @@ -83,6 +83,7 @@ ol.geom.GeometryCollection.prototype.listenGeometriesChange_ = function() { /** * Make a complete copy of the geometry. * @return {!ol.geom.GeometryCollection} Clone. + * @override * @api stable */ ol.geom.GeometryCollection.prototype.clone = function() { @@ -302,6 +303,7 @@ ol.geom.GeometryCollection.prototype.applyTransform = function(transformFn) { * Translate the geometry. * @param {number} deltaX Delta X. * @param {number} deltaY Delta Y. + * @override * @api */ ol.geom.GeometryCollection.prototype.translate = function(deltaX, deltaY) { diff --git a/src/ol/geom/linearring.js b/src/ol/geom/linearring.js index a4ebdf1559..419c2eb8d0 100644 --- a/src/ol/geom/linearring.js +++ b/src/ol/geom/linearring.js @@ -48,6 +48,7 @@ ol.inherits(ol.geom.LinearRing, ol.geom.SimpleGeometry); /** * Make a complete copy of the geometry. * @return {!ol.geom.LinearRing} Clone. + * @override * @api stable */ ol.geom.LinearRing.prototype.clone = function() { @@ -90,6 +91,7 @@ ol.geom.LinearRing.prototype.getArea = function() { /** * Return the coordinates of the linear ring. * @return {Array.} Coordinates. + * @override * @api stable */ ol.geom.LinearRing.prototype.getCoordinates = function() { @@ -126,6 +128,7 @@ ol.geom.LinearRing.prototype.getType = function() { * Set the coordinates of the linear ring. * @param {Array.} coordinates Coordinates. * @param {ol.geom.GeometryLayout=} opt_layout Layout. + * @override * @api stable */ ol.geom.LinearRing.prototype.setCoordinates = function(coordinates, opt_layout) { diff --git a/src/ol/geom/linestring.js b/src/ol/geom/linestring.js index dff2d47d6d..dd13803d5d 100644 --- a/src/ol/geom/linestring.js +++ b/src/ol/geom/linestring.js @@ -78,6 +78,7 @@ ol.geom.LineString.prototype.appendCoordinate = function(coordinate) { /** * Make a complete copy of the geometry. * @return {!ol.geom.LineString} Clone. + * @override * @api stable */ ol.geom.LineString.prototype.clone = function() { @@ -153,6 +154,7 @@ ol.geom.LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) { /** * Return the coordinates of the linestring. * @return {Array.} Coordinates. + * @override * @api stable */ ol.geom.LineString.prototype.getCoordinates = function() { @@ -240,6 +242,7 @@ ol.geom.LineString.prototype.intersectsExtent = function(extent) { * Set the coordinates of the linestring. * @param {Array.} coordinates Coordinates. * @param {ol.geom.GeometryLayout=} opt_layout Layout. + * @override * @api stable */ ol.geom.LineString.prototype.setCoordinates = function(coordinates, opt_layout) { diff --git a/src/ol/geom/multilinestring.js b/src/ol/geom/multilinestring.js index 14377c9255..c5d15bb9f1 100644 --- a/src/ol/geom/multilinestring.js +++ b/src/ol/geom/multilinestring.js @@ -73,6 +73,7 @@ ol.geom.MultiLineString.prototype.appendLineString = function(lineString) { /** * Make a complete copy of the geometry. * @return {!ol.geom.MultiLineString} Clone. + * @override * @api stable */ ol.geom.MultiLineString.prototype.clone = function() { @@ -140,6 +141,7 @@ ol.geom.MultiLineString.prototype.getCoordinateAtM = function(m, opt_extrapolate /** * Return the coordinates of the multilinestring. * @return {Array.>} Coordinates. + * @override * @api stable */ ol.geom.MultiLineString.prototype.getCoordinates = function() { @@ -257,6 +259,7 @@ ol.geom.MultiLineString.prototype.intersectsExtent = function(extent) { * Set the coordinates of the multilinestring. * @param {Array.>} coordinates Coordinates. * @param {ol.geom.GeometryLayout=} opt_layout Layout. + * @override * @api stable */ ol.geom.MultiLineString.prototype.setCoordinates = function(coordinates, opt_layout) { diff --git a/src/ol/geom/multipoint.js b/src/ol/geom/multipoint.js index 35f67bf8bb..8a8c3d3c80 100644 --- a/src/ol/geom/multipoint.js +++ b/src/ol/geom/multipoint.js @@ -47,6 +47,7 @@ ol.geom.MultiPoint.prototype.appendPoint = function(point) { /** * Make a complete copy of the geometry. * @return {!ol.geom.MultiPoint} Clone. + * @override * @api stable */ ol.geom.MultiPoint.prototype.clone = function() { @@ -85,6 +86,7 @@ ol.geom.MultiPoint.prototype.closestPointXY = function(x, y, closestPoint, minSq /** * Return the coordinates of the multipoint. * @return {Array.} Coordinates. + * @override * @api stable */ ol.geom.MultiPoint.prototype.getCoordinates = function() { @@ -165,6 +167,7 @@ ol.geom.MultiPoint.prototype.intersectsExtent = function(extent) { * Set the coordinates of the multipoint. * @param {Array.} coordinates Coordinates. * @param {ol.geom.GeometryLayout=} opt_layout Layout. + * @override * @api stable */ ol.geom.MultiPoint.prototype.setCoordinates = function(coordinates, opt_layout) { diff --git a/src/ol/geom/multipolygon.js b/src/ol/geom/multipolygon.js index e7b2b5cf44..2f1a0fc4e7 100644 --- a/src/ol/geom/multipolygon.js +++ b/src/ol/geom/multipolygon.js @@ -111,6 +111,7 @@ ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) { /** * Make a complete copy of the geometry. * @return {!ol.geom.MultiPolygon} Clone. + * @override * @api stable */ ol.geom.MultiPolygon.prototype.clone = function() { @@ -178,6 +179,7 @@ ol.geom.MultiPolygon.prototype.getArea = function() { * By default, coordinate orientation will depend on how the geometry was * constructed. * @return {Array.>>} Coordinates. + * @override * @api stable */ ol.geom.MultiPolygon.prototype.getCoordinates = function(opt_right) { @@ -355,6 +357,7 @@ ol.geom.MultiPolygon.prototype.intersectsExtent = function(extent) { * Set the coordinates of the multipolygon. * @param {Array.>>} coordinates Coordinates. * @param {ol.geom.GeometryLayout=} opt_layout Layout. + * @override * @api stable */ ol.geom.MultiPolygon.prototype.setCoordinates = function(coordinates, opt_layout) { diff --git a/src/ol/geom/point.js b/src/ol/geom/point.js index 785f053e9f..21f5de6bc6 100644 --- a/src/ol/geom/point.js +++ b/src/ol/geom/point.js @@ -29,6 +29,7 @@ ol.inherits(ol.geom.Point, ol.geom.SimpleGeometry); /** * Make a complete copy of the geometry. * @return {!ol.geom.Point} Clone. + * @override * @api stable */ ol.geom.Point.prototype.clone = function() { @@ -62,6 +63,7 @@ ol.geom.Point.prototype.closestPointXY = function(x, y, closestPoint, minSquared /** * Return the coordinate of the point. * @return {ol.Coordinate} Coordinates. + * @override * @api stable */ ol.geom.Point.prototype.getCoordinates = function() { @@ -97,9 +99,7 @@ ol.geom.Point.prototype.intersectsExtent = function(extent) { /** - * Set the coordinate of the point. - * @param {ol.Coordinate} coordinates Coordinates. - * @param {ol.geom.GeometryLayout=} opt_layout Layout. + * @inheritDoc * @api stable */ ol.geom.Point.prototype.setCoordinates = function(coordinates, opt_layout) { diff --git a/src/ol/geom/polygon.js b/src/ol/geom/polygon.js index a698534473..54816501cb 100644 --- a/src/ol/geom/polygon.js +++ b/src/ol/geom/polygon.js @@ -106,6 +106,7 @@ ol.geom.Polygon.prototype.appendLinearRing = function(linearRing) { /** * Make a complete copy of the geometry. * @return {!ol.geom.Polygon} Clone. + * @override * @api stable */ ol.geom.Polygon.prototype.clone = function() { @@ -166,6 +167,7 @@ ol.geom.Polygon.prototype.getArea = function() { * By default, coordinate orientation will depend on how the geometry was * constructed. * @return {Array.>} Coordinates. + * @override * @api stable */ ol.geom.Polygon.prototype.getCoordinates = function(opt_right) { @@ -333,6 +335,7 @@ ol.geom.Polygon.prototype.intersectsExtent = function(extent) { * Set the coordinates of the polygon. * @param {Array.>} coordinates Coordinates. * @param {ol.geom.GeometryLayout=} opt_layout Layout. + * @override * @api stable */ ol.geom.Polygon.prototype.setCoordinates = function(coordinates, opt_layout) { diff --git a/src/ol/image.js b/src/ol/image.js index c4128103a3..e9eb53f848 100644 --- a/src/ol/image.js +++ b/src/ol/image.js @@ -70,9 +70,7 @@ ol.inherits(ol.Image, ol.ImageBase); /** - * Get the HTML image element (may be a Canvas, Image, or Video). - * @param {Object=} opt_context Object. - * @return {HTMLCanvasElement|Image|HTMLVideoElement} Image. + * @inheritDoc * @api */ ol.Image.prototype.getImage = function(opt_context) { @@ -125,6 +123,7 @@ ol.Image.prototype.handleImageLoad_ = function() { * Load the image or retry if loading previously failed. * Loading is taken care of by the tile queue, and calling this method is * only needed for preloading or for reloading in case of an error. + * @override * @api */ ol.Image.prototype.load = function() { diff --git a/src/ol/imagecanvas.js b/src/ol/imagecanvas.js index 13b9e5e017..6d5d25985c 100644 --- a/src/ol/imagecanvas.js +++ b/src/ol/imagecanvas.js @@ -73,7 +73,7 @@ ol.ImageCanvas.prototype.handleLoad_ = function(err) { /** - * Trigger drawing on canvas. + * @inheritDoc */ ol.ImageCanvas.prototype.load = function() { if (this.state == ol.ImageState.IDLE) { diff --git a/src/ol/imagetile.js b/src/ol/imagetile.js index a32e29a5db..c10af92364 100644 --- a/src/ol/imagetile.js +++ b/src/ol/imagetile.js @@ -116,9 +116,7 @@ ol.ImageTile.prototype.handleImageLoad_ = function() { /** - * Load the image or retry if loading previously failed. - * Loading is taken care of by the tile queue, and calling this method is - * only needed for preloading or for reloading in case of an error. + * @inheritDoc * @api */ ol.ImageTile.prototype.load = function() { diff --git a/src/ol/interaction/select.js b/src/ol/interaction/select.js index 0be3c9361a..6f37891de3 100644 --- a/src/ol/interaction/select.js +++ b/src/ol/interaction/select.js @@ -303,6 +303,7 @@ ol.interaction.Select.prototype.setHitTolerance = function(hitTolerance) { * Remove the interaction from its current map, if any, and attach it to a new * map, if any. Pass `null` to just remove the interaction from the current map. * @param {ol.Map} map Map. + * @override * @api stable */ ol.interaction.Select.prototype.setMap = function(map) { diff --git a/src/ol/render/canvas/immediate.js b/src/ol/render/canvas/immediate.js index 757b24bce5..29abefcbfa 100644 --- a/src/ol/render/canvas/immediate.js +++ b/src/ol/render/canvas/immediate.js @@ -397,6 +397,7 @@ ol.render.canvas.Immediate.prototype.drawRings_ = function(flatCoordinates, offs * the current fill and stroke styles. * * @param {ol.geom.Circle} geometry Circle geometry. + * @override * @api */ ol.render.canvas.Immediate.prototype.drawCircle = function(geometry) { @@ -437,6 +438,7 @@ ol.render.canvas.Immediate.prototype.drawCircle = function(geometry) { * any `zIndex` on the provided style will be ignored. * * @param {ol.style.Style} style The rendering style. + * @override * @api */ ol.render.canvas.Immediate.prototype.setStyle = function(style) { @@ -451,6 +453,7 @@ ol.render.canvas.Immediate.prototype.setStyle = function(style) { * {@link ol.render.canvas.Immediate#setStyle} first to set the rendering style. * * @param {ol.geom.Geometry|ol.render.Feature} geometry The geometry to render. + * @override * @api */ ol.render.canvas.Immediate.prototype.drawGeometry = function(geometry) { @@ -493,6 +496,7 @@ ol.render.canvas.Immediate.prototype.drawGeometry = function(geometry) { * * @param {ol.Feature} feature Feature. * @param {ol.style.Style} style Style. + * @override * @api */ ol.render.canvas.Immediate.prototype.drawFeature = function(feature, style) { @@ -511,6 +515,7 @@ ol.render.canvas.Immediate.prototype.drawFeature = function(feature, style) { * uses the current styles appropriate for each geometry in the collection. * * @param {ol.geom.GeometryCollection} geometry Geometry collection. + * @override */ ol.render.canvas.Immediate.prototype.drawGeometryCollection = function(geometry) { var geometries = geometry.getGeometriesArray(); @@ -526,6 +531,7 @@ ol.render.canvas.Immediate.prototype.drawGeometryCollection = function(geometry) * the current style. * * @param {ol.geom.Point|ol.render.Feature} geometry Point geometry. + * @override */ ol.render.canvas.Immediate.prototype.drawPoint = function(geometry) { var flatCoordinates = geometry.getFlatCoordinates(); @@ -544,6 +550,7 @@ ol.render.canvas.Immediate.prototype.drawPoint = function(geometry) { * uses the current style. * * @param {ol.geom.MultiPoint|ol.render.Feature} geometry MultiPoint geometry. + * @override */ ol.render.canvas.Immediate.prototype.drawMultiPoint = function(geometry) { var flatCoordinates = geometry.getFlatCoordinates(); @@ -562,6 +569,7 @@ ol.render.canvas.Immediate.prototype.drawMultiPoint = function(geometry) { * the current style. * * @param {ol.geom.LineString|ol.render.Feature} geometry LineString geometry. + * @override */ ol.render.canvas.Immediate.prototype.drawLineString = function(geometry) { if (!ol.extent.intersects(this.extent_, geometry.getExtent())) { @@ -589,6 +597,7 @@ ol.render.canvas.Immediate.prototype.drawLineString = function(geometry) { * * @param {ol.geom.MultiLineString|ol.render.Feature} geometry MultiLineString * geometry. + * @override */ ol.render.canvas.Immediate.prototype.drawMultiLineString = function(geometry) { var geometryExtent = geometry.getExtent(); @@ -622,6 +631,7 @@ ol.render.canvas.Immediate.prototype.drawMultiLineString = function(geometry) { * the current style. * * @param {ol.geom.Polygon|ol.render.Feature} geometry Polygon geometry. + * @override */ ol.render.canvas.Immediate.prototype.drawPolygon = function(geometry) { if (!ol.extent.intersects(this.extent_, geometry.getExtent())) { @@ -656,6 +666,7 @@ ol.render.canvas.Immediate.prototype.drawPolygon = function(geometry) { * Render MultiPolygon geometry into the canvas. Rendering is immediate and * uses the current style. * @param {ol.geom.MultiPolygon} geometry MultiPolygon geometry. + * @override */ ol.render.canvas.Immediate.prototype.drawMultiPolygon = function(geometry) { if (!ol.extent.intersects(this.extent_, geometry.getExtent())) { @@ -802,6 +813,7 @@ ol.render.canvas.Immediate.prototype.setContextTextState_ = function(textState) * * @param {ol.style.Fill} fillStyle Fill style. * @param {ol.style.Stroke} strokeStyle Stroke style. + * @override */ ol.render.canvas.Immediate.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) { if (!fillStyle) { @@ -848,6 +860,7 @@ ol.render.canvas.Immediate.prototype.setFillStrokeStyle = function(fillStyle, st * the image style. * * @param {ol.style.Image} imageStyle Image style. + * @override */ ol.render.canvas.Immediate.prototype.setImageStyle = function(imageStyle) { if (!imageStyle) { @@ -879,6 +892,7 @@ ol.render.canvas.Immediate.prototype.setImageStyle = function(imageStyle) { * remove the text style. * * @param {ol.style.Text} textStyle Text style. + * @override */ ol.render.canvas.Immediate.prototype.setTextStyle = function(textStyle) { if (!textStyle) { diff --git a/src/ol/render/vectorcontext.js b/src/ol/render/vectorcontext.js index 9e76c6ba33..5f2db7cf08 100644 --- a/src/ol/render/vectorcontext.js +++ b/src/ol/render/vectorcontext.js @@ -34,7 +34,7 @@ ol.render.VectorContext.prototype.setStyle = function(style) {}; /** * @abstract * @param {ol.geom.Circle} circleGeometry Circle geometry. - * @param {ol.Feature} feature Feature, + * @param {ol.Feature} feature Feature. */ ol.render.VectorContext.prototype.drawCircle = function(circleGeometry, feature) {}; diff --git a/src/ol/render/webgl/immediate.js b/src/ol/render/webgl/immediate.js index 74f4420b18..750cb966c6 100644 --- a/src/ol/render/webgl/immediate.js +++ b/src/ol/render/webgl/immediate.js @@ -88,6 +88,7 @@ if (ol.ENABLE_WEBGL) { * any `zIndex` on the provided style will be ignored. * * @param {ol.style.Style} style The rendering style. + * @override * @api */ ol.render.webgl.Immediate.prototype.setStyle = function(style) { @@ -101,6 +102,7 @@ if (ol.ENABLE_WEBGL) { * {@link ol.render.webgl.Immediate#setStyle} first to set the rendering style. * * @param {ol.geom.Geometry|ol.render.Feature} geometry The geometry to render. + * @override * @api */ ol.render.webgl.Immediate.prototype.drawGeometry = function(geometry) { diff --git a/src/ol/renderer/webgl/tilelayer.js b/src/ol/renderer/webgl/tilelayer.js index 45667be6c5..ef575668c9 100644 --- a/src/ol/renderer/webgl/tilelayer.js +++ b/src/ol/renderer/webgl/tilelayer.js @@ -97,15 +97,7 @@ if (ol.ENABLE_WEBGL) { /** - * Create a function that adds loaded tiles to the tile lookup. - * @param {ol.source.Tile} source Tile source. - * @param {ol.proj.Projection} projection Projection of the tiles. - * @param {Object.>} tiles Lookup of loaded - * tiles by zoom level. - * @return {function(number, ol.TileRange):boolean} A function that can be - * called with a zoom level and a tile range to add loaded tiles to the - * lookup. - * @protected + * @inheritDoc */ ol.renderer.webgl.TileLayer.prototype.createLoadedTileFinder = function(source, projection, tiles) { var mapRenderer = this.mapRenderer; diff --git a/src/ol/source/image.js b/src/ol/source/image.js index 8712cb42db..9e07a935ce 100644 --- a/src/ol/source/image.js +++ b/src/ol/source/image.js @@ -57,6 +57,7 @@ ol.inherits(ol.source.Image, ol.source.Source); /** * @return {Array.} Resolutions. + * @override */ ol.source.Image.prototype.getResolutions = function() { return this.resolutions_; diff --git a/src/ol/source/tiledebug.js b/src/ol/source/tiledebug.js index 4325f16124..3e301386cc 100644 --- a/src/ol/source/tiledebug.js +++ b/src/ol/source/tiledebug.js @@ -91,6 +91,7 @@ ol.inherits(ol.source.TileDebug.Tile_, ol.Tile); /** * Get the image element for this tile. * @return {HTMLCanvasElement} Image. + * @override */ ol.source.TileDebug.Tile_.prototype.getImage = function() { if (this.canvas_) { diff --git a/src/ol/source/tileutfgrid.js b/src/ol/source/tileutfgrid.js index f79f3e5978..a4410f9657 100644 --- a/src/ol/source/tileutfgrid.js +++ b/src/ol/source/tileutfgrid.js @@ -320,6 +320,7 @@ ol.inherits(ol.source.TileUTFGrid.Tile_, ol.Tile); /** * Get the image element for this tile. * @return {Image} Image. + * @override */ ol.source.TileUTFGrid.Tile_.prototype.getImage = function() { return null; @@ -479,7 +480,7 @@ ol.source.TileUTFGrid.Tile_.prototype.onXHRError_ = function(event) { /** - * Load not yet loaded URI. + * @inheritDoc */ ol.source.TileUTFGrid.Tile_.prototype.load = function() { if (this.preemptive_) { diff --git a/src/ol/style/circle.js b/src/ol/style/circle.js index 6b67d83920..acf8512ce5 100644 --- a/src/ol/style/circle.js +++ b/src/ol/style/circle.js @@ -33,6 +33,7 @@ ol.inherits(ol.style.Circle, ol.style.RegularShape); /** * Clones the style. If an atlasmanager was provided to the original style it will be used in the cloned style, too. * @return {ol.style.Circle} The cloned style. + * @override * @api */ ol.style.Circle.prototype.clone = function() { diff --git a/src/ol/style/icon.js b/src/ol/style/icon.js index 1628fec65c..8d57ed258d 100644 --- a/src/ol/style/icon.js +++ b/src/ol/style/icon.js @@ -275,6 +275,7 @@ ol.style.Icon.prototype.getColor = function() { * Get the image icon. * @param {number} pixelRatio Pixel ratio. * @return {Image|HTMLCanvasElement} Image or Canvas element. + * @override * @api */ ol.style.Icon.prototype.getImage = function(pixelRatio) { @@ -283,8 +284,7 @@ ol.style.Icon.prototype.getImage = function(pixelRatio) { /** - * Real Image size used. - * @return {ol.Size} Size. + * @inheritDoc */ ol.style.Icon.prototype.getImageSize = function() { return this.iconImage_.getSize(); @@ -379,6 +379,7 @@ ol.style.Icon.prototype.listenImageChange = function(listener, thisArg) { * When rendering a feature with an icon style, the vector renderer will * automatically call this method. However, you might want to call this * method yourself for preloading or other purposes. + * @override * @api */ ol.style.Icon.prototype.load = function() { diff --git a/src/ol/vectortile.js b/src/ol/vectortile.js index b32e339af6..c807e5e102 100644 --- a/src/ol/vectortile.js +++ b/src/ol/vectortile.js @@ -139,7 +139,7 @@ ol.VectorTile.prototype.getProjection = function() { /** - * Load the tile. + * @inheritDoc */ ol.VectorTile.prototype.load = function() { if (this.state == ol.TileState.IDLE) { From a0d80d17e00d6643e6fd1fefdee03e121a91f251 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 10 Jan 2017 10:49:27 +0100 Subject: [PATCH 05/23] Add ol.format.TopoJSON.readProjectionFromObject function --- src/ol/format/topojson.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ol/format/topojson.js b/src/ol/format/topojson.js index c7244dd5f4..5d8184ec55 100644 --- a/src/ol/format/topojson.js +++ b/src/ol/format/topojson.js @@ -371,7 +371,13 @@ ol.format.TopoJSON.transformVertex_ = function(vertex, scale, translate) { * @override * @api stable */ -ol.format.TopoJSON.prototype.readProjection = function(object) { +ol.format.TopoJSON.prototype.readProjection; + + +/** + * @inheritDoc + */ +ol.format.TopoJSON.prototype.readProjectionFromObject = function(object) { return this.defaultDataProjection; }; From 1cb2808f7f7c49db0ce4999acf00142af7b32786 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 12 Jan 2017 11:41:55 +0100 Subject: [PATCH 06/23] Remove abstract from ol.render.VectorContext functions --- src/ol/render/vectorcontext.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/ol/render/vectorcontext.js b/src/ol/render/vectorcontext.js index 5f2db7cf08..a8974f1cc7 100644 --- a/src/ol/render/vectorcontext.js +++ b/src/ol/render/vectorcontext.js @@ -16,7 +16,6 @@ ol.render.VectorContext = function() { /** * Render a geometry. * - * @abstract * @param {ol.geom.Geometry} geometry The geometry to render. */ ol.render.VectorContext.prototype.drawGeometry = function(geometry) {}; @@ -25,14 +24,12 @@ ol.render.VectorContext.prototype.drawGeometry = function(geometry) {}; /** * Set the rendering style. * - * @abstract * @param {ol.style.Style} style The rendering style. */ ol.render.VectorContext.prototype.setStyle = function(style) {}; /** - * @abstract * @param {ol.geom.Circle} circleGeometry Circle geometry. * @param {ol.Feature} feature Feature. */ @@ -40,7 +37,6 @@ ol.render.VectorContext.prototype.drawCircle = function(circleGeometry, feature) /** - * @abstract * @param {ol.Feature} feature Feature. * @param {ol.style.Style} style Style. */ @@ -48,7 +44,6 @@ ol.render.VectorContext.prototype.drawFeature = function(feature, style) {}; /** - * @abstract * @param {ol.geom.GeometryCollection} geometryCollectionGeometry Geometry * collection. * @param {ol.Feature} feature Feature. @@ -57,7 +52,6 @@ ol.render.VectorContext.prototype.drawGeometryCollection = function(geometryColl /** - * @abstract * @param {ol.geom.LineString|ol.render.Feature} lineStringGeometry Line * string geometry. * @param {ol.Feature|ol.render.Feature} feature Feature. @@ -66,7 +60,6 @@ ol.render.VectorContext.prototype.drawLineString = function(lineStringGeometry, /** - * @abstract * @param {ol.geom.MultiLineString|ol.render.Feature} multiLineStringGeometry * MultiLineString geometry. * @param {ol.Feature|ol.render.Feature} feature Feature. @@ -75,7 +68,6 @@ ol.render.VectorContext.prototype.drawMultiLineString = function(multiLineString /** - * @abstract * @param {ol.geom.MultiPoint|ol.render.Feature} multiPointGeometry MultiPoint * geometry. * @param {ol.Feature|ol.render.Feature} feature Feature. @@ -84,7 +76,6 @@ ol.render.VectorContext.prototype.drawMultiPoint = function(multiPointGeometry, /** - * @abstract * @param {ol.geom.MultiPolygon} multiPolygonGeometry MultiPolygon geometry. * @param {ol.Feature|ol.render.Feature} feature Feature. */ @@ -92,7 +83,6 @@ ol.render.VectorContext.prototype.drawMultiPolygon = function(multiPolygonGeomet /** - * @abstract * @param {ol.geom.Point|ol.render.Feature} pointGeometry Point geometry. * @param {ol.Feature|ol.render.Feature} feature Feature. */ @@ -100,7 +90,6 @@ ol.render.VectorContext.prototype.drawPoint = function(pointGeometry, feature) { /** - * @abstract * @param {ol.geom.Polygon|ol.render.Feature} polygonGeometry Polygon * geometry. * @param {ol.Feature|ol.render.Feature} feature Feature. @@ -109,7 +98,6 @@ ol.render.VectorContext.prototype.drawPolygon = function(polygonGeometry, featur /** - * @abstract * @param {Array.} flatCoordinates Flat coordinates. * @param {number} offset Offset. * @param {number} end End. @@ -121,7 +109,6 @@ ol.render.VectorContext.prototype.drawText = function(flatCoordinates, offset, e /** - * @abstract * @param {ol.style.Fill} fillStyle Fill style. * @param {ol.style.Stroke} strokeStyle Stroke style. */ @@ -129,14 +116,12 @@ ol.render.VectorContext.prototype.setFillStrokeStyle = function(fillStyle, strok /** - * @abstract * @param {ol.style.Image} imageStyle Image style. */ ol.render.VectorContext.prototype.setImageStyle = function(imageStyle) {}; /** - * @abstract * @param {ol.style.Text} textStyle Text style. */ ol.render.VectorContext.prototype.setTextStyle = function(textStyle) {}; From 198cf987ed9bc7eb8fa196c9e054a9f6c878bd91 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 12 Jan 2017 11:43:02 +0100 Subject: [PATCH 07/23] Add empty ol.source.Vector.getResolutions --- src/ol/source/vector.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ol/source/vector.js b/src/ol/source/vector.js index 8c6315d79f..cabdc9c23d 100644 --- a/src/ol/source/vector.js +++ b/src/ol/source/vector.js @@ -652,6 +652,12 @@ ol.source.Vector.prototype.getOverlaps = function() { }; +/** + * @inheritDoc + */ +ol.source.Vector.prototype.getResolutions = function() {}; + + /** * Get the url associated with this source. * From 271a4683a55420d33d7213f6a9f80adcbf58d592 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 12 Jan 2017 11:48:45 +0100 Subject: [PATCH 08/23] Add empty ol.geom.Circle.{get,set}Coordinates --- src/ol/geom/circle.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ol/geom/circle.js b/src/ol/geom/circle.js index 75c73dbb69..2b6e694db4 100644 --- a/src/ol/geom/circle.js +++ b/src/ol/geom/circle.js @@ -206,6 +206,18 @@ ol.geom.Circle.prototype.setCenterAndRadius = function(center, radius, opt_layou }; +/** + * @inheritDoc + */ +ol.geom.Circle.prototype.getCoordinates = function() {}; + + +/** + * @inheritDoc + */ +ol.geom.Circle.prototype.setCoordinates = function(coordinates, opt_layout) {}; + + /** * @param {ol.geom.GeometryLayout} layout Layout. * @param {Array.} flatCoordinates Flat coordinates. From b470220405bee76cfa5c2bb9893b7e11a1304ac4 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 12 Jan 2017 11:50:30 +0100 Subject: [PATCH 09/23] Add empty ol.layer.Group.createRenderer --- src/ol/layer/group.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ol/layer/group.js b/src/ol/layer/group.js index 43a51c93f7..4a77de05ad 100644 --- a/src/ol/layer/group.js +++ b/src/ol/layer/group.js @@ -70,6 +70,12 @@ ol.layer.Group = function(opt_options) { ol.inherits(ol.layer.Group, ol.layer.Base); +/** + * @inheritDoc + */ +ol.layer.Group.prototype.createRenderer = function(mapRenderer) {}; + + /** * @private */ From f8feaeb837264d4d0fe7fbc528b3e32184c44963 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 12 Jan 2017 11:59:27 +0100 Subject: [PATCH 10/23] Add empty ol.format.IGC.prototype.write* --- src/ol/format/igc.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/ol/format/igc.js b/src/ol/format/igc.js index 34af4fcf71..907673eb3a 100644 --- a/src/ol/format/igc.js +++ b/src/ol/format/igc.js @@ -202,3 +202,24 @@ ol.format.IGC.prototype.readFeaturesFromText = function(text, opt_options) { * @api */ ol.format.IGC.prototype.readProjection; + + +/** + * Not implemented. + * @inheritDoc + */ +ol.format.IGC.prototype.writeFeatureText = function(feature, opt_options) {}; + + +/** + * Not implemented. + * @inheritDoc + */ +ol.format.IGC.prototype.writeFeaturesText = function(features, opt_options) {}; + + +/** + * Not implemented. + * @inheritDoc + */ +ol.format.IGC.prototype.writeGeometryText = function(geometry, opt_options) {}; From 285349eced3873c2ec18ac8d0400fbca23e04197 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 12 Jan 2017 12:00:49 +0100 Subject: [PATCH 11/23] Add empty ol.format.TopoJSON.prototype.write* --- src/ol/format/topojson.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/ol/format/topojson.js b/src/ol/format/topojson.js index 5d8184ec55..c52f2b31f7 100644 --- a/src/ol/format/topojson.js +++ b/src/ol/format/topojson.js @@ -395,3 +395,24 @@ ol.format.TopoJSON.GEOMETRY_READERS_ = { 'MultiLineString': ol.format.TopoJSON.readMultiLineStringGeometry_, 'MultiPolygon': ol.format.TopoJSON.readMultiPolygonGeometry_ }; + + +/** + * Not implemented. + * @inheritDoc + */ +ol.format.TopoJSON.prototype.writeFeatureObject = function(feature, opt_options) {}; + + +/** + * Not implemented. + * @inheritDoc + */ +ol.format.TopoJSON.prototype.writeFeaturesObject = function(features, opt_options) {}; + + +/** + * Not implemented. + * @inheritDoc + */ +ol.format.TopoJSON.prototype.writeGeometryObject = function(geometry, opt_options) {}; From 4289f0a686b80d6eb37517067626d7e41e6c5d3e Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 12 Jan 2017 12:04:16 +0100 Subject: [PATCH 12/23] Add empty ol.format.WMSGetFeatureInfo.prototype.write* --- src/ol/format/wmsgetfeatureinfo.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/ol/format/wmsgetfeatureinfo.js b/src/ol/format/wmsgetfeatureinfo.js index 6f731d8d90..2fcb6fd62b 100644 --- a/src/ol/format/wmsgetfeatureinfo.js +++ b/src/ol/format/wmsgetfeatureinfo.js @@ -145,3 +145,24 @@ ol.format.WMSGetFeatureInfo.prototype.readFeaturesFromNode = function(node, opt_ } return this.readFeatures_(node, [options]); }; + + +/** + * Not implemented. + * @inheritDoc + */ +ol.format.WMSGetFeatureInfo.prototype.writeFeatureNode = function(feature, opt_options) {}; + + +/** + * Not implemented. + * @inheritDoc + */ +ol.format.WMSGetFeatureInfo.prototype.writeFeaturesNode = function(features, opt_options) {}; + + +/** + * Not implemented. + * @inheritDoc + */ +ol.format.WMSGetFeatureInfo.prototype.writeGeometryNode = function(geometry, opt_options) {}; From 2713175e155bf6b3804ac460f4fdb8bd0569949c Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 12 Jan 2017 12:10:15 +0100 Subject: [PATCH 13/23] Add empty ol.format.OSMXML.prototype.write* --- src/ol/format/osmxml.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/ol/format/osmxml.js b/src/ol/format/osmxml.js index 4ccc4ddf72..ef3eb13b12 100644 --- a/src/ol/format/osmxml.js +++ b/src/ol/format/osmxml.js @@ -208,3 +208,24 @@ ol.format.OSMXML.prototype.readFeaturesFromNode = function(node, opt_options) { * @api stable */ ol.format.OSMXML.prototype.readProjection; + + +/** + * Not implemented. + * @inheritDoc + */ +ol.format.OSMXML.prototype.writeFeatureNode = function(feature, opt_options) {}; + + +/** + * Not implemented. + * @inheritDoc + */ +ol.format.OSMXML.prototype.writeFeaturesNode = function(features, opt_options) {}; + + +/** + * Not implemented. + * @inheritDoc + */ +ol.format.OSMXML.prototype.writeGeometryNode = function(geometry, opt_options) {}; From 7a7c01a074a5957e0a9745cd2e107aa6f56efa20 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 12 Jan 2017 12:16:45 +0100 Subject: [PATCH 14/23] Add empty ol.geom.LinearRing.intersectsExtent --- src/ol/geom/linearring.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ol/geom/linearring.js b/src/ol/geom/linearring.js index 419c2eb8d0..3cc8bfcbcb 100644 --- a/src/ol/geom/linearring.js +++ b/src/ol/geom/linearring.js @@ -124,6 +124,12 @@ ol.geom.LinearRing.prototype.getType = function() { }; +/** + * @inheritDoc + */ +ol.geom.LinearRing.prototype.intersectsExtent = function(extent) {}; + + /** * Set the coordinates of the linear ring. * @param {Array.} coordinates Coordinates. From b54ea893954a4c0ab8aea6757749699c7eb8ee18 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Fri, 13 Jan 2017 23:39:39 +0100 Subject: [PATCH 15/23] Handle concrete classes with non implemented abstract methods --- src/ol/format/igc.js | 8 ++++++ src/ol/format/mvt.js | 40 ++++++++++++++++++++++++++++++ src/ol/format/topojson.js | 16 ++++++++++++ src/ol/format/xmlfeature.js | 33 +++++++++++++++--------- src/ol/interaction/draganddrop.js | 8 ++++++ src/ol/map.js | 2 +- src/ol/render/webgl/replaygroup.js | 3 +++ src/ol/source/raster.js | 8 ++++++ 8 files changed, 105 insertions(+), 13 deletions(-) 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 From 68f493fc90ac2adef32d85e38e325943d1b74331 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 16 Jan 2017 08:41:35 +0100 Subject: [PATCH 16/23] Revert "Remove 'analyzerChecks' from jscomp_off compiler option" This reverts commit 56320844419899dccbf5f538b5c9112b08d7ce0d. --- config/example.json | 1 + config/examples-all.json | 3 ++- config/ol.json | 3 ++- doc/tutorials/closure.md | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config/example.json b/config/example.json index dff7c67e16..d034d67b76 100644 --- a/config/example.json +++ b/config/example.json @@ -28,6 +28,7 @@ ], "jscomp_off": [ "lintChecks", + "analyzerChecks", "missingProvide", "unknownDefines" ], diff --git a/config/examples-all.json b/config/examples-all.json index 3c66049069..3544621ee9 100644 --- a/config/examples-all.json +++ b/config/examples-all.json @@ -27,7 +27,8 @@ "*" ], "jscomp_off": [ - "lintChecks" + "lintChecks", + "analyzerChecks" ], "extra_annotation_name": [ "api", "observable" diff --git a/config/ol.json b/config/ol.json index 044957ae2c..90b8893824 100644 --- a/config/ol.json +++ b/config/ol.json @@ -21,7 +21,8 @@ "*" ], "jscomp_off": [ - "lintChecks" + "lintChecks", + "analyzerChecks" ], "extra_annotation_name": [ "api", "observable" diff --git a/doc/tutorials/closure.md b/doc/tutorials/closure.md index 723b915003..7221445bef 100644 --- a/doc/tutorials/closure.md +++ b/doc/tutorials/closure.md @@ -230,7 +230,8 @@ Here is a version of `config.json` with more compilation checks enabled: ], "jscomp_off": [ "unknownDefines", - "lintChecks" + "lintChecks", + "analyzerChecks" ], "extra_annotation_name": [ "api", "observable" From 3e4afa6ddf4bfe46dfac6deaf2558fd9bd3eb042 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 18 Jan 2017 12:25:18 +0100 Subject: [PATCH 17/23] Update closure-util to v1.16.0 --- config/example.json | 1 + config/examples-all.json | 1 + config/ol.json | 1 + doc/tutorials/closure.md | 1 + externs/closure-compiler.js | 20 -------------------- package.json | 2 +- 6 files changed, 5 insertions(+), 21 deletions(-) diff --git a/config/example.json b/config/example.json index d034d67b76..ee41151bf4 100644 --- a/config/example.json +++ b/config/example.json @@ -35,6 +35,7 @@ "extra_annotation_name": [ "api", "observable" ], + "rewrite_polyfills": "false", "compilation_level": "ADVANCED", "warning_level": "VERBOSE", "output_wrapper": "(function(){%output%})();", diff --git a/config/examples-all.json b/config/examples-all.json index 3544621ee9..c66a133860 100644 --- a/config/examples-all.json +++ b/config/examples-all.json @@ -33,6 +33,7 @@ "extra_annotation_name": [ "api", "observable" ], + "rewrite_polyfills": "false", "compilation_level": "ADVANCED", "warning_level": "VERBOSE", "output_wrapper": "(function(){%output%})();", diff --git a/config/ol.json b/config/ol.json index 90b8893824..d0479e5b70 100644 --- a/config/ol.json +++ b/config/ol.json @@ -27,6 +27,7 @@ "extra_annotation_name": [ "api", "observable" ], + "rewrite_polyfills": "false", "compilation_level": "ADVANCED", "warning_level": "VERBOSE", "use_types_for_optimization": true, diff --git a/doc/tutorials/closure.md b/doc/tutorials/closure.md index 7221445bef..6e3f26cafd 100644 --- a/doc/tutorials/closure.md +++ b/doc/tutorials/closure.md @@ -178,6 +178,7 @@ The minimum config file looks like this: "extra_annotation_name": [ "api", "observable" ], + "rewrite_polyfills": "false", "compilation_level": "ADVANCED", "warning_level": "VERBOSE", "output_wrapper": "(function(){%output%})();", diff --git a/externs/closure-compiler.js b/externs/closure-compiler.js index 973d47cf54..763c409f16 100644 --- a/externs/closure-compiler.js +++ b/externs/closure-compiler.js @@ -7,23 +7,3 @@ * * @externs */ - - -// see https://github.com/google/closure-compiler/pull/1991 - -/** - * @param {*} arg - * @return {boolean} - * @nosideeffects - * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView - */ -ArrayBuffer.isView = function(arg) {}; - - -// see https://github.com/google/closure-compiler/pull/1206 - -/** - * @type {string} - * @see http://www.w3.org/TR/pointerevents/#the-touch-action-css-property - */ -CSSProperties.prototype.touchAction; diff --git a/package.json b/package.json index 8da150a2a4..2e9381458f 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "dependencies": { "async": "2.1.4", "browserify": "13.1.1", - "closure-util": "1.15.1", + "closure-util": "1.16.0", "derequire": "2.0.6", "fs-extra": "1.0.0", "glob": "7.1.1", From f72fd69ea6a0425e6aaf2e4117007d0b074872a6 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Fri, 20 Jan 2017 09:10:54 +0100 Subject: [PATCH 18/23] Add empty ol.format.IGC.prototype.readGeometryFromText --- src/ol/format/igc.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ol/format/igc.js b/src/ol/format/igc.js index 6f03844c1e..19db22cf4d 100644 --- a/src/ol/format/igc.js +++ b/src/ol/format/igc.js @@ -226,8 +226,7 @@ ol.format.IGC.prototype.writeGeometryText = function(geometry, opt_options) {}; /** - * @override + * Not implemented. + * @inheritDoc */ -ol.format.IGC.prototype.readGeometryFromText = function() { - throw new Error('Not implemented'); -}; +ol.format.IGC.prototype.readGeometryFromText = function(text, opt_options) {}; From c9d33fb03ac0ca99cfef4b03f3fdd31065044568 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Mon, 30 Jan 2017 17:18:30 +0100 Subject: [PATCH 19/23] Fix missing require --- src/ol/format/filter/logicalnary.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ol/format/filter/logicalnary.js b/src/ol/format/filter/logicalnary.js index fd19fe8909..530c5e4d4f 100644 --- a/src/ol/format/filter/logicalnary.js +++ b/src/ol/format/filter/logicalnary.js @@ -1,6 +1,7 @@ goog.provide('ol.format.filter.LogicalNary'); goog.require('ol'); +goog.require('ol.asserts'); goog.require('ol.format.filter.Filter'); From 1c353061fe74ff1b1d7573dbdb5a5ba05c78f4f0 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Tue, 31 Jan 2017 09:21:01 +0100 Subject: [PATCH 20/23] Consistently handle not implemented methods --- src/ol/format/mvt.js | 25 ++++++++++--------------- src/ol/format/topojson.js | 10 ++++------ src/ol/format/xmlfeature.js | 15 ++++++--------- src/ol/source/raster.js | 2 +- 4 files changed, 21 insertions(+), 31 deletions(-) diff --git a/src/ol/format/mvt.js b/src/ol/format/mvt.js index 64d113bbce..5b83304ab8 100644 --- a/src/ol/format/mvt.js +++ b/src/ol/format/mvt.js @@ -256,40 +256,35 @@ ol.format.MVT.readGeometry_ = function(rawFeature) { /** + * Not implemented. * @override */ -ol.format.MVT.prototype.readFeature = function() { - throw new Error('Not implemented'); -}; +ol.format.MVT.prototype.readFeature = function() {}; /** + * Not implemented. * @override */ -ol.format.MVT.prototype.readGeometry = function() { - throw new Error('Not implemented'); -}; +ol.format.MVT.prototype.readGeometry = function() {}; /** + * Not implemented. * @override */ -ol.format.MVT.prototype.writeFeature = function() { - throw new Error('Not implemented'); -}; +ol.format.MVT.prototype.writeFeature = function() {}; /** + * Not implemented. * @override */ -ol.format.MVT.prototype.writeGeometry = function() { - throw new Error('Not implemented'); -}; +ol.format.MVT.prototype.writeGeometry = function() {}; /** + * Not implemented. * @override */ -ol.format.MVT.prototype.writeFeatures = function() { - throw new Error('Not implemented'); -}; +ol.format.MVT.prototype.writeFeatures = function() {}; diff --git a/src/ol/format/topojson.js b/src/ol/format/topojson.js index 97d23bc240..34ea6874cc 100644 --- a/src/ol/format/topojson.js +++ b/src/ol/format/topojson.js @@ -419,16 +419,14 @@ ol.format.TopoJSON.prototype.writeGeometryObject = function(geometry, opt_option /** + * Not implemented. * @override */ -ol.format.TopoJSON.prototype.readGeometryFromObject = function() { - throw new Error('Not implemented'); -}; +ol.format.TopoJSON.prototype.readGeometryFromObject = function() {}; /** + * Not implemented. * @override */ -ol.format.TopoJSON.prototype.readFeatureFromObject = function() { - throw new Error('Not implemented'); -}; +ol.format.TopoJSON.prototype.readFeatureFromObject = function() {}; diff --git a/src/ol/format/xmlfeature.js b/src/ol/format/xmlfeature.js index ec57f14c3f..5a67c551bc 100644 --- a/src/ol/format/xmlfeature.js +++ b/src/ol/format/xmlfeature.js @@ -7,9 +7,6 @@ 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 @@ -81,7 +78,7 @@ ol.format.XMLFeature.prototype.readFeatureFromDocument = function( * @return {ol.Feature} Feature. */ 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. */ 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. */ 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. */ 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. */ 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. */ ol.format.XMLFeature.prototype.writeGeometryNode = function(geometry, opt_options) { - throw new Error('Not implemented'); + return null; // not implemented }; diff --git a/src/ol/source/raster.js b/src/ol/source/raster.js index 0d6e95ca5f..2ebcc06937 100644 --- a/src/ol/source/raster.js +++ b/src/ol/source/raster.js @@ -489,7 +489,7 @@ ol.inherits(ol.source.Raster.Event, ol.events.Event); * @override */ ol.source.Raster.prototype.getImageInternal = function() { - throw new Error('Not implemented'); + return null; // not implemented }; From c16cc286cd0386b44ae3ec2e9aabe30c0bad6795 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Tue, 31 Jan 2017 09:31:34 +0100 Subject: [PATCH 21/23] Prefer @override in the case there is no other annotations See https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler#override --- src/ol/source/tileutfgrid.js | 2 +- src/ol/source/vector.js | 2 +- src/ol/style/icon.js | 12 ++++++------ src/ol/vectortile.js | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ol/source/tileutfgrid.js b/src/ol/source/tileutfgrid.js index a4410f9657..0166caace1 100644 --- a/src/ol/source/tileutfgrid.js +++ b/src/ol/source/tileutfgrid.js @@ -480,7 +480,7 @@ ol.source.TileUTFGrid.Tile_.prototype.onXHRError_ = function(event) { /** - * @inheritDoc + * @override */ ol.source.TileUTFGrid.Tile_.prototype.load = function() { if (this.preemptive_) { diff --git a/src/ol/source/vector.js b/src/ol/source/vector.js index cabdc9c23d..09c8704036 100644 --- a/src/ol/source/vector.js +++ b/src/ol/source/vector.js @@ -653,7 +653,7 @@ ol.source.Vector.prototype.getOverlaps = function() { /** - * @inheritDoc + * @override */ ol.source.Vector.prototype.getResolutions = function() {}; diff --git a/src/ol/style/icon.js b/src/ol/style/icon.js index 8d57ed258d..8a6a823940 100644 --- a/src/ol/style/icon.js +++ b/src/ol/style/icon.js @@ -284,7 +284,7 @@ ol.style.Icon.prototype.getImage = function(pixelRatio) { /** - * @inheritDoc + * @override */ ol.style.Icon.prototype.getImageSize = function() { return this.iconImage_.getSize(); @@ -292,7 +292,7 @@ ol.style.Icon.prototype.getImageSize = function() { /** - * @inheritDoc + * @override */ ol.style.Icon.prototype.getHitDetectionImageSize = function() { return this.getImageSize(); @@ -300,7 +300,7 @@ ol.style.Icon.prototype.getHitDetectionImageSize = function() { /** - * @inheritDoc + * @override */ ol.style.Icon.prototype.getImageState = function() { return this.iconImage_.getImageState(); @@ -308,7 +308,7 @@ ol.style.Icon.prototype.getImageState = function() { /** - * @inheritDoc + * @override */ ol.style.Icon.prototype.getHitDetectionImage = function(pixelRatio) { return this.iconImage_.getHitDetectionImage(pixelRatio); @@ -366,7 +366,7 @@ ol.style.Icon.prototype.getSize = function() { /** - * @inheritDoc + * @override */ ol.style.Icon.prototype.listenImageChange = function(listener, thisArg) { return ol.events.listen(this.iconImage_, ol.events.EventType.CHANGE, @@ -388,7 +388,7 @@ ol.style.Icon.prototype.load = function() { /** - * @inheritDoc + * @override */ ol.style.Icon.prototype.unlistenImageChange = function(listener, thisArg) { ol.events.unlisten(this.iconImage_, ol.events.EventType.CHANGE, diff --git a/src/ol/vectortile.js b/src/ol/vectortile.js index c807e5e102..78598ff023 100644 --- a/src/ol/vectortile.js +++ b/src/ol/vectortile.js @@ -88,7 +88,7 @@ ol.VectorTile.prototype.getContext = function() { /** - * @inheritDoc + * @override */ ol.VectorTile.prototype.getImage = function() { return this.replayState_.renderedTileRevision == -1 ? From c77169fcacd85a6dd723a5787278cf2818f85293 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Tue, 31 Jan 2017 10:32:18 +0100 Subject: [PATCH 22/23] Update closure compiler to v20170124 --- package.json | 2 +- tasks/build-ext.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2e9381458f..78b9d813e8 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "dependencies": { "async": "2.1.4", "browserify": "13.1.1", - "closure-util": "1.16.0", + "closure-util": "1.17.0", "derequire": "2.0.6", "fs-extra": "1.0.0", "glob": "7.1.1", diff --git a/tasks/build-ext.js b/tasks/build-ext.js index 62b9ead8c7..72b58ea039 100644 --- a/tasks/build-ext.js +++ b/tasks/build-ext.js @@ -58,7 +58,7 @@ function wrapModule(mod, callback) { 'constantProperty, deprecated, duplicate, es5Strict, ' + 'fileoverviewTags, missingProperties, nonStandardJsDocs, ' + 'strictModuleDepCheck, suspiciousCode, undefinedNames, ' + - 'undefinedVars, unknownDefines, uselessCode, visibility}\n' + + 'undefinedVars, unknownDefines, unusedLocalVariables, uselessCode, visibility}\n' + ' */\n' + code + '\n' + 'ol.ext.' + mod.name + ' = module.exports;\n' + '})();\n'; From 687ef25649b5e21678beee0d24c4bf848c2b44cf Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Tue, 31 Jan 2017 14:40:18 +0100 Subject: [PATCH 23/23] Ignore unused local variable in all examples compile This makes it consistent with the eslint configuration for examples in examples/.eslintrc. --- config/examples-all.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/examples-all.json b/config/examples-all.json index c66a133860..253554441b 100644 --- a/config/examples-all.json +++ b/config/examples-all.json @@ -28,7 +28,8 @@ ], "jscomp_off": [ "lintChecks", - "analyzerChecks" + "analyzerChecks", + "unusedLocalVariables" ], "extra_annotation_name": [ "api", "observable"