@sswroom/sswr 1.4.1 → 1.5.1
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 +31 -0
- package/cesium.d.ts +36 -1
- package/cesium.js +85 -0
- package/kml.d.ts +60 -15
- package/kml.js +203 -25
- package/leaflet.d.ts +50 -3
- package/leaflet.js +229 -1
- package/map.d.ts +2 -1
- package/map.js +3 -3
- package/math.js +11 -11
- package/olayer2.d.ts +2 -1
- package/olayer2.js +5 -0
- package/osm.d.ts +1 -0
- package/osm.js +5 -0
- package/package.json +1 -1
- package/parser.d.ts +4 -0
- package/parser.js +460 -0
- package/text.d.ts +2 -1
- package/text.js +12 -1
- package/unit.d.ts +355 -39
- package/unit.js +933 -65
- package/web.d.ts +2 -1
- package/web.js +42 -0
package/Changelog
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
1.5.1
|
|
2
|
+
-Fixed AngleUnit problem
|
|
3
|
+
|
|
4
|
+
1.5.0
|
|
5
|
+
-Change unit.AngleUnit and unit.DistanceUnit to unit.Angle.Unit and unit.Distance.Unit
|
|
6
|
+
-Added unit.Acceleration
|
|
7
|
+
-Added unit.ApparentPower
|
|
8
|
+
-Added unit.Count
|
|
9
|
+
-Added unit.ElectricCurrent
|
|
10
|
+
-Added unit.ElectricPotential
|
|
11
|
+
-Added unit.Energy
|
|
12
|
+
-Added unit.Force
|
|
13
|
+
-Added unit.Frequency
|
|
14
|
+
-Added unit.MagneticField
|
|
15
|
+
-Added unit.Mass
|
|
16
|
+
-Added unit.Power
|
|
17
|
+
-Added unit.Pressure
|
|
18
|
+
-Added unit.Ratio
|
|
19
|
+
-Added unit.ReactiveEnergy
|
|
20
|
+
-Added unit.ReactivePower
|
|
21
|
+
-Added unit.Speed
|
|
22
|
+
-Added unit.Temperature
|
|
23
|
+
-Added osm.scale2Level
|
|
24
|
+
-Adding leaflet.LeafletMap
|
|
25
|
+
-Adding cesium.CesiumMap
|
|
26
|
+
-Added web.appendUrl
|
|
27
|
+
-Added parser.js
|
|
28
|
+
-Added text.arrayToNumbers
|
|
29
|
+
-Added leaflet.createFromKMLFeature
|
|
30
|
+
-Added leaflet.createGeometry
|
|
31
|
+
|
|
1
32
|
1.4.1
|
|
2
33
|
-Fixed problems in Chrome
|
|
3
34
|
|
package/cesium.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Cartesian3, Ellipsoid, Viewer } from "cesium";
|
|
2
|
-
import { Coord2D } from "./math";
|
|
3
2
|
import { Polygon } from "./geometry";
|
|
3
|
+
import * as kml from "./kml";
|
|
4
|
+
import * as map from "./map";
|
|
5
|
+
import { Coord2D } from "./math";
|
|
4
6
|
|
|
5
7
|
export function screenToLatLon(viewer: Viewer, x: number, y: number, ellipsoid: Ellipsoid) : Coord2D;
|
|
6
8
|
export function fromCXYZArray(arr: any[]): Cartesian3[];
|
|
@@ -9,3 +11,36 @@ export function newObjFromGeoJSON(geoJSON: object) : object;
|
|
|
9
11
|
export function addGeoJSON(viewer: Viewer, geoJSON: object, color: any, extSize: number): void;
|
|
10
12
|
export function fromCartesian3Array(viewer: Viewer, arr: Cartesian3[]): object[];
|
|
11
13
|
export function fromPolygonGraphics(viewer: Viewer, pg: any): Polygon;
|
|
14
|
+
|
|
15
|
+
export class CesiumMap extends map.MapControl
|
|
16
|
+
{
|
|
17
|
+
constructor(divId: string);
|
|
18
|
+
createLayer(layer: map.LayerInfo, options?: LayerOptions): any;
|
|
19
|
+
createMarkerLayer(name: string, options?: LayerOptions): any;
|
|
20
|
+
createGeometryLayer(name: string, options?: LayerOptions): any;
|
|
21
|
+
addLayer(layer: any): void;
|
|
22
|
+
addKMLFeature(feature: kml.Feature): void;
|
|
23
|
+
uninit(): void;
|
|
24
|
+
zoomIn(): void;
|
|
25
|
+
zoomOut(): void;
|
|
26
|
+
zoomScale(scale: number): void;
|
|
27
|
+
panTo(pos: math.Coord2D): void;
|
|
28
|
+
panZoomScale(pos: math.Coord2D, scale: number): void;
|
|
29
|
+
zoomToExtent(extent: math.RectArea): void;
|
|
30
|
+
handleMouseLClick(clickFunc: (mapPos: math.Coord2D, scnPos: math.Coord2D)=>void): void;
|
|
31
|
+
handleMouseMove(moveFunc: (mapPos: math.Coord2D)=>void): void;
|
|
32
|
+
handlePosChange(posFunc: (mapPos: math.Coord2D)=>void): void;
|
|
33
|
+
map2ScnPos(mapPos: math.Coord2D): math.Coord2D;
|
|
34
|
+
scn2MapPos(scnPos: math.Coord2D): math.Coord2D;
|
|
35
|
+
|
|
36
|
+
createMarker(mapPos: math.Coord2D, imgURL: string, imgWidth: number, imgHeight: number, options?: MarkerOptions): any;
|
|
37
|
+
layerAddMarker(markerLayer: any, marker: any): void;
|
|
38
|
+
layerRemoveMarker(markerLayer: any, marker: any): void;
|
|
39
|
+
layerClearMarkers(markerLayer: any): void;
|
|
40
|
+
markerIsOver(marker: any, scnPos: math.Coord2D): boolean;
|
|
41
|
+
|
|
42
|
+
createGeometry(geom: geometry.Vector2D, options: GeometryOptions): any;
|
|
43
|
+
layerAddGeometry(geometryLayer: any, geom: any): void;
|
|
44
|
+
layerRemoveGeometry(geometryLayer: any, geom: any): void;
|
|
45
|
+
layerClearGeometries(geometryLayer: any): void;
|
|
46
|
+
}
|
package/cesium.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as map from "./map.js";
|
|
1
2
|
import { Coord2D } from "./math.js";
|
|
2
3
|
import { Polygon } from "./geometry.js";
|
|
3
4
|
|
|
@@ -176,3 +177,87 @@ export function fromPolygonGraphics(viewer, pg)
|
|
|
176
177
|
var pg = new Cesium.PolygonGraphics(o);
|
|
177
178
|
return pg;
|
|
178
179
|
}*/
|
|
180
|
+
|
|
181
|
+
export class CesiumMap extends map.MapControl
|
|
182
|
+
{
|
|
183
|
+
constructor(divId)
|
|
184
|
+
{
|
|
185
|
+
super();
|
|
186
|
+
this.viewer = new Cesium.Viewer(divId, {
|
|
187
|
+
timeline:false,
|
|
188
|
+
animation:false,
|
|
189
|
+
scene3DOnly:true,
|
|
190
|
+
baseLayerPicker: false,
|
|
191
|
+
// baseLayer: new Cesium.ImageryLayer(new Cesium.OpenStreetMapImageryProvider({
|
|
192
|
+
// url: "https://tile.openstreetmap.org/"
|
|
193
|
+
// }))}
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
createLayer(layer, options)
|
|
198
|
+
{
|
|
199
|
+
if (layer.type == map.WebMapType.OSMTile)
|
|
200
|
+
{
|
|
201
|
+
var opt = {};
|
|
202
|
+
if (options && options.maxZoom)
|
|
203
|
+
{
|
|
204
|
+
opt.maximumLevel = options.maxZoom;
|
|
205
|
+
}
|
|
206
|
+
return new Cesium.ImageryLayer(new Cesium.UrlTemplateImageryProvider({
|
|
207
|
+
url: layer.url}, opt));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/*createMarkerLayer(name: string, options?: LayerOptions): any;
|
|
212
|
+
createGeometryLayer(name: string, options?: LayerOptions): any;*/
|
|
213
|
+
addLayer(layer)
|
|
214
|
+
{
|
|
215
|
+
if (layer instanceof Cesium.ImageryLayer)
|
|
216
|
+
{
|
|
217
|
+
this.viewer.imageryLayers.add(layer);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// uninit(): void;
|
|
222
|
+
zoomIn()
|
|
223
|
+
{
|
|
224
|
+
this.viewer.camera.moveForward();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
zoomOut()
|
|
228
|
+
{
|
|
229
|
+
this.viewer.camera.moveBackward();
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
zoomScale(scale)
|
|
233
|
+
{
|
|
234
|
+
this.viewer.camera.flyTo({destination: Cesium.Cartesian3.fromDegrees(pos.x, pos.y, scale), duration:0});
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
panTo(pos)
|
|
238
|
+
{
|
|
239
|
+
this.viewer.camera.flyTo({destination: Cesium.Cartesian3.fromDegrees(pos.x, pos.y, 20000), duration:0});
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
panZoomScale(pos, scale)
|
|
243
|
+
{
|
|
244
|
+
this.viewer.camera.flyTo({destination: Cesium.Cartesian3.fromDegrees(pos.x, pos.y, scale), duration:0});
|
|
245
|
+
}
|
|
246
|
+
/* zoomToExtent(extent: math.RectArea): void;
|
|
247
|
+
handleMouseLClick(clickFunc: (mapPos: math.Coord2D, scnPos: math.Coord2D)=>void): void;
|
|
248
|
+
handleMouseMove(moveFunc: (mapPos: math.Coord2D)=>void): void;
|
|
249
|
+
handlePosChange(posFunc: (mapPos: math.Coord2D)=>void): void;
|
|
250
|
+
map2ScnPos(mapPos: math.Coord2D): math.Coord2D;
|
|
251
|
+
scn2MapPos(scnPos: math.Coord2D): math.Coord2D;
|
|
252
|
+
|
|
253
|
+
createMarker(mapPos: math.Coord2D, imgURL: string, imgWidth: number, imgHeight: number, options?: MarkerOptions): any;
|
|
254
|
+
layerAddMarker(markerLayer: any, marker: any): void;
|
|
255
|
+
layerRemoveMarker(markerLayer: any, marker: any): void;
|
|
256
|
+
layerClearMarkers(markerLayer: any): void;
|
|
257
|
+
markerIsOver(marker: any, scnPos: math.Coord2D): boolean;
|
|
258
|
+
|
|
259
|
+
createGeometry(geom: geometry.Vector2D, options: GeometryOptions): any;
|
|
260
|
+
layerAddGeometry(geometryLayer: any, geom: any): void;
|
|
261
|
+
layerRemoveGeometry(geometryLayer: any, geom: any): void;
|
|
262
|
+
layerClearGeometries(geometryLayer: any): void;*/
|
|
263
|
+
}
|
package/kml.d.ts
CHANGED
|
@@ -32,8 +32,16 @@ export enum ItemIconMode
|
|
|
32
32
|
Fetching2
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
+
export enum HotSpotUnit
|
|
36
|
+
{
|
|
37
|
+
Fraction,
|
|
38
|
+
Pixels,
|
|
39
|
+
InsetPixels
|
|
40
|
+
};
|
|
41
|
+
|
|
35
42
|
export class Element
|
|
36
43
|
{
|
|
44
|
+
getUsedNS(ns: object): void;
|
|
37
45
|
appendOuterXML(strs: string[], level: number): void;
|
|
38
46
|
}
|
|
39
47
|
|
|
@@ -67,6 +75,7 @@ export class LookAt extends Element
|
|
|
67
75
|
setTilt(tilt: number): void;
|
|
68
76
|
setAltitudeMode(altitudeMode: AltitudeMode): void;
|
|
69
77
|
|
|
78
|
+
getUsedNS(ns: object): void;
|
|
70
79
|
appendOuterXML(strs: string[], level: number): void;
|
|
71
80
|
};
|
|
72
81
|
|
|
@@ -79,6 +88,7 @@ export class ColorStyle extends Element
|
|
|
79
88
|
setRandomColor(randomColor: boolean): void;
|
|
80
89
|
fromARGB(a: number, r: number, g: number, b: number): void;
|
|
81
90
|
fromCSSColor(color: string): void;
|
|
91
|
+
setColor(color: string): void;
|
|
82
92
|
|
|
83
93
|
sameColor(c: ColorStyle): boolean;
|
|
84
94
|
appendInnerXML(strs: string[], level: number): void;
|
|
@@ -91,21 +101,26 @@ export class IconStyle extends ColorStyle
|
|
|
91
101
|
iconUrl: string;
|
|
92
102
|
hotSpotX: number;
|
|
93
103
|
hotSpotY: number;
|
|
104
|
+
hotSpotUnitX: HotSpotUnit;
|
|
105
|
+
hotSpotUnitY: HotSpotUnit;
|
|
94
106
|
|
|
95
107
|
constructor();
|
|
96
|
-
setScale(scale: number);
|
|
97
|
-
setHeading(heading: number);
|
|
98
|
-
setIconUrl(iconUrl: string);
|
|
99
|
-
setHotSpotX(hotSpotX: number);
|
|
100
|
-
setHotSpotY(hotSpotY: number);
|
|
108
|
+
setScale(scale: number): void;
|
|
109
|
+
setHeading(heading: number): void;
|
|
110
|
+
setIconUrl(iconUrl: string): void;
|
|
111
|
+
setHotSpotX(hotSpotX: number, hsUnit?: HotSpotUnit): void;
|
|
112
|
+
setHotSpotY(hotSpotY: number, hsUnit?: HotSpotUnit): void;
|
|
113
|
+
getUsedNS(ns: object): void;
|
|
101
114
|
appendOuterXML(strs: string[], level: number): void;
|
|
102
115
|
equals(o: IconStyle): boolean;
|
|
103
116
|
};
|
|
104
117
|
|
|
105
118
|
export class LabelStyle extends ColorStyle
|
|
106
119
|
{
|
|
107
|
-
|
|
120
|
+
scale: number;
|
|
108
121
|
constructor();
|
|
122
|
+
setScale(scale: number): void;
|
|
123
|
+
getUsedNS(ns: object): void;
|
|
109
124
|
appendOuterXML(strs: string[], level: number): void;
|
|
110
125
|
equals(o: LabelStyle): boolean;
|
|
111
126
|
};
|
|
@@ -113,8 +128,11 @@ export class LabelStyle extends ColorStyle
|
|
|
113
128
|
export class LineStyle extends ColorStyle
|
|
114
129
|
{
|
|
115
130
|
width: number;
|
|
131
|
+
labelVisibility: boolean;
|
|
116
132
|
constructor();
|
|
117
|
-
setWidth(width: number);
|
|
133
|
+
setWidth(width: number): void;
|
|
134
|
+
setLabelVisibility(labelVisibility: boolean): void;
|
|
135
|
+
getUsedNS(ns: object): void;
|
|
118
136
|
appendOuterXML(strs: string[], level: number): void;
|
|
119
137
|
equals(o: LineStyle): boolean;
|
|
120
138
|
};
|
|
@@ -123,6 +141,7 @@ export class PolyStyle extends ColorStyle
|
|
|
123
141
|
{
|
|
124
142
|
|
|
125
143
|
constructor();
|
|
144
|
+
getUsedNS(ns: object): void;
|
|
126
145
|
appendOuterXML(strs: string[], level: number): void;
|
|
127
146
|
equals(o: PolyStyle): boolean;
|
|
128
147
|
};
|
|
@@ -135,6 +154,7 @@ export class BalloonStyle extends Element
|
|
|
135
154
|
displayMode: DisplayMode;
|
|
136
155
|
|
|
137
156
|
constructor();
|
|
157
|
+
getUsedNS(ns: object): void;
|
|
138
158
|
appendOuterXML(strs: string[], level: number): void;
|
|
139
159
|
equals(o: BalloonStyle): boolean;
|
|
140
160
|
};
|
|
@@ -145,13 +165,18 @@ export class ListStyle extends Element
|
|
|
145
165
|
bgColor: string;
|
|
146
166
|
|
|
147
167
|
constructor();
|
|
168
|
+
getUsedNS(ns: object): void;
|
|
148
169
|
appendOuterXML(strs: string[], level: number): void;
|
|
149
170
|
equals(o: ListStyle): boolean;
|
|
150
171
|
};
|
|
151
172
|
|
|
152
|
-
export class
|
|
173
|
+
export class StyleSelector extends Element
|
|
153
174
|
{
|
|
154
175
|
id: string;
|
|
176
|
+
constructor(id: string);
|
|
177
|
+
}
|
|
178
|
+
export class Style extends StyleSelector
|
|
179
|
+
{
|
|
155
180
|
iconStyle: IconStyle;
|
|
156
181
|
labelStyle: LabelStyle;
|
|
157
182
|
lineStyle: LineStyle;
|
|
@@ -167,9 +192,20 @@ export class Style extends Element
|
|
|
167
192
|
setBalloonStyle(style: BalloonStyle): void;
|
|
168
193
|
setListStyle(style: ListStyle): void;
|
|
169
194
|
isStyle(iconStyle: IconStyle, labelStyle: LabelStyle, lineStyle: LineStyle, polyStyle: PolyStyle, balloonStyle: BalloonStyle, listStyle: ListStyle): boolean;
|
|
195
|
+
getUsedNS(ns: object): void;
|
|
170
196
|
appendOuterXML(strs: string[], level: number): void;
|
|
171
197
|
};
|
|
172
198
|
|
|
199
|
+
export class StyleMap extends StyleSelector
|
|
200
|
+
{
|
|
201
|
+
normalStyle: Style;
|
|
202
|
+
highlightStyle: Style;
|
|
203
|
+
|
|
204
|
+
constructor(id: string, normalStyle: Style, highlightStyle: Style);
|
|
205
|
+
getUsedNS(ns: object): void;
|
|
206
|
+
appendOuterXML(strs: string[], level: number): void;
|
|
207
|
+
}
|
|
208
|
+
|
|
173
209
|
export class Feature extends Element
|
|
174
210
|
{
|
|
175
211
|
name: string;
|
|
@@ -183,7 +219,7 @@ export class Feature extends Element
|
|
|
183
219
|
snippet: string;
|
|
184
220
|
description: string;
|
|
185
221
|
lookAt: LookAt;
|
|
186
|
-
style:
|
|
222
|
+
style: StyleSelector;
|
|
187
223
|
|
|
188
224
|
constructor();
|
|
189
225
|
setName(name: string): void;
|
|
@@ -196,7 +232,7 @@ export class Feature extends Element
|
|
|
196
232
|
setSnippet(snippet: string): void;
|
|
197
233
|
setDescription(description: string): void;
|
|
198
234
|
setLookAt(lookAt: LookAt): void;
|
|
199
|
-
setStyle(style:
|
|
235
|
+
setStyle(style: StyleSelector): void;
|
|
200
236
|
|
|
201
237
|
appendInnerXML(strs: string[], level: number): void;
|
|
202
238
|
}
|
|
@@ -205,30 +241,34 @@ export class Container extends Feature
|
|
|
205
241
|
{
|
|
206
242
|
eleName: string;
|
|
207
243
|
features: Feature[];
|
|
244
|
+
styleList: Style[];
|
|
245
|
+
styleMapList: StyleMap[];
|
|
208
246
|
|
|
209
247
|
constructor(eleName: string);
|
|
210
248
|
addFeature(feature: Feature): void;
|
|
249
|
+
addStyle(style: Style): void;
|
|
250
|
+
addStyleMap(styleMap: StyleMap): void;
|
|
251
|
+
getOrNewStyle(iconStyle: IconStyle, labelStyle: LabelStyle, lineStyle: LineStyle, polyStyle: PolyStyle, balloonStyle: BalloonStyle, listStyle: ListStyle): Style;
|
|
252
|
+
getStyleById(id: string): Style | StyleMap | null;
|
|
253
|
+
getUsedNS(ns: object): void;
|
|
254
|
+
appendOuterXML(strs: string[], level: number): void;
|
|
211
255
|
}
|
|
212
256
|
|
|
213
257
|
export class Document extends Container
|
|
214
258
|
{
|
|
215
|
-
styleList: Style[];
|
|
216
|
-
|
|
217
259
|
constructor();
|
|
218
|
-
getOrNewStyle(iconStyle: IconStyle, labelStyle: LabelStyle, lineStyle: LineStyle, polyStyle: PolyStyle, balloonStyle: BalloonStyle, listStyle: ListStyle): Style;
|
|
219
|
-
appendOuterXML(strs: string[], level: number): void;
|
|
220
260
|
}
|
|
221
261
|
|
|
222
262
|
export class Folder extends Container
|
|
223
263
|
{
|
|
224
264
|
constructor();
|
|
225
|
-
appendOuterXML(strs: string[], level: number): void;
|
|
226
265
|
}
|
|
227
266
|
|
|
228
267
|
export class NetworkLink extends Feature
|
|
229
268
|
{
|
|
230
269
|
constructor();
|
|
231
270
|
|
|
271
|
+
getUsedNS(ns: object): void;
|
|
232
272
|
appendOuterXML(strs: string[], level: number): void;
|
|
233
273
|
}
|
|
234
274
|
|
|
@@ -238,6 +278,7 @@ export class Placemark extends Feature
|
|
|
238
278
|
constructor(vec: geometry.Vector2D);
|
|
239
279
|
|
|
240
280
|
appendGeometry(strs: string[], level: number, vec: geometry.Vector2D, subGeom?: boolean): void;
|
|
281
|
+
getUsedNS(ns: object): void;
|
|
241
282
|
appendOuterXML(strs: string[], level: number): void;
|
|
242
283
|
}
|
|
243
284
|
|
|
@@ -245,6 +286,7 @@ export class GroundOverlay extends Feature
|
|
|
245
286
|
{
|
|
246
287
|
constructor();
|
|
247
288
|
|
|
289
|
+
getUsedNS(ns: object): void;
|
|
248
290
|
appendOuterXML(strs: string[], level: number): void;
|
|
249
291
|
}
|
|
250
292
|
|
|
@@ -252,6 +294,7 @@ export class PhotoOverlay extends Feature
|
|
|
252
294
|
{
|
|
253
295
|
constructor();
|
|
254
296
|
|
|
297
|
+
getUsedNS(ns: object): void;
|
|
255
298
|
appendOuterXML(strs: string[], level: number): void;
|
|
256
299
|
}
|
|
257
300
|
|
|
@@ -259,7 +302,9 @@ export class ScreenOverlay extends Feature
|
|
|
259
302
|
{
|
|
260
303
|
constructor();
|
|
261
304
|
|
|
305
|
+
getUsedNS(ns: object): void;
|
|
262
306
|
appendOuterXML(strs: string[], level: number): void;
|
|
263
307
|
}
|
|
264
308
|
|
|
265
309
|
export function toString(item: Feature | NetworkLinkControl): string;
|
|
310
|
+
export function toCSSColor(color: string): string;
|