From cc08dcd2ca4bf061dbafb1b72a0b56e465e65510 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sun, 17 Dec 2017 02:06:43 -0700 Subject: [PATCH] Rename _ol_format_TextFeature_ to TextFeature --- src/ol/format/IGC.js | 6 +++--- src/ol/format/Polyline.js | 6 +++--- src/ol/format/TextFeature.js | 38 ++++++++++++++++----------------- src/ol/format/WKT.js | 6 +++--- test/spec/ol/vectortile.test.js | 4 ++-- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/ol/format/IGC.js b/src/ol/format/IGC.js index 7376bdbfd7..5bc8e137ff 100644 --- a/src/ol/format/IGC.js +++ b/src/ol/format/IGC.js @@ -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); /** diff --git a/src/ol/format/Polyline.js b/src/ol/format/Polyline.js index c42d1a88cd..282be5f3b5 100644 --- a/src/ol/format/Polyline.js +++ b/src/ol/format/Polyline.js @@ -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); /** diff --git a/src/ol/format/TextFeature.js b/src/ol/format/TextFeature.js index c66e027519..31543cfa02 100644 --- a/src/ol/format/TextFeature.js +++ b/src/ol/format/TextFeature.js @@ -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.} 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; diff --git a/src/ol/format/WKT.js b/src/ol/format/WKT.js index 1528030a73..f3c3a9e599 100644 --- a/src/ol/format/WKT.js +++ b/src/ol/format/WKT.js @@ -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); /** diff --git a/test/spec/ol/vectortile.test.js b/test/spec/ol/vectortile.test.js index 8bdda00f26..4cb6e2453e 100644 --- a/test/spec/ol/vectortile.test.js +++ b/test/spec/ol/vectortile.test.js @@ -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: '',