@sswroom/sswr 1.6.14 → 1.6.16
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/Changelog +10 -0
- package/data.d.ts +1 -1
- package/data.js +1 -1
- package/exporter/GPXExporter.d.ts +12 -0
- package/exporter/GPXExporter.js +89 -0
- package/exporter/XLSXExporter.d.ts +5 -5
- package/exporter/XLSXExporter.js +398 -382
- package/leaflet.js +1 -1
- package/map.d.ts +14 -10
- package/map.js +57 -10
- package/package.json +1 -1
- package/spreadsheet.d.ts +216 -4
- package/spreadsheet.js +1073 -6
- package/web.d.ts +2 -0
- package/web.js +28 -0
package/Changelog
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
1.6.16
|
|
2
|
+
-Fixed leaflet point icon
|
|
3
|
+
|
|
4
|
+
1.6.15
|
|
5
|
+
-shreadsheet Support Chart
|
|
6
|
+
-Added web.getCanvasElement, web.getImgElement
|
|
7
|
+
-Added export/GPXExporter.js
|
|
8
|
+
-data.LocalDate.toString support undefined
|
|
9
|
+
-Enhance map.GPSTrack
|
|
10
|
+
|
|
1
11
|
1.6.14
|
|
2
12
|
-Added zip.ZIPBuilder
|
|
3
13
|
-Added Timestamp.toFILETIME
|
package/data.d.ts
CHANGED
|
@@ -120,7 +120,7 @@ export class LocalDate
|
|
|
120
120
|
setDay(day: number): void;
|
|
121
121
|
isYearLeap(): boolean;
|
|
122
122
|
toTicks(): number;
|
|
123
|
-
toString(pattern
|
|
123
|
+
toString(pattern?: string | null): string;
|
|
124
124
|
compareTo(obj: Date): number;
|
|
125
125
|
isNull(): boolean;
|
|
126
126
|
getWeekday(): Weekday;
|
package/data.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as data from "../data";
|
|
2
|
+
|
|
3
|
+
export class GPXExporter
|
|
4
|
+
{
|
|
5
|
+
constructor();
|
|
6
|
+
|
|
7
|
+
getName(): string;
|
|
8
|
+
isObjectSupported(pobj: data.ParsedObject): boolean;
|
|
9
|
+
getOutputExt(): string;
|
|
10
|
+
getOutputMIME(): string;
|
|
11
|
+
exportFile(fileName: string, pobj: data.ParsedObject, param?: object): Uint8Array|null;
|
|
12
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as data from "../data.js";
|
|
2
|
+
import * as map from "../map.js";
|
|
3
|
+
import * as math from "../math.js";
|
|
4
|
+
|
|
5
|
+
export class GPXExporter
|
|
6
|
+
{
|
|
7
|
+
constructor()
|
|
8
|
+
{
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
getName()
|
|
12
|
+
{
|
|
13
|
+
return "GPSExporter";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @param {data.ParsedObject} pobj
|
|
18
|
+
*/
|
|
19
|
+
isObjectSupported(pobj)
|
|
20
|
+
{
|
|
21
|
+
if (pobj instanceof map.GPSTrack)
|
|
22
|
+
{
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
getOutputExt()
|
|
29
|
+
{
|
|
30
|
+
return "gpx";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
getOutputMIME()
|
|
34
|
+
{
|
|
35
|
+
return "application/gpx+xml";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @param {string} fileName
|
|
40
|
+
* @param {data.ParsedObject} pobj
|
|
41
|
+
* @param {object|undefined} param
|
|
42
|
+
*/
|
|
43
|
+
exportFile(fileName, pobj, param)
|
|
44
|
+
{
|
|
45
|
+
let track = pobj;
|
|
46
|
+
if (!(track instanceof map.GPSTrack))
|
|
47
|
+
return null;
|
|
48
|
+
let sb = [];
|
|
49
|
+
let i;
|
|
50
|
+
let j;
|
|
51
|
+
let k;
|
|
52
|
+
let l;
|
|
53
|
+
let recs;
|
|
54
|
+
|
|
55
|
+
sb.push("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n");
|
|
56
|
+
sb.push("<gpx version=\"v1.0\" creator=\"sswr - https://github.com/sswroom/SClass\">\r\n");
|
|
57
|
+
sb.push("<trk>\r\n");
|
|
58
|
+
sb.push("<name>Track</name>\r\n");
|
|
59
|
+
i = 0;
|
|
60
|
+
j = track.getTrackCnt();
|
|
61
|
+
while (i < j)
|
|
62
|
+
{
|
|
63
|
+
if ((recs = track.getTrack(i)) != null)
|
|
64
|
+
{
|
|
65
|
+
sb.push("<trkseg>\r\n");
|
|
66
|
+
k = 0;
|
|
67
|
+
l = recs.length;
|
|
68
|
+
while (k < l)
|
|
69
|
+
{
|
|
70
|
+
sb.push("<trkpt lat=\""+recs[k].lat+"\" lon=\""+recs[k].lon+"\">\r\n");
|
|
71
|
+
sb.push("<ele>"+recs[k].altitude+"</ele>");
|
|
72
|
+
sb.push("<time>"+data.Timestamp.fromTicks(recs[k].recTime, 0).toString("yyyy-MM-ddTHH:mm:ssZ")+"</time>\r\n");
|
|
73
|
+
sb.push("<desc>lat.="+math.roundToStr(recs[k].lat, 6)+", lon.="+math.roundToStr(recs[k].lon, 6));
|
|
74
|
+
sb.push(", Alt.="+math.roundToStr(recs[k].altitude, 6)+"m, Speed="+math.roundToStr(recs[k].speed * 1.852, 6)+"m/h.</desc>\r\n");
|
|
75
|
+
sb.push("<speed>"+math.roundToStr(recs[k].speed * 1.852 / 3.6, 6)+"</speed>\r\n");
|
|
76
|
+
sb.push("</trkpt>\r\n");
|
|
77
|
+
|
|
78
|
+
k++;
|
|
79
|
+
}
|
|
80
|
+
sb.push("</trkseg>\r\n");
|
|
81
|
+
}
|
|
82
|
+
i++;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
sb.push("</trk>\r\n");
|
|
86
|
+
sb.push("</gpx>\r\n");
|
|
87
|
+
return new TextEncoder().encode(sb.join(""));
|
|
88
|
+
}
|
|
89
|
+
};
|
|
@@ -26,12 +26,12 @@ export class XLSXExporter
|
|
|
26
26
|
getOutputMIME(): string;
|
|
27
27
|
exportFile(fileName: string, pobj: data.ParsedObject, param?: object): Uint8Array|null;
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
static appendFill(sb: string[], fill: spreadsheet.OfficeFill|null): void;
|
|
30
|
+
static appendLineStyle(sb: string[], lineStyle: spreadsheet.OfficeLineStyle|null): void;
|
|
31
31
|
static appendTitle(sb: string[], title: string): void;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
static appendShapeProp(sb: string[], shapeProp: spreadsheet.OfficeShapeProp): void;
|
|
33
|
+
static appendAxis(sb: string[], axis: spreadsheet.OfficeChartAxis, index: number): void;
|
|
34
|
+
static appendSeries(sb: string[], series: spreadsheet.OfficeChartSeries, index: number): void;
|
|
35
35
|
static appendBorder(sb: string[], border: spreadsheet.BorderStyle, name: string): void;
|
|
36
36
|
static appendXF(sb: string[], style: spreadsheet.CellStyle, borders: BorderInfo[], workbook: spreadsheet.Workbook, numFmtMap: object): void;
|
|
37
37
|
|