ol 9.1.1-dev.1711967330431 → 9.1.1-dev.1711989777856

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/format/IGC.d.ts CHANGED
@@ -35,6 +35,36 @@ declare class IGC extends TextFeature {
35
35
  * @type {IGCZ}
36
36
  */
37
37
  private altitudeMode_;
38
+ /**
39
+ * @private
40
+ * @type {boolean}
41
+ */
42
+ private lad_;
43
+ /**
44
+ * @private
45
+ * @type {boolean}
46
+ */
47
+ private lod_;
48
+ /**
49
+ * @private
50
+ * @type {number}
51
+ */
52
+ private ladStart_;
53
+ /**
54
+ * @private
55
+ * @type {number}
56
+ */
57
+ private ladStop_;
58
+ /**
59
+ * @private
60
+ * @type {number}
61
+ */
62
+ private lodStart_;
63
+ /**
64
+ * @private
65
+ * @type {number}
66
+ */
67
+ private lodStop_;
38
68
  }
39
69
  import TextFeature from './TextFeature.js';
40
70
  //# sourceMappingURL=IGC.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IGC.d.ts","sourceRoot":"","sources":["IGC.js"],"names":[],"mappings":";;;;mBAUa,YAAY,GAAG,KAAK,GAAG,MAAM;;;;;;;;AA+B1C;;;;GAIG;AAEH;;;;;;;;;GASG;AACH;IACE;;OAEG;IACH,2CAeC;IALC;;;OAGG;IACH,sBAAyE;CAgG5E;wBAtKuB,kBAAkB"}
1
+ {"version":3,"file":"IGC.d.ts","sourceRoot":"","sources":["IGC.js"],"names":[],"mappings":";;;;mBAUa,YAAY,GAAG,KAAK,GAAG,MAAM;;;;;;;;AAqC1C;;;;GAIG;AAEH;;;;;;;;;GASG;AACH;IACE;;OAEG;IACH,2CAmDC;IAzCC;;;OAGG;IACH,sBAAyE;IAEzE;;;OAGG;IACH,aAAiB;IAEjB;;;OAGG;IACH,aAAiB;IAEjB;;;OAGG;IACH,kBAAkB;IAElB;;;OAGG;IACH,iBAAiB;IAEjB;;;OAGG;IACH,kBAAkB;IAElB;;;OAGG;IACH,iBAAiB;CAsIpB;wBAtPuB,kBAAkB"}
package/format/IGC.js CHANGED
@@ -31,6 +31,12 @@ const H_RECORD_RE = /^H.([A-Z]{3}).*?:(.*)/;
31
31
  */
32
32
  const HFDTE_RECORD_RE = /^HFDTE(\d{2})(\d{2})(\d{2})/;
33
33
 
34
+ /**
35
+ * @const
36
+ * @type {RegExp}
37
+ */
38
+ const HFDTEDATE_RECORD_RE = /^HFDTEDATE:(\d{2})(\d{2})(\d{2}),(\d{2})/;
39
+
34
40
  /**
35
41
  * A regular expression matching the newline characters `\r\n`, `\r` and `\n`.
36
42
  *
@@ -74,6 +80,42 @@ class IGC extends TextFeature {
74
80
  * @type {IGCZ}
75
81
  */
76
82
  this.altitudeMode_ = options.altitudeMode ? options.altitudeMode : 'none';
83
+
84
+ /**
85
+ * @private
86
+ * @type {boolean}
87
+ */
88
+ this.lad_ = false;
89
+
90
+ /**
91
+ * @private
92
+ * @type {boolean}
93
+ */
94
+ this.lod_ = false;
95
+
96
+ /**
97
+ * @private
98
+ * @type {number}
99
+ */
100
+ this.ladStart_ = 0;
101
+
102
+ /**
103
+ * @private
104
+ * @type {number}
105
+ */
106
+ this.ladStop_ = 0;
107
+
108
+ /**
109
+ * @private
110
+ * @type {number}
111
+ */
112
+ this.lodStart_ = 0;
113
+
114
+ /**
115
+ * @private
116
+ * @type {number}
117
+ */
118
+ this.lodStop_ = 0;
77
119
  }
78
120
 
79
121
  /**
@@ -103,10 +145,22 @@ class IGC extends TextFeature {
103
145
  const minute = parseInt(m[2], 10);
104
146
  const second = parseInt(m[3], 10);
105
147
  let y = parseInt(m[4], 10) + parseInt(m[5], 10) / 60000;
148
+ if (this.lad_) {
149
+ y +=
150
+ parseInt(line.slice(this.ladStart_, this.ladStop_), 10) /
151
+ 60000 /
152
+ 10 ** (this.ladStop_ - this.ladStart_);
153
+ }
106
154
  if (m[6] == 'S') {
107
155
  y = -y;
108
156
  }
109
157
  let x = parseInt(m[7], 10) + parseInt(m[8], 10) / 60000;
158
+ if (this.lod_) {
159
+ x +=
160
+ parseInt(line.slice(this.lodStart_, this.lodStop_), 10) /
161
+ 60000 /
162
+ 10 ** (this.lodStop_ - this.lodStart_);
163
+ }
110
164
  if (m[9] == 'W') {
111
165
  x = -x;
112
166
  }
@@ -131,15 +185,41 @@ class IGC extends TextFeature {
131
185
  lastDateTime = dateTime;
132
186
  }
133
187
  } else if (line.charAt(0) == 'H') {
134
- m = HFDTE_RECORD_RE.exec(line);
188
+ m = HFDTEDATE_RECORD_RE.exec(line);
135
189
  if (m) {
136
190
  day = parseInt(m[1], 10);
137
191
  month = parseInt(m[2], 10) - 1;
138
192
  year = 2000 + parseInt(m[3], 10);
139
193
  } else {
140
- m = H_RECORD_RE.exec(line);
194
+ m = HFDTE_RECORD_RE.exec(line);
141
195
  if (m) {
142
- properties[m[1]] = m[2].trim();
196
+ day = parseInt(m[1], 10);
197
+ month = parseInt(m[2], 10) - 1;
198
+ year = 2000 + parseInt(m[3], 10);
199
+ } else {
200
+ m = H_RECORD_RE.exec(line);
201
+ if (m) {
202
+ properties[m[1]] = m[2].trim();
203
+ }
204
+ }
205
+ }
206
+ } else if (line.charAt(0) == 'I') {
207
+ const numberAdds = parseInt(line.slice(1, 3), 10);
208
+ for (let i = 0; i < numberAdds; i++) {
209
+ const addCode = line.slice(7 + i * 7, 10 + i * 7);
210
+ if (addCode === 'LAD' || addCode === 'LOD') {
211
+ // in IGC format, columns are numbered from 1
212
+ const addStart = parseInt(line.slice(3 + i * 7, 5 + i * 7), 10) - 1;
213
+ const addStop = parseInt(line.slice(5 + i * 7, 7 + i * 7), 10);
214
+ if (addCode === 'LAD') {
215
+ this.lad_ = true;
216
+ this.ladStart_ = addStart;
217
+ this.ladStop_ = addStop;
218
+ } else if (addCode === 'LOD') {
219
+ this.lod_ = true;
220
+ this.lodStart_ = addStart;
221
+ this.lodStop_ = addStop;
222
+ }
143
223
  }
144
224
  }
145
225
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ol",
3
- "version": "9.1.1-dev.1711967330431",
3
+ "version": "9.1.1-dev.1711989777856",
4
4
  "description": "OpenLayers mapping library",
5
5
  "keywords": [
6
6
  "map",
package/util.js CHANGED
@@ -33,4 +33,4 @@ export function getUid(obj) {
33
33
  * OpenLayers version.
34
34
  * @type {string}
35
35
  */
36
- export const VERSION = '9.1.1-dev.1711967330431';
36
+ export const VERSION = '9.1.1-dev.1711989777856';