@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/leaflet.js
CHANGED
|
@@ -179,7 +179,7 @@ export function createFromGeometry(geom, options)
|
|
|
179
179
|
{
|
|
180
180
|
if (options.name)
|
|
181
181
|
opt.title = options.name;
|
|
182
|
-
if (options.icon && options.icon.iconUrl)
|
|
182
|
+
if (options.icon && options.icon.options.iconUrl)
|
|
183
183
|
opt.icon = options.icon;
|
|
184
184
|
}
|
|
185
185
|
return L.marker(L.latLng(geom.coordinates[1], geom.coordinates[0]), opt);
|
package/map.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as data from "./data";
|
|
2
2
|
import * as geometry from "./geometry";
|
|
3
3
|
import * as kml from "./kml";
|
|
4
4
|
import * as map from "./map";
|
|
@@ -82,22 +82,26 @@ export function getLayerData(svcUrl: string, onResultFunc: Function, layerName:
|
|
|
82
82
|
|
|
83
83
|
declare class GPSRecord
|
|
84
84
|
{
|
|
85
|
-
|
|
85
|
+
recTime: number;
|
|
86
86
|
lat: number;
|
|
87
87
|
lon: number;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
altitude: number;
|
|
89
|
+
speed: number;
|
|
90
|
+
heading: number;
|
|
91
|
+
valid: boolean;
|
|
92
|
+
sateUsed: number;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
export class GPSTrack
|
|
95
|
+
export class GPSTrack extends data.ParsedObject
|
|
96
96
|
{
|
|
97
97
|
recs: GPSRecord[];
|
|
98
|
-
|
|
98
|
+
|
|
99
|
+
constructor(recs: GPSRecord[], sourceName?: string);
|
|
100
|
+
addPosition(pos: GeolocationPosition);
|
|
101
|
+
getTrackCnt(): number;
|
|
102
|
+
getTrack(index: number): GPSRecord[]|null;
|
|
99
103
|
createLineString(): geometry.LineString;
|
|
100
|
-
getPosByTime(ts: Timestamp): math.Vector3;
|
|
104
|
+
getPosByTime(ts: data.Timestamp): math.Vector3;
|
|
101
105
|
getPosByTicks(ticks: number): math.Vector3;
|
|
102
106
|
}
|
|
103
107
|
|
package/map.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as data from "./data.js";
|
|
1
2
|
import * as geometry from "./geometry.js";
|
|
2
3
|
import * as math from "./math.js";
|
|
3
4
|
import * as web from "./web.js";
|
|
@@ -46,6 +47,9 @@ export function calcDistance(srid, geom, x, y)
|
|
|
46
47
|
return csys.calcSurfaceDistance(x, y, pt.x, pt.y, unit.Distance.Unit.METER);
|
|
47
48
|
}
|
|
48
49
|
|
|
50
|
+
/**
|
|
51
|
+
* @param {string} svcUrl
|
|
52
|
+
*/
|
|
49
53
|
export function getLayers(svcUrl, onResultFunc)
|
|
50
54
|
{
|
|
51
55
|
web.loadJSON(svcUrl + '/getlayers', onResultFunc);
|
|
@@ -56,13 +60,49 @@ export function getLayerData(svcUrl, onResultFunc, layerName, dataFormat)
|
|
|
56
60
|
web.loadJSON(svcUrl + '/getlayerdata?name='+encodeURIComponent(layerName)+"&fmt="+encodeURIComponent(dataFormat), onResultFunc);
|
|
57
61
|
}
|
|
58
62
|
|
|
59
|
-
export class GPSTrack
|
|
63
|
+
export class GPSTrack extends data.ParsedObject
|
|
60
64
|
{
|
|
61
|
-
|
|
65
|
+
/**
|
|
66
|
+
* @param {{recTime: number;lat: number;lon: number;altitude: number;speed: number;heading: number;valid: boolean;sateUsed: number;}[]} recs
|
|
67
|
+
* @param {string|undefined} sourceName
|
|
68
|
+
*/
|
|
69
|
+
constructor(recs, sourceName)
|
|
62
70
|
{
|
|
71
|
+
super(sourceName||"Untitled.gpx", "GPSTrack");
|
|
63
72
|
this.recs = recs;
|
|
64
73
|
}
|
|
65
74
|
|
|
75
|
+
/**
|
|
76
|
+
* @param {GeolocationPosition} pos
|
|
77
|
+
*/
|
|
78
|
+
addPosition(pos)
|
|
79
|
+
{
|
|
80
|
+
this.recs.push({
|
|
81
|
+
recTime: pos.timestamp,
|
|
82
|
+
lat: pos.coords.latitude,
|
|
83
|
+
lon: pos.coords.longitude,
|
|
84
|
+
altitude: pos.coords.altitude || 0,
|
|
85
|
+
heading: pos.coords.heading||0,
|
|
86
|
+
speed: (pos.coords.speed || 0) * 3.6 / 1.852,
|
|
87
|
+
valid: true,
|
|
88
|
+
sateUsed: -1});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
getTrackCnt()
|
|
92
|
+
{
|
|
93
|
+
return 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @param {number} index
|
|
98
|
+
*/
|
|
99
|
+
getTrack(index)
|
|
100
|
+
{
|
|
101
|
+
if (index == 0)
|
|
102
|
+
return this.recs;
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
|
|
66
106
|
createLineString()
|
|
67
107
|
{
|
|
68
108
|
let coordinates = new Array();
|
|
@@ -70,20 +110,26 @@ export class GPSTrack
|
|
|
70
110
|
let j = this.recs.length;
|
|
71
111
|
while (i < j)
|
|
72
112
|
{
|
|
73
|
-
coordinates.push([this.recs[i].lon, this.recs[i].lat, this.recs[i].
|
|
113
|
+
coordinates.push([this.recs[i].lon, this.recs[i].lat, this.recs[i].altitude]);
|
|
74
114
|
i++;
|
|
75
115
|
}
|
|
76
116
|
return new geometry.LineString(4326, coordinates);
|
|
77
117
|
}
|
|
78
118
|
|
|
119
|
+
/**
|
|
120
|
+
* @param {data.Timestamp} ts
|
|
121
|
+
*/
|
|
79
122
|
getPosByTime(ts)
|
|
80
123
|
{
|
|
81
124
|
return this.getPosByTicks(ts.toTicks());
|
|
82
125
|
}
|
|
83
126
|
|
|
127
|
+
/**
|
|
128
|
+
* @param {number} ticks
|
|
129
|
+
*/
|
|
84
130
|
getPosByTicks(ticks)
|
|
85
131
|
{
|
|
86
|
-
if (ticks >= this.recs[0].
|
|
132
|
+
if (ticks >= this.recs[0].recTime && ticks <= this.recs[this.recs.length - 1].recTime)
|
|
87
133
|
{
|
|
88
134
|
let i = 0;
|
|
89
135
|
let j = this.recs.length - 1;
|
|
@@ -92,7 +138,7 @@ export class GPSTrack
|
|
|
92
138
|
while (i <= j)
|
|
93
139
|
{
|
|
94
140
|
k = (i + j) >> 1;
|
|
95
|
-
l = this.recs[k].
|
|
141
|
+
l = this.recs[k].recTime;
|
|
96
142
|
if (ticks > l)
|
|
97
143
|
{
|
|
98
144
|
i = k + 1;
|
|
@@ -103,17 +149,17 @@ export class GPSTrack
|
|
|
103
149
|
}
|
|
104
150
|
else
|
|
105
151
|
{
|
|
106
|
-
return new math.Vector3(this.recs[k].lon, this.recs[k].lat, this.recs[k].
|
|
152
|
+
return new math.Vector3(this.recs[k].lon, this.recs[k].lat, this.recs[k].altitude);
|
|
107
153
|
}
|
|
108
154
|
}
|
|
109
155
|
let tDiff;
|
|
110
156
|
let rec1 = this.recs[i - 1];
|
|
111
157
|
let rec2 = this.recs[i];
|
|
112
|
-
tDiff = rec2.
|
|
158
|
+
tDiff = rec2.recTime - rec1.recTime;
|
|
113
159
|
return new math.Vector3(
|
|
114
|
-
(rec1.lon * (rec2.
|
|
115
|
-
(rec1.lat * (rec2.
|
|
116
|
-
(rec1.
|
|
160
|
+
(rec1.lon * (rec2.recTime - ticks) + rec2.lon * (ticks - rec1.recTime)) / tDiff,
|
|
161
|
+
(rec1.lat * (rec2.recTime - ticks) + rec2.lat * (ticks - rec1.recTime)) / tDiff,
|
|
162
|
+
(rec1.altitude * (rec2.recTime - ticks) + rec2.altitude * (ticks - rec1.recTime)) / tDiff);
|
|
117
163
|
}
|
|
118
164
|
return new math.Vector3(0, 0, 0);
|
|
119
165
|
}
|
|
@@ -181,6 +227,7 @@ export class WMS
|
|
|
181
227
|
let node = doc.childNodes[0];
|
|
182
228
|
if (node.nodeName == "WMS_Capabilities" || node.nodeName == "WMT_MS_Capabilities")
|
|
183
229
|
{
|
|
230
|
+
// @ts-ignore
|
|
184
231
|
let attr = node.attributes.getNamedItem("version");
|
|
185
232
|
if (attr)
|
|
186
233
|
{
|
package/package.json
CHANGED
package/spreadsheet.d.ts
CHANGED
|
@@ -268,6 +268,26 @@ export enum PresetColor
|
|
|
268
268
|
YellowGreen
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
+
export enum FillType
|
|
272
|
+
{
|
|
273
|
+
SolidFill
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export enum MarkerStyle
|
|
277
|
+
{
|
|
278
|
+
Circle,
|
|
279
|
+
Dash,
|
|
280
|
+
Diamond,
|
|
281
|
+
Dot,
|
|
282
|
+
None,
|
|
283
|
+
Picture,
|
|
284
|
+
Plus,
|
|
285
|
+
Square,
|
|
286
|
+
Star,
|
|
287
|
+
Triangle,
|
|
288
|
+
X
|
|
289
|
+
}
|
|
290
|
+
|
|
271
291
|
export class WorkbookFont
|
|
272
292
|
{
|
|
273
293
|
private name: string|null;
|
|
@@ -391,6 +411,198 @@ export interface IStyleCtrl
|
|
|
391
411
|
findOrCreateStyle(tmpStyle: CellStyle): CellStyle;
|
|
392
412
|
}
|
|
393
413
|
|
|
414
|
+
export class OfficeColor
|
|
415
|
+
{
|
|
416
|
+
private colorType: ColorType;
|
|
417
|
+
private color: number;
|
|
418
|
+
|
|
419
|
+
constructor(colorType: ColorType, color: number);
|
|
420
|
+
|
|
421
|
+
getColorType(): ColorType;
|
|
422
|
+
getPresetColor(): PresetColor;
|
|
423
|
+
getColorArgb(): number;
|
|
424
|
+
|
|
425
|
+
static newPreset(color: PresetColor): OfficeColor;
|
|
426
|
+
static newArgb(argb: number): OfficeColor;
|
|
427
|
+
|
|
428
|
+
static presetColorGetArgb(color: PresetColor): number;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export class OfficeFill
|
|
432
|
+
{
|
|
433
|
+
private fillType: FillType;
|
|
434
|
+
private color: OfficeColor|null;
|
|
435
|
+
|
|
436
|
+
constructor(fillType: FillType, color: OfficeColor|null);
|
|
437
|
+
|
|
438
|
+
getFillType(): FillType;
|
|
439
|
+
getColor(): OfficeColor|null;
|
|
440
|
+
|
|
441
|
+
static newSolidFill(color: OfficeColor|null): OfficeFill;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export class OfficeLineStyle
|
|
445
|
+
{
|
|
446
|
+
private fill: OfficeFill|null;
|
|
447
|
+
|
|
448
|
+
constructor(fill: OfficeFill|null);
|
|
449
|
+
|
|
450
|
+
getFillStyle(): OfficeFill|null;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export class OfficeShapeProp
|
|
454
|
+
{
|
|
455
|
+
private fill: OfficeFill|null;
|
|
456
|
+
private lineStyle: OfficeLineStyle|null;
|
|
457
|
+
|
|
458
|
+
constructor(fill: OfficeFill|null, lineStyle: OfficeLineStyle|null);
|
|
459
|
+
|
|
460
|
+
getFill(): OfficeFill|null;
|
|
461
|
+
setFill(fill: OfficeFill|null): void;
|
|
462
|
+
getLineStyle(): OfficeLineStyle|null;
|
|
463
|
+
setLineStyle(lineStyle: OfficeLineStyle|null): void;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export class OfficeChartAxis
|
|
467
|
+
{
|
|
468
|
+
private axisType: AxisType;
|
|
469
|
+
private axisPos: AxisPosition;
|
|
470
|
+
private title: string|null;
|
|
471
|
+
private shapeProp: OfficeShapeProp|null;
|
|
472
|
+
private majorGridProp: OfficeShapeProp|null;
|
|
473
|
+
private tickLblPos: TickLabelPosition;
|
|
474
|
+
private crosses: AxisCrosses;
|
|
475
|
+
|
|
476
|
+
constructor(axisType: AxisType, axisPos: AxisPosition);
|
|
477
|
+
|
|
478
|
+
getAxisType(): AxisType;
|
|
479
|
+
getAxisPos(): AxisPosition;
|
|
480
|
+
getTitle(): string|null;
|
|
481
|
+
setTitle(title: string|null): void;
|
|
482
|
+
getShapeProp(): OfficeShapeProp|null;
|
|
483
|
+
setShapeProp(shapeProp: OfficeShapeProp|null): void;
|
|
484
|
+
getMajorGridProp(): OfficeShapeProp|null;
|
|
485
|
+
setMajorGridProp(majorGridProp: OfficeShapeProp|null): void;
|
|
486
|
+
getTickLblPos(): TickLabelPosition;
|
|
487
|
+
setTickLblPos(tickLblPos: TickLabelPosition): void;
|
|
488
|
+
getCrosses(): AxisCrosses;
|
|
489
|
+
setCrosses(axisCrosses: AxisCrosses): void;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export class WorkbookDataSource
|
|
493
|
+
{
|
|
494
|
+
private sheet: Worksheet;
|
|
495
|
+
private firstRow: number;
|
|
496
|
+
private lastRow: number;
|
|
497
|
+
private firstCol: number;
|
|
498
|
+
private lastCol: number;
|
|
499
|
+
|
|
500
|
+
constructor(sheet: Worksheet, firstRow: number, lastRow: number, firstCol: number, lastCol: number);
|
|
501
|
+
|
|
502
|
+
toCodeRange(): string;
|
|
503
|
+
getSheet(): Worksheet;
|
|
504
|
+
getFirstRow(): number;
|
|
505
|
+
getLastRow(): number;
|
|
506
|
+
getFirstCol(): number;
|
|
507
|
+
getLastCol(): number;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export class OfficeChartSeries
|
|
511
|
+
{
|
|
512
|
+
private categoryData: WorkbookDataSource;
|
|
513
|
+
private valueData: WorkbookDataSource;
|
|
514
|
+
private title: string|null;
|
|
515
|
+
private smooth: boolean;
|
|
516
|
+
private shapeProp: OfficeShapeProp|null;
|
|
517
|
+
private markerSize: number;
|
|
518
|
+
private markerStyle: MarkerStyle;
|
|
519
|
+
|
|
520
|
+
constructor(categoryData: WorkbookDataSource, valueData: WorkbookDataSource);
|
|
521
|
+
|
|
522
|
+
getCategoryData(): WorkbookDataSource;
|
|
523
|
+
getValueData(): WorkbookDataSource;
|
|
524
|
+
getTitle(): string|null;
|
|
525
|
+
setTitle(title: string|null): void;
|
|
526
|
+
isSmooth(): boolean;
|
|
527
|
+
setSmooth(smooth: boolean): void;
|
|
528
|
+
getShapeProp(): OfficeShapeProp|null;
|
|
529
|
+
setShapeProp(shapeProp: OfficeShapeProp|null): void;
|
|
530
|
+
setLineStyle(lineStyle: OfficeLineStyle|null): void;
|
|
531
|
+
getMarkerSize(): number;
|
|
532
|
+
setMarkerSize(markerSize: number): void;
|
|
533
|
+
getMarkerStyle(): MarkerStyle;
|
|
534
|
+
setMarkerStyle(markerStyle: MarkerStyle): void;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
class OfficeChart
|
|
538
|
+
{
|
|
539
|
+
private static seriesColor: PresetColor[];
|
|
540
|
+
|
|
541
|
+
private xInch: number;
|
|
542
|
+
private yInch: number;
|
|
543
|
+
private wInch: number;
|
|
544
|
+
private hInch: number;
|
|
545
|
+
private titleText: string|null;
|
|
546
|
+
private shapeProp: OfficeShapeProp|null;
|
|
547
|
+
private legend: boolean;
|
|
548
|
+
private legendPos: LegendPos;
|
|
549
|
+
private legendOverlay: boolean;
|
|
550
|
+
private displayBlankAs: BlankAs;
|
|
551
|
+
private chartType: ChartType;
|
|
552
|
+
private categoryAxis: OfficeChartAxis|null;
|
|
553
|
+
private valueAxis: OfficeChartAxis|null;
|
|
554
|
+
private axes: OfficeChartAxis[];
|
|
555
|
+
private series: OfficeChartSeries[];
|
|
556
|
+
|
|
557
|
+
constructor(du: unit.Distance.Unit, x: number, y: number, w: number, h: number);
|
|
558
|
+
|
|
559
|
+
getXInch(): number;
|
|
560
|
+
getYInch(): number;
|
|
561
|
+
getWInch(): number;
|
|
562
|
+
getHInch(): number;
|
|
563
|
+
|
|
564
|
+
setTitleText(titleText: string|null): void;
|
|
565
|
+
getTitleText(): string|null;
|
|
566
|
+
|
|
567
|
+
getShapeProp(): OfficeShapeProp|null;
|
|
568
|
+
setShapeProp(shapeProp: OfficeShapeProp|null): void;
|
|
569
|
+
addLegend(pos: LegendPos): void;
|
|
570
|
+
hasLegend(): boolean;
|
|
571
|
+
getLegendPos(): LegendPos;
|
|
572
|
+
isLegendOverlay(): boolean;
|
|
573
|
+
setDisplayBlankAs(displayBlankAs: BlankAs): void;
|
|
574
|
+
getDisplayBlankAs(): BlankAs;
|
|
575
|
+
|
|
576
|
+
initChart(chartType: ChartType, categoryAxis: OfficeChartAxis, valueAxis: OfficeChartAxis): void;
|
|
577
|
+
initLineChart(leftAxisName: string|null, bottomAxisName: string|null, bottomAxisType: AxisType): void;
|
|
578
|
+
getChartType(): ChartType;
|
|
579
|
+
createAxis(axisType: AxisType, axisPos: AxisPosition): OfficeChartAxis;
|
|
580
|
+
getAxisCount(): number;
|
|
581
|
+
getAxis(index: number): OfficeChartAxis|null;
|
|
582
|
+
getAxisIndex(axis: OfficeChartAxis): number;
|
|
583
|
+
getCategoryAxis(): OfficeChartAxis|null;
|
|
584
|
+
getValueAxis(): OfficeChartAxis|null;
|
|
585
|
+
|
|
586
|
+
addSeries(categoryData: WorkbookDataSource, valueData: WorkbookDataSource, name: string|null, showMarker: boolean): void;
|
|
587
|
+
getSeriesCount(): number;
|
|
588
|
+
getSeriesNoCheck(index: number): OfficeChartSeries;
|
|
589
|
+
getSeries(index: number): OfficeChartSeries|null;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
declare class WorksheetDrawing
|
|
593
|
+
{
|
|
594
|
+
anchorType: AnchorType;
|
|
595
|
+
posXInch: number;
|
|
596
|
+
posYInch: number;
|
|
597
|
+
widthInch: number;
|
|
598
|
+
heightInch: number;
|
|
599
|
+
row1: number;
|
|
600
|
+
col1: number;
|
|
601
|
+
row2: number;
|
|
602
|
+
col2: number;
|
|
603
|
+
chart: OfficeChart|null;
|
|
604
|
+
}
|
|
605
|
+
|
|
394
606
|
export class Worksheet
|
|
395
607
|
{
|
|
396
608
|
private name: string;
|
|
@@ -478,10 +690,10 @@ export class Worksheet
|
|
|
478
690
|
getCellString(cell: CellData): string|null;
|
|
479
691
|
|
|
480
692
|
getDrawingCount(): number;
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
693
|
+
getDrawing(index: number): WorksheetDrawing|null;
|
|
694
|
+
getDrawingNoCheck(index: number): WorksheetDrawing;
|
|
695
|
+
createDrawing(du: unit.Distance.Unit, x: number, y: number, w: number, h: number): WorksheetDrawing;
|
|
696
|
+
createChart(du: unit.Distance.Unit, x: number, y: number, w: number, h: number, title: string|null): OfficeChart;
|
|
485
697
|
}
|
|
486
698
|
|
|
487
699
|
export class Workbook extends data.ParsedObject implements IStyleCtrl
|