Rename ol.format.Format to ol.format.Feature
This commit is contained in:
@@ -320,7 +320,7 @@
|
||||
|
||||
/**
|
||||
* @typedef {Object} olx.interaction.DragAndDropOptions
|
||||
* @property {Array.<function(new: ol.format.Format)>|undefined} formatConstructors
|
||||
* @property {Array.<function(new: ol.format.Feature)>|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.<ol.Attribution>|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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
1
src/ol/format/featureformat.exports
Normal file
1
src/ol/format/featureformat.exports
Normal file
@@ -0,0 +1 @@
|
||||
@exportProperty ol.format.Feature.prototype.readProjection
|
||||
72
src/ol/format/featureformat.js
Normal file
72
src/ol/format/featureformat.js
Normal file
@@ -0,0 +1,72 @@
|
||||
goog.provide('ol.format.Feature');
|
||||
|
||||
goog.require('goog.functions');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
ol.format.Feature = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {Array.<string>} 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.<ol.Feature>} 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.<ol.Feature>} 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;
|
||||
@@ -1 +0,0 @@
|
||||
@exportProperty ol.format.Format.prototype.readProjection
|
||||
@@ -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.<string>} 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.<ol.Feature>} 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.<ol.Feature>} 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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,7 @@ ol.interaction.DragAndDrop = function(opt_options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<function(new: ol.format.Format)>}
|
||||
* @type {Array.<function(new: ol.format.Feature)>}
|
||||
*/
|
||||
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.<ol.Feature>} Features.
|
||||
|
||||
@@ -37,7 +37,7 @@ ol.source.VectorFile = function(opt_options) {
|
||||
});
|
||||
|
||||
/**
|
||||
* @type {ol.format.Format}
|
||||
* @type {ol.format.Feature}
|
||||
* @protected
|
||||
*/
|
||||
this.format = options.format;
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user