From ea8944c7559e591a4c6f68dacc37296ee3990063 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Fri, 28 Feb 2014 13:05:57 +0100 Subject: [PATCH] Rename ol.format.Format to ol.format.Feature --- src/objectliterals.jsdoc | 4 +- src/ol/format/binaryformat.js | 6 +- src/ol/format/featureformat.exports | 1 + src/ol/format/featureformat.js | 72 ++++++++++++++++++++ src/ol/format/format.exports | 1 - src/ol/format/format.js | 72 -------------------- src/ol/format/jsonformat.js | 6 +- src/ol/format/textformat.js | 6 +- src/ol/format/xmlformat.js | 6 +- src/ol/interaction/draganddropinteraction.js | 4 +- src/ol/source/vectorfilesource.js | 2 +- test/spec/ol/format/topojson.test.js | 4 +- 12 files changed, 92 insertions(+), 92 deletions(-) create mode 100644 src/ol/format/featureformat.exports create mode 100644 src/ol/format/featureformat.js delete mode 100644 src/ol/format/format.exports diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index 34dd6c8ed0..74622c6b14 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -320,7 +320,7 @@ /** * @typedef {Object} olx.interaction.DragAndDropOptions - * @property {Array.|undefined} formatConstructors + * @property {Array.|undefined} formatConstructors * Format constructors. * @property {ol.proj.ProjectionLike} reprojectTo Target projection. By * default, the map's view's projection is used. @@ -853,7 +853,7 @@ * @property {Array.|undefined} attributions Attributions. * @property {Document|undefined} doc Document. * @property {ol.Extent|undefined} extent Extent. - * @property {ol.format.Format} format Format. + * @property {ol.format.Feature} format Format. * @property {string|undefined} logo Logo. * @property {Node|undefined} node Node. * @property {Object|undefined} object Object. diff --git a/src/ol/format/binaryformat.js b/src/ol/format/binaryformat.js index 5cf01cfdd9..577d0f7165 100644 --- a/src/ol/format/binaryformat.js +++ b/src/ol/format/binaryformat.js @@ -3,7 +3,7 @@ goog.provide('ol.format.Binary'); goog.require('goog.asserts'); goog.require('ol.BrowserFeature'); goog.require('ol.binary.Buffer'); -goog.require('ol.format.Format'); +goog.require('ol.format.Feature'); goog.require('ol.format.FormatType'); goog.require('ol.proj'); @@ -11,12 +11,12 @@ goog.require('ol.proj'); /** * @constructor - * @extends {ol.format.Format} + * @extends {ol.format.Feature} */ ol.format.Binary = function() { goog.base(this); }; -goog.inherits(ol.format.Binary, ol.format.Format); +goog.inherits(ol.format.Binary, ol.format.Feature); /** diff --git a/src/ol/format/featureformat.exports b/src/ol/format/featureformat.exports new file mode 100644 index 0000000000..54d0ca3cbb --- /dev/null +++ b/src/ol/format/featureformat.exports @@ -0,0 +1 @@ +@exportProperty ol.format.Feature.prototype.readProjection diff --git a/src/ol/format/featureformat.js b/src/ol/format/featureformat.js new file mode 100644 index 0000000000..62d7b4b4ad --- /dev/null +++ b/src/ol/format/featureformat.js @@ -0,0 +1,72 @@ +goog.provide('ol.format.Feature'); + +goog.require('goog.functions'); + + + +/** + * @constructor + */ +ol.format.Feature = function() { +}; + + +/** + * @return {Array.} Extensions. + */ +ol.format.Feature.prototype.getExtensions = goog.abstractMethod; + + +/** + * @return {ol.format.FormatType} Format. + */ +ol.format.Feature.prototype.getType = goog.abstractMethod; + + +/** + * @param {ArrayBuffer|Document|Node|Object|string} source Source. + * @return {ol.Feature} Feature. + */ +ol.format.Feature.prototype.readFeature = goog.abstractMethod; + + +/** + * @param {ArrayBuffer|Document|Node|Object|string} source Source. + * @return {Array.} Features. + */ +ol.format.Feature.prototype.readFeatures = goog.abstractMethod; + + +/** + * @param {ArrayBuffer|Document|Node|Object|string} source Source. + * @return {ol.geom.Geometry} Geometry. + */ +ol.format.Feature.prototype.readGeometry = goog.abstractMethod; + + +/** + * @param {ArrayBuffer|Document|Node|Object|string} source Source. + * @return {ol.proj.Projection} Projection. + */ +ol.format.Feature.prototype.readProjection = goog.abstractMethod; + + +/** + * @param {ol.Feature} feature Feature. + * @return {ArrayBuffer|Node|Object|string} Result. + */ +ol.format.Feature.prototype.writeFeature = goog.abstractMethod; + + +/** + * @param {Array.} features Features. + * @return {ArrayBuffer|Node|Object|string} Result. + */ +ol.format.Feature.prototype.writeFeatures = goog.abstractMethod; + + +/** + * @param {ol.geom.Geometry} geometry Geometry. + * @return {ArrayBuffer|Node|Object|string} Node. + */ +ol.format.Feature.prototype.writeGeometry = goog.abstractMethod; diff --git a/src/ol/format/format.exports b/src/ol/format/format.exports deleted file mode 100644 index b739fdbdb7..0000000000 --- a/src/ol/format/format.exports +++ /dev/null @@ -1 +0,0 @@ -@exportProperty ol.format.Format.prototype.readProjection diff --git a/src/ol/format/format.js b/src/ol/format/format.js index 69cf3ed97b..bdedb916d1 100644 --- a/src/ol/format/format.js +++ b/src/ol/format/format.js @@ -1,8 +1,5 @@ -goog.provide('ol.format.Format'); goog.provide('ol.format.FormatType'); -goog.require('goog.functions'); - /** * @enum {string} @@ -13,72 +10,3 @@ ol.format.FormatType = { TEXT: 'text', XML: 'xml' }; - - - -/** - * @constructor - */ -ol.format.Format = function() { -}; - - -/** - * @return {Array.} Extensions. - */ -ol.format.Format.prototype.getExtensions = goog.abstractMethod; - - -/** - * @return {ol.format.FormatType} Format. - */ -ol.format.Format.prototype.getType = goog.abstractMethod; - - -/** - * @param {ArrayBuffer|Document|Node|Object|string} source Source. - * @return {ol.Feature} Feature. - */ -ol.format.Format.prototype.readFeature = goog.abstractMethod; - - -/** - * @param {ArrayBuffer|Document|Node|Object|string} source Source. - * @return {Array.} Features. - */ -ol.format.Format.prototype.readFeatures = goog.abstractMethod; - - -/** - * @param {ArrayBuffer|Document|Node|Object|string} source Source. - * @return {ol.geom.Geometry} Geometry. - */ -ol.format.Format.prototype.readGeometry = goog.abstractMethod; - - -/** - * @param {ArrayBuffer|Document|Node|Object|string} source Source. - * @return {ol.proj.Projection} Projection. - */ -ol.format.Format.prototype.readProjection = goog.abstractMethod; - - -/** - * @param {ol.Feature} feature Feature. - * @return {ArrayBuffer|Node|Object|string} Result. - */ -ol.format.Format.prototype.writeFeature = goog.abstractMethod; - - -/** - * @param {Array.} features Features. - * @return {ArrayBuffer|Node|Object|string} Result. - */ -ol.format.Format.prototype.writeFeatures = goog.abstractMethod; - - -/** - * @param {ol.geom.Geometry} geometry Geometry. - * @return {ArrayBuffer|Node|Object|string} Node. - */ -ol.format.Format.prototype.writeGeometry = goog.abstractMethod; diff --git a/src/ol/format/jsonformat.js b/src/ol/format/jsonformat.js index 59ac11b62f..9bcd71a23c 100644 --- a/src/ol/format/jsonformat.js +++ b/src/ol/format/jsonformat.js @@ -2,19 +2,19 @@ goog.provide('ol.format.JSON'); goog.require('goog.asserts'); goog.require('goog.json'); -goog.require('ol.format.Format'); +goog.require('ol.format.Feature'); goog.require('ol.format.FormatType'); /** * @constructor - * @extends {ol.format.Format} + * @extends {ol.format.Feature} */ ol.format.JSON = function() { goog.base(this); }; -goog.inherits(ol.format.JSON, ol.format.Format); +goog.inherits(ol.format.JSON, ol.format.Feature); /** diff --git a/src/ol/format/textformat.js b/src/ol/format/textformat.js index ca56d9c2e4..f6551e638c 100644 --- a/src/ol/format/textformat.js +++ b/src/ol/format/textformat.js @@ -1,19 +1,19 @@ goog.provide('ol.format.Text'); goog.require('goog.asserts'); -goog.require('ol.format.Format'); +goog.require('ol.format.Feature'); goog.require('ol.format.FormatType'); /** * @constructor - * @extends {ol.format.Format} + * @extends {ol.format.Feature} */ ol.format.Text = function() { goog.base(this); }; -goog.inherits(ol.format.Text, ol.format.Format); +goog.inherits(ol.format.Text, ol.format.Feature); /** diff --git a/src/ol/format/xmlformat.js b/src/ol/format/xmlformat.js index 7e0dc19ec1..8166facac4 100644 --- a/src/ol/format/xmlformat.js +++ b/src/ol/format/xmlformat.js @@ -3,7 +3,7 @@ goog.provide('ol.format.XML'); goog.require('goog.array'); goog.require('goog.asserts'); goog.require('goog.dom.NodeType'); -goog.require('ol.format.Format'); +goog.require('ol.format.Feature'); goog.require('ol.format.FormatType'); goog.require('ol.xml'); @@ -11,12 +11,12 @@ goog.require('ol.xml'); /** * @constructor - * @extends {ol.format.Format} + * @extends {ol.format.Feature} */ ol.format.XML = function() { goog.base(this); }; -goog.inherits(ol.format.XML, ol.format.Format); +goog.inherits(ol.format.XML, ol.format.Feature); /** diff --git a/src/ol/interaction/draganddropinteraction.js b/src/ol/interaction/draganddropinteraction.js index 77645850c8..7af957e4ee 100644 --- a/src/ol/interaction/draganddropinteraction.js +++ b/src/ol/interaction/draganddropinteraction.js @@ -29,7 +29,7 @@ ol.interaction.DragAndDrop = function(opt_options) { /** * @private - * @type {Array.} + * @type {Array.} */ this.formatConstructors_ = goog.isDef(options.formatConstructors) ? options.formatConstructors : []; @@ -157,7 +157,7 @@ ol.interaction.DragAndDrop.prototype.setMap = function(map) { /** - * @param {ol.format.Format} format Format. + * @param {ol.format.Feature} format Format. * @param {string} text Text. * @private * @return {Array.} Features. diff --git a/src/ol/source/vectorfilesource.js b/src/ol/source/vectorfilesource.js index 11ef6a65f7..d0f972800b 100644 --- a/src/ol/source/vectorfilesource.js +++ b/src/ol/source/vectorfilesource.js @@ -37,7 +37,7 @@ ol.source.VectorFile = function(opt_options) { }); /** - * @type {ol.format.Format} + * @type {ol.format.Feature} * @protected */ this.format = options.format; diff --git a/test/spec/ol/format/topojson.test.js b/test/spec/ol/format/topojson.test.js index aced8a7066..e53775df0d 100644 --- a/test/spec/ol/format/topojson.test.js +++ b/test/spec/ol/format/topojson.test.js @@ -32,7 +32,7 @@ describe('ol.format.TopoJSON', function() { describe('constructor', function() { it('creates a new format', function() { - expect(format).to.be.a(ol.format.Format); + expect(format).to.be.a(ol.format.Feature); expect(format).to.be.a(ol.format.TopoJSON); }); }); @@ -97,5 +97,5 @@ describe('ol.format.TopoJSON', function() { goog.require('ol.Feature'); goog.require('ol.geom.MultiPolygon'); goog.require('ol.geom.Polygon'); -goog.require('ol.format.Format'); +goog.require('ol.format.Feature'); goog.require('ol.format.TopoJSON');