Rename _ol_format_IGC_ to IGC

This commit is contained in:
Tim Schaub
2017-12-17 01:53:48 -07:00
parent 55ab1bc24a
commit 04230086a4
5 changed files with 28 additions and 28 deletions

View File

@@ -2,7 +2,7 @@ import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import GPX from '../src/ol/format/GPX.js';
import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_format_IGC_ from '../src/ol/format/IGC.js';
import IGC from '../src/ol/format/IGC.js';
import _ol_format_KML_ from '../src/ol/format/KML.js';
import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
import _ol_interaction_ from '../src/ol/interaction.js';
@@ -87,7 +87,7 @@ var dragAndDropInteraction = new DragAndDrop({
formatConstructors: [
GPX,
GeoJSON,
_ol_format_IGC_,
IGC,
_ol_format_KML_,
_ol_format_TopoJSON_
]

View File

@@ -2,7 +2,7 @@ import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import GPX from '../src/ol/format/GPX.js';
import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_format_IGC_ from '../src/ol/format/IGC.js';
import IGC from '../src/ol/format/IGC.js';
import _ol_format_KML_ from '../src/ol/format/KML.js';
import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
import _ol_interaction_ from '../src/ol/interaction.js';
@@ -87,7 +87,7 @@ var dragAndDropInteraction = new DragAndDrop({
formatConstructors: [
GPX,
GeoJSON,
_ol_format_IGC_,
IGC,
_ol_format_KML_,
_ol_format_TopoJSON_
]

View File

@@ -2,7 +2,7 @@ import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_format_IGC_ from '../src/ol/format/IGC.js';
import IGC from '../src/ol/format/IGC.js';
import LineString from '../src/ol/geom/LineString.js';
import Point from '../src/ol/geom/Point.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
@@ -58,7 +58,7 @@ function get(url, callback) {
client.send();
}
var igcFormat = new _ol_format_IGC_();
var igcFormat = new IGC();
for (var i = 0; i < igcUrls.length; ++i) {
get(igcUrls[i], function(data) {
var features = igcFormat.readFeatures(data,

View File

@@ -19,7 +19,7 @@ import {get as getProjection} from '../proj.js';
* @param {olx.format.IGCOptions=} opt_options Options.
* @api
*/
var _ol_format_IGC_ = function(opt_options) {
var IGC = function(opt_options) {
var options = opt_options ? opt_options : {};
@@ -39,7 +39,7 @@ var _ol_format_IGC_ = function(opt_options) {
};
inherits(_ol_format_IGC_, _ol_format_TextFeature_);
inherits(IGC, _ol_format_TextFeature_);
/**
@@ -47,7 +47,7 @@ inherits(_ol_format_IGC_, _ol_format_TextFeature_);
* @type {RegExp}
* @private
*/
_ol_format_IGC_.B_RECORD_RE_ =
IGC.B_RECORD_RE_ =
/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/;
@@ -56,7 +56,7 @@ _ol_format_IGC_.B_RECORD_RE_ =
* @type {RegExp}
* @private
*/
_ol_format_IGC_.H_RECORD_RE_ = /^H.([A-Z]{3}).*?:(.*)/;
IGC.H_RECORD_RE_ = /^H.([A-Z]{3}).*?:(.*)/;
/**
@@ -64,7 +64,7 @@ _ol_format_IGC_.H_RECORD_RE_ = /^H.([A-Z]{3}).*?:(.*)/;
* @type {RegExp}
* @private
*/
_ol_format_IGC_.HFDTE_RECORD_RE_ = /^HFDTE(\d{2})(\d{2})(\d{2})/;
IGC.HFDTE_RECORD_RE_ = /^HFDTE(\d{2})(\d{2})(\d{2})/;
/**
@@ -74,7 +74,7 @@ _ol_format_IGC_.HFDTE_RECORD_RE_ = /^HFDTE(\d{2})(\d{2})(\d{2})/;
* @type {RegExp}
* @private
*/
_ol_format_IGC_.NEWLINE_RE_ = /\r\n|\r|\n/;
IGC.NEWLINE_RE_ = /\r\n|\r|\n/;
/**
@@ -86,15 +86,15 @@ _ol_format_IGC_.NEWLINE_RE_ = /\r\n|\r|\n/;
* @return {ol.Feature} Feature.
* @api
*/
_ol_format_IGC_.prototype.readFeature;
IGC.prototype.readFeature;
/**
* @inheritDoc
*/
_ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
IGC.prototype.readFeatureFromText = function(text, opt_options) {
var altitudeMode = this.altitudeMode_;
var lines = text.split(_ol_format_IGC_.NEWLINE_RE_);
var lines = text.split(IGC.NEWLINE_RE_);
/** @type {Object.<string, string>} */
var properties = {};
var flatCoordinates = [];
@@ -107,7 +107,7 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
var line = lines[i];
var m;
if (line.charAt(0) == 'B') {
m = _ol_format_IGC_.B_RECORD_RE_.exec(line);
m = IGC.B_RECORD_RE_.exec(line);
if (m) {
var hour = parseInt(m[1], 10);
var minute = parseInt(m[2], 10);
@@ -141,13 +141,13 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
lastDateTime = dateTime;
}
} else if (line.charAt(0) == 'H') {
m = _ol_format_IGC_.HFDTE_RECORD_RE_.exec(line);
m = IGC.HFDTE_RECORD_RE_.exec(line);
if (m) {
day = parseInt(m[1], 10);
month = parseInt(m[2], 10) - 1;
year = 2000 + parseInt(m[3], 10);
} else {
m = _ol_format_IGC_.H_RECORD_RE_.exec(line);
m = IGC.H_RECORD_RE_.exec(line);
if (m) {
properties[m[1]] = m[2].trim();
}
@@ -178,13 +178,13 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
* @return {Array.<ol.Feature>} Features.
* @api
*/
_ol_format_IGC_.prototype.readFeatures;
IGC.prototype.readFeatures;
/**
* @inheritDoc
*/
_ol_format_IGC_.prototype.readFeaturesFromText = function(text, opt_options) {
IGC.prototype.readFeaturesFromText = function(text, opt_options) {
var feature = this.readFeatureFromText(text, opt_options);
if (feature) {
return [feature];
@@ -202,33 +202,33 @@ _ol_format_IGC_.prototype.readFeaturesFromText = function(text, opt_options) {
* @return {ol.proj.Projection} Projection.
* @api
*/
_ol_format_IGC_.prototype.readProjection;
IGC.prototype.readProjection;
/**
* Not implemented.
* @inheritDoc
*/
_ol_format_IGC_.prototype.writeFeatureText = function(feature, opt_options) {};
IGC.prototype.writeFeatureText = function(feature, opt_options) {};
/**
* Not implemented.
* @inheritDoc
*/
_ol_format_IGC_.prototype.writeFeaturesText = function(features, opt_options) {};
IGC.prototype.writeFeaturesText = function(features, opt_options) {};
/**
* Not implemented.
* @inheritDoc
*/
_ol_format_IGC_.prototype.writeGeometryText = function(geometry, opt_options) {};
IGC.prototype.writeGeometryText = function(geometry, opt_options) {};
/**
* Not implemented.
* @inheritDoc
*/
_ol_format_IGC_.prototype.readGeometryFromText = function(text, opt_options) {};
export default _ol_format_IGC_;
IGC.prototype.readGeometryFromText = function(text, opt_options) {};
export default IGC;

View File

@@ -1,4 +1,4 @@
import _ol_format_IGC_ from '../../../../src/ol/format/IGC.js';
import IGC from '../../../../src/ol/format/IGC.js';
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
@@ -29,7 +29,7 @@ describe('ol.format.IGC', function() {
'G60189641B00B00800019000000000000';
beforeEach(function() {
format = new _ol_format_IGC_();
format = new IGC();
});
describe('#readProjectionFromText', function() {