Rename _ol_format_TextFeature_ to TextFeature
This commit is contained in:
@@ -5,7 +5,7 @@ import {inherits} from '../index.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import _ol_format_IGCZ_ from '../format/IGCZ.js';
|
||||
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
||||
import TextFeature from '../format/TextFeature.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import {get as getProjection} from '../proj.js';
|
||||
@@ -23,7 +23,7 @@ var IGC = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
_ol_format_TextFeature_.call(this);
|
||||
TextFeature.call(this);
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
@@ -39,7 +39,7 @@ var IGC = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(IGC, _ol_format_TextFeature_);
|
||||
inherits(IGC, TextFeature);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ import {inherits} from '../index.js';
|
||||
import _ol_asserts_ from '../asserts.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
||||
import TextFeature from '../format/TextFeature.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
||||
@@ -28,7 +28,7 @@ var Polyline = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
_ol_format_TextFeature_.call(this);
|
||||
TextFeature.call(this);
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
@@ -49,7 +49,7 @@ var Polyline = function(opt_options) {
|
||||
options.geometryLayout : GeometryLayout.XY;
|
||||
};
|
||||
|
||||
inherits(Polyline, _ol_format_TextFeature_);
|
||||
inherits(Polyline, TextFeature);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,11 +15,11 @@ import _ol_format_FormatType_ from '../format/FormatType.js';
|
||||
* @abstract
|
||||
* @extends {ol.format.Feature}
|
||||
*/
|
||||
var _ol_format_TextFeature_ = function() {
|
||||
var TextFeature = function() {
|
||||
FeatureFormat.call(this);
|
||||
};
|
||||
|
||||
inherits(_ol_format_TextFeature_, FeatureFormat);
|
||||
inherits(TextFeature, FeatureFormat);
|
||||
|
||||
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ inherits(_ol_format_TextFeature_, FeatureFormat);
|
||||
* @private
|
||||
* @return {string} Text.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.getText_ = function(source) {
|
||||
TextFeature.prototype.getText_ = function(source) {
|
||||
if (typeof source === 'string') {
|
||||
return source;
|
||||
} else {
|
||||
@@ -39,7 +39,7 @@ _ol_format_TextFeature_.prototype.getText_ = function(source) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.getType = function() {
|
||||
TextFeature.prototype.getType = function() {
|
||||
return _ol_format_FormatType_.TEXT;
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@ _ol_format_TextFeature_.prototype.getType = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readFeature = function(source, opt_options) {
|
||||
TextFeature.prototype.readFeature = function(source, opt_options) {
|
||||
return this.readFeatureFromText(
|
||||
this.getText_(source), this.adaptOptions(opt_options));
|
||||
};
|
||||
@@ -60,13 +60,13 @@ _ol_format_TextFeature_.prototype.readFeature = function(source, opt_options) {
|
||||
* @protected
|
||||
* @return {ol.Feature} Feature.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readFeatureFromText = function(text, opt_options) {};
|
||||
TextFeature.prototype.readFeatureFromText = function(text, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readFeatures = function(source, opt_options) {
|
||||
TextFeature.prototype.readFeatures = function(source, opt_options) {
|
||||
return this.readFeaturesFromText(
|
||||
this.getText_(source), this.adaptOptions(opt_options));
|
||||
};
|
||||
@@ -79,13 +79,13 @@ _ol_format_TextFeature_.prototype.readFeatures = function(source, opt_options) {
|
||||
* @protected
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readFeaturesFromText = function(text, opt_options) {};
|
||||
TextFeature.prototype.readFeaturesFromText = function(text, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readGeometry = function(source, opt_options) {
|
||||
TextFeature.prototype.readGeometry = function(source, opt_options) {
|
||||
return this.readGeometryFromText(
|
||||
this.getText_(source), this.adaptOptions(opt_options));
|
||||
};
|
||||
@@ -98,13 +98,13 @@ _ol_format_TextFeature_.prototype.readGeometry = function(source, opt_options) {
|
||||
* @protected
|
||||
* @return {ol.geom.Geometry} Geometry.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readGeometryFromText = function(text, opt_options) {};
|
||||
TextFeature.prototype.readGeometryFromText = function(text, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readProjection = function(source) {
|
||||
TextFeature.prototype.readProjection = function(source) {
|
||||
return this.readProjectionFromText(this.getText_(source));
|
||||
};
|
||||
|
||||
@@ -114,7 +114,7 @@ _ol_format_TextFeature_.prototype.readProjection = function(source) {
|
||||
* @protected
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readProjectionFromText = function(text) {
|
||||
TextFeature.prototype.readProjectionFromText = function(text) {
|
||||
return this.defaultDataProjection;
|
||||
};
|
||||
|
||||
@@ -122,7 +122,7 @@ _ol_format_TextFeature_.prototype.readProjectionFromText = function(text) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.writeFeature = function(feature, opt_options) {
|
||||
TextFeature.prototype.writeFeature = function(feature, opt_options) {
|
||||
return this.writeFeatureText(feature, this.adaptOptions(opt_options));
|
||||
};
|
||||
|
||||
@@ -134,13 +134,13 @@ _ol_format_TextFeature_.prototype.writeFeature = function(feature, opt_options)
|
||||
* @protected
|
||||
* @return {string} Text.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.writeFeatureText = function(feature, opt_options) {};
|
||||
TextFeature.prototype.writeFeatureText = function(feature, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.writeFeatures = function(
|
||||
TextFeature.prototype.writeFeatures = function(
|
||||
features, opt_options) {
|
||||
return this.writeFeaturesText(features, this.adaptOptions(opt_options));
|
||||
};
|
||||
@@ -153,13 +153,13 @@ _ol_format_TextFeature_.prototype.writeFeatures = function(
|
||||
* @protected
|
||||
* @return {string} Text.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.writeFeaturesText = function(features, opt_options) {};
|
||||
TextFeature.prototype.writeFeaturesText = function(features, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.writeGeometry = function(
|
||||
TextFeature.prototype.writeGeometry = function(
|
||||
geometry, opt_options) {
|
||||
return this.writeGeometryText(geometry, this.adaptOptions(opt_options));
|
||||
};
|
||||
@@ -172,5 +172,5 @@ _ol_format_TextFeature_.prototype.writeGeometry = function(
|
||||
* @protected
|
||||
* @return {string} Text.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.writeGeometryText = function(geometry, opt_options) {};
|
||||
export default _ol_format_TextFeature_;
|
||||
TextFeature.prototype.writeGeometryText = function(geometry, opt_options) {};
|
||||
export default TextFeature;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
||||
import TextFeature from '../format/TextFeature.js';
|
||||
import GeometryCollection from '../geom/GeometryCollection.js';
|
||||
import GeometryType from '../geom/GeometryType.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
@@ -30,7 +30,7 @@ var _ol_format_WKT_ = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
_ol_format_TextFeature_.call(this);
|
||||
TextFeature.call(this);
|
||||
|
||||
/**
|
||||
* Split GeometryCollection into multiple features.
|
||||
@@ -42,7 +42,7 @@ var _ol_format_WKT_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_format_WKT_, _ol_format_TextFeature_);
|
||||
inherits(_ol_format_WKT_, TextFeature);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@ import _ol_Feature_ from '../../../src/ol/Feature.js';
|
||||
import _ol_VectorImageTile_ from '../../../src/ol/VectorImageTile.js';
|
||||
import _ol_VectorTile_ from '../../../src/ol/VectorTile.js';
|
||||
import _ol_events_ from '../../../src/ol/events.js';
|
||||
import _ol_format_TextFeature_ from '../../../src/ol/format/TextFeature.js';
|
||||
import TextFeature from '../../../src/ol/format/TextFeature.js';
|
||||
import {get as getProjection} from '../../../src/ol/proj.js';
|
||||
import _ol_proj_Projection_ from '../../../src/ol/proj/Projection.js';
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('ol.VectorTile', function() {
|
||||
|
||||
it('loader sets features on the tile and updates proj units', function(done) {
|
||||
// mock format that return a tile-pixels feature
|
||||
var format = new _ol_format_TextFeature_();
|
||||
var format = new TextFeature();
|
||||
format.readProjection = function(source) {
|
||||
return new _ol_proj_Projection_({
|
||||
code: '',
|
||||
|
||||
Reference in New Issue
Block a user