Rename _ol_format_IGC_ to IGC
This commit is contained in:
@@ -2,7 +2,7 @@ import _ol_Map_ from '../src/ol/Map.js';
|
|||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import GPX from '../src/ol/format/GPX.js';
|
import GPX from '../src/ol/format/GPX.js';
|
||||||
import GeoJSON from '../src/ol/format/GeoJSON.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_KML_ from '../src/ol/format/KML.js';
|
||||||
import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
|
import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import _ol_interaction_ from '../src/ol/interaction.js';
|
||||||
@@ -87,7 +87,7 @@ var dragAndDropInteraction = new DragAndDrop({
|
|||||||
formatConstructors: [
|
formatConstructors: [
|
||||||
GPX,
|
GPX,
|
||||||
GeoJSON,
|
GeoJSON,
|
||||||
_ol_format_IGC_,
|
IGC,
|
||||||
_ol_format_KML_,
|
_ol_format_KML_,
|
||||||
_ol_format_TopoJSON_
|
_ol_format_TopoJSON_
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import _ol_Map_ from '../src/ol/Map.js';
|
|||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import GPX from '../src/ol/format/GPX.js';
|
import GPX from '../src/ol/format/GPX.js';
|
||||||
import GeoJSON from '../src/ol/format/GeoJSON.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_KML_ from '../src/ol/format/KML.js';
|
||||||
import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
|
import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import _ol_interaction_ from '../src/ol/interaction.js';
|
||||||
@@ -87,7 +87,7 @@ var dragAndDropInteraction = new DragAndDrop({
|
|||||||
formatConstructors: [
|
formatConstructors: [
|
||||||
GPX,
|
GPX,
|
||||||
GeoJSON,
|
GeoJSON,
|
||||||
_ol_format_IGC_,
|
IGC,
|
||||||
_ol_format_KML_,
|
_ol_format_KML_,
|
||||||
_ol_format_TopoJSON_
|
_ol_format_TopoJSON_
|
||||||
]
|
]
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import _ol_Feature_ from '../src/ol/Feature.js';
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_control_ from '../src/ol/control.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 LineString from '../src/ol/geom/LineString.js';
|
||||||
import Point from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
@@ -58,7 +58,7 @@ function get(url, callback) {
|
|||||||
client.send();
|
client.send();
|
||||||
}
|
}
|
||||||
|
|
||||||
var igcFormat = new _ol_format_IGC_();
|
var igcFormat = new IGC();
|
||||||
for (var i = 0; i < igcUrls.length; ++i) {
|
for (var i = 0; i < igcUrls.length; ++i) {
|
||||||
get(igcUrls[i], function(data) {
|
get(igcUrls[i], function(data) {
|
||||||
var features = igcFormat.readFeatures(data,
|
var features = igcFormat.readFeatures(data,
|
||||||
|
|||||||
+20
-20
@@ -19,7 +19,7 @@ import {get as getProjection} from '../proj.js';
|
|||||||
* @param {olx.format.IGCOptions=} opt_options Options.
|
* @param {olx.format.IGCOptions=} opt_options Options.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
var _ol_format_IGC_ = function(opt_options) {
|
var IGC = function(opt_options) {
|
||||||
|
|
||||||
var options = opt_options ? 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}
|
* @type {RegExp}
|
||||||
* @private
|
* @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})/;
|
/^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}
|
* @type {RegExp}
|
||||||
* @private
|
* @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}
|
* @type {RegExp}
|
||||||
* @private
|
* @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}
|
* @type {RegExp}
|
||||||
* @private
|
* @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.
|
* @return {ol.Feature} Feature.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_format_IGC_.prototype.readFeature;
|
IGC.prototype.readFeature;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
|
IGC.prototype.readFeatureFromText = function(text, opt_options) {
|
||||||
var altitudeMode = this.altitudeMode_;
|
var altitudeMode = this.altitudeMode_;
|
||||||
var lines = text.split(_ol_format_IGC_.NEWLINE_RE_);
|
var lines = text.split(IGC.NEWLINE_RE_);
|
||||||
/** @type {Object.<string, string>} */
|
/** @type {Object.<string, string>} */
|
||||||
var properties = {};
|
var properties = {};
|
||||||
var flatCoordinates = [];
|
var flatCoordinates = [];
|
||||||
@@ -107,7 +107,7 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
|
|||||||
var line = lines[i];
|
var line = lines[i];
|
||||||
var m;
|
var m;
|
||||||
if (line.charAt(0) == 'B') {
|
if (line.charAt(0) == 'B') {
|
||||||
m = _ol_format_IGC_.B_RECORD_RE_.exec(line);
|
m = IGC.B_RECORD_RE_.exec(line);
|
||||||
if (m) {
|
if (m) {
|
||||||
var hour = parseInt(m[1], 10);
|
var hour = parseInt(m[1], 10);
|
||||||
var minute = parseInt(m[2], 10);
|
var minute = parseInt(m[2], 10);
|
||||||
@@ -141,13 +141,13 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
|
|||||||
lastDateTime = dateTime;
|
lastDateTime = dateTime;
|
||||||
}
|
}
|
||||||
} else if (line.charAt(0) == 'H') {
|
} else if (line.charAt(0) == 'H') {
|
||||||
m = _ol_format_IGC_.HFDTE_RECORD_RE_.exec(line);
|
m = IGC.HFDTE_RECORD_RE_.exec(line);
|
||||||
if (m) {
|
if (m) {
|
||||||
day = parseInt(m[1], 10);
|
day = parseInt(m[1], 10);
|
||||||
month = parseInt(m[2], 10) - 1;
|
month = parseInt(m[2], 10) - 1;
|
||||||
year = 2000 + parseInt(m[3], 10);
|
year = 2000 + parseInt(m[3], 10);
|
||||||
} else {
|
} else {
|
||||||
m = _ol_format_IGC_.H_RECORD_RE_.exec(line);
|
m = IGC.H_RECORD_RE_.exec(line);
|
||||||
if (m) {
|
if (m) {
|
||||||
properties[m[1]] = m[2].trim();
|
properties[m[1]] = m[2].trim();
|
||||||
}
|
}
|
||||||
@@ -178,13 +178,13 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
|
|||||||
* @return {Array.<ol.Feature>} Features.
|
* @return {Array.<ol.Feature>} Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_format_IGC_.prototype.readFeatures;
|
IGC.prototype.readFeatures;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_format_IGC_.prototype.readFeaturesFromText = function(text, opt_options) {
|
IGC.prototype.readFeaturesFromText = function(text, opt_options) {
|
||||||
var feature = this.readFeatureFromText(text, opt_options);
|
var feature = this.readFeatureFromText(text, opt_options);
|
||||||
if (feature) {
|
if (feature) {
|
||||||
return [feature];
|
return [feature];
|
||||||
@@ -202,33 +202,33 @@ _ol_format_IGC_.prototype.readFeaturesFromText = function(text, opt_options) {
|
|||||||
* @return {ol.proj.Projection} Projection.
|
* @return {ol.proj.Projection} Projection.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_format_IGC_.prototype.readProjection;
|
IGC.prototype.readProjection;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Not implemented.
|
* Not implemented.
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_format_IGC_.prototype.writeFeatureText = function(feature, opt_options) {};
|
IGC.prototype.writeFeatureText = function(feature, opt_options) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Not implemented.
|
* Not implemented.
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_format_IGC_.prototype.writeFeaturesText = function(features, opt_options) {};
|
IGC.prototype.writeFeaturesText = function(features, opt_options) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Not implemented.
|
* Not implemented.
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_format_IGC_.prototype.writeGeometryText = function(geometry, opt_options) {};
|
IGC.prototype.writeGeometryText = function(geometry, opt_options) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Not implemented.
|
* Not implemented.
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_format_IGC_.prototype.readGeometryFromText = function(text, opt_options) {};
|
IGC.prototype.readGeometryFromText = function(text, opt_options) {};
|
||||||
export default _ol_format_IGC_;
|
export default IGC;
|
||||||
|
|||||||
@@ -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 _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||||
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
|
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ describe('ol.format.IGC', function() {
|
|||||||
'G60189641B00B00800019000000000000';
|
'G60189641B00B00800019000000000000';
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
format = new _ol_format_IGC_();
|
format = new IGC();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('#readProjectionFromText', function() {
|
describe('#readProjectionFromText', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user