aviation-chart 0.2.6 → 0.3.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/dist/nav-sdk.d.ts +321 -2
- package/dist/nav-sdk.esm.js +1256 -4
- package/package.json +3 -2
package/dist/nav-sdk.d.ts
CHANGED
|
@@ -53,6 +53,320 @@ declare class GlobalConfigManager {
|
|
|
53
53
|
}
|
|
54
54
|
declare const globalConfig: GlobalConfigManager;
|
|
55
55
|
|
|
56
|
+
type StrokeLineType = "solid" | "dashed" | "dotted" | "dash-dot" | "long-dash" | "double-dash";
|
|
57
|
+
|
|
58
|
+
interface CircleOptions {
|
|
59
|
+
center: [number, number];
|
|
60
|
+
radius: number;
|
|
61
|
+
steps?: number;
|
|
62
|
+
color?: string;
|
|
63
|
+
opacity?: number;
|
|
64
|
+
fillTranslate?: [number, number];
|
|
65
|
+
fillPattern?: string;
|
|
66
|
+
antialias?: boolean;
|
|
67
|
+
strokeColor?: string;
|
|
68
|
+
strokeWidth?: number;
|
|
69
|
+
strokeOpacity?: number;
|
|
70
|
+
strokeLineType?: StrokeLineType;
|
|
71
|
+
strokeDasharray?: number[];
|
|
72
|
+
strokeLineCap?: "butt" | "round" | "square";
|
|
73
|
+
strokeLineJoin?: "bevel" | "round" | "miter";
|
|
74
|
+
strokeBlur?: number;
|
|
75
|
+
strokeTranslate?: [number, number];
|
|
76
|
+
label?: string;
|
|
77
|
+
labelSize?: number;
|
|
78
|
+
labelColor?: string;
|
|
79
|
+
labelHaloColor?: string;
|
|
80
|
+
labelHaloWidth?: number;
|
|
81
|
+
cursor?: string;
|
|
82
|
+
beforeId?: string;
|
|
83
|
+
minZoom?: number;
|
|
84
|
+
maxZoom?: number;
|
|
85
|
+
properties?: Record<string, any>;
|
|
86
|
+
}
|
|
87
|
+
type CircleStyleKey = "color" | "opacity" | "fillTranslate" | "fillPattern" | "antialias" | "strokeColor" | "strokeWidth" | "strokeOpacity" | "strokeLineType" | "strokeDasharray" | "strokeBlur" | "strokeTranslate" | "strokeLineCap" | "strokeLineJoin";
|
|
88
|
+
declare class Circle {
|
|
89
|
+
readonly id: string;
|
|
90
|
+
private _center;
|
|
91
|
+
private _radius;
|
|
92
|
+
private _options;
|
|
93
|
+
private _map;
|
|
94
|
+
private _visible;
|
|
95
|
+
private _sourceId;
|
|
96
|
+
private _fillLayerId;
|
|
97
|
+
private _strokeLayerId;
|
|
98
|
+
private _labelLayerId;
|
|
99
|
+
constructor(options: CircleOptions);
|
|
100
|
+
bindTo(mapOrSdk: any): this;
|
|
101
|
+
private _ring;
|
|
102
|
+
private _geojson;
|
|
103
|
+
private _resolveStrokeDash;
|
|
104
|
+
private _addToMap;
|
|
105
|
+
private _updateSource;
|
|
106
|
+
getCenter(): [number, number];
|
|
107
|
+
setCenter(center: [number, number]): this;
|
|
108
|
+
getRadius(): number;
|
|
109
|
+
setRadius(radius: number): this;
|
|
110
|
+
getBounds(): [[number, number], [number, number]];
|
|
111
|
+
contains(lnglat: [number, number]): boolean;
|
|
112
|
+
setStyle(style: Partial<Pick<CircleOptions, CircleStyleKey>>): this;
|
|
113
|
+
setLabel(label: string): this;
|
|
114
|
+
show(): this;
|
|
115
|
+
hide(): this;
|
|
116
|
+
isVisible(): boolean;
|
|
117
|
+
remove(): void;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
interface TextOptions {
|
|
121
|
+
position: [number, number];
|
|
122
|
+
text: string;
|
|
123
|
+
fontSize?: number;
|
|
124
|
+
fontFamily?: string[];
|
|
125
|
+
fontWeight?: "normal" | "bold";
|
|
126
|
+
fontStyle?: "normal" | "italic";
|
|
127
|
+
color?: string;
|
|
128
|
+
opacity?: number;
|
|
129
|
+
haloColor?: string;
|
|
130
|
+
haloWidth?: number;
|
|
131
|
+
haloBlur?: number;
|
|
132
|
+
translate?: [number, number];
|
|
133
|
+
rotation?: number;
|
|
134
|
+
anchor?: "center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
135
|
+
offset?: [number, number];
|
|
136
|
+
justify?: "auto" | "left" | "center" | "right";
|
|
137
|
+
allowOverlap?: boolean;
|
|
138
|
+
ignorePlacement?: boolean;
|
|
139
|
+
maxWidth?: number;
|
|
140
|
+
lineHeight?: number;
|
|
141
|
+
letterSpacing?: number;
|
|
142
|
+
backgroundColor?: string;
|
|
143
|
+
backgroundOpacity?: number;
|
|
144
|
+
cursor?: string;
|
|
145
|
+
beforeId?: string;
|
|
146
|
+
minZoom?: number;
|
|
147
|
+
maxZoom?: number;
|
|
148
|
+
properties?: Record<string, any>;
|
|
149
|
+
}
|
|
150
|
+
type TextStyleKey = "fontSize" | "fontWeight" | "color" | "opacity" | "haloColor" | "haloWidth" | "haloBlur" | "translate" | "rotation" | "anchor" | "offset" | "justify" | "maxWidth" | "lineHeight" | "letterSpacing";
|
|
151
|
+
declare class Text {
|
|
152
|
+
readonly id: string;
|
|
153
|
+
private _position;
|
|
154
|
+
private _text;
|
|
155
|
+
private _options;
|
|
156
|
+
private _map;
|
|
157
|
+
private _visible;
|
|
158
|
+
private _sourceId;
|
|
159
|
+
private _layerId;
|
|
160
|
+
constructor(options: TextOptions);
|
|
161
|
+
bindTo(mapOrSdk: any): this;
|
|
162
|
+
private _geojson;
|
|
163
|
+
private _buildFont;
|
|
164
|
+
private _addToMap;
|
|
165
|
+
private _updateSource;
|
|
166
|
+
getText(): string;
|
|
167
|
+
setText(text: string): this;
|
|
168
|
+
getPosition(): [number, number];
|
|
169
|
+
setPosition(position: [number, number]): this;
|
|
170
|
+
setStyle(style: Partial<Pick<TextOptions, TextStyleKey>>): this;
|
|
171
|
+
show(): this;
|
|
172
|
+
hide(): this;
|
|
173
|
+
isVisible(): boolean;
|
|
174
|
+
remove(): void;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
interface MarkerOptions {
|
|
178
|
+
position: [number, number];
|
|
179
|
+
label?: string;
|
|
180
|
+
labelClassName?: string;
|
|
181
|
+
labelFontSize?: number;
|
|
182
|
+
labelColor?: string;
|
|
183
|
+
labelBackground?: string;
|
|
184
|
+
labelOffset?: [number, number];
|
|
185
|
+
labelPosition?: "top" | "bottom" | "left" | "right";
|
|
186
|
+
icon?: string | HTMLElement;
|
|
187
|
+
iconWidth?: number;
|
|
188
|
+
iconHeight?: number;
|
|
189
|
+
color?: string;
|
|
190
|
+
opacity?: number;
|
|
191
|
+
scale?: number;
|
|
192
|
+
draggable?: boolean;
|
|
193
|
+
angle?: number;
|
|
194
|
+
anchor?: "center" | "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
195
|
+
offset?: [number, number];
|
|
196
|
+
cursor?: string;
|
|
197
|
+
popupContent?: string | HTMLElement;
|
|
198
|
+
popupOffset?: number;
|
|
199
|
+
popupMaxWidth?: string;
|
|
200
|
+
popupOpen?: boolean;
|
|
201
|
+
className?: string;
|
|
202
|
+
}
|
|
203
|
+
type MarkerEventType = "click" | "dblclick" | "mouseenter" | "mouseleave" | "dragstart" | "drag" | "dragend";
|
|
204
|
+
declare class EnhancedMarker {
|
|
205
|
+
readonly id: string;
|
|
206
|
+
private _options;
|
|
207
|
+
private _marker;
|
|
208
|
+
private _map;
|
|
209
|
+
private _wrapperEl;
|
|
210
|
+
private _labelEl;
|
|
211
|
+
private _iconEl;
|
|
212
|
+
private _listeners;
|
|
213
|
+
private _visible;
|
|
214
|
+
constructor(options: MarkerOptions);
|
|
215
|
+
private _labelPositionCSS;
|
|
216
|
+
private _buildElement;
|
|
217
|
+
private _buildLabelEl;
|
|
218
|
+
private _applyPopup;
|
|
219
|
+
private _setupEvents;
|
|
220
|
+
bindTo(mapOrSdk: any): this;
|
|
221
|
+
getPosition(): [number, number];
|
|
222
|
+
setPosition(position: [number, number]): this;
|
|
223
|
+
getLabel(): string | undefined;
|
|
224
|
+
setLabel(label: string): this;
|
|
225
|
+
setLabelStyle(style: Partial<Pick<MarkerOptions, "labelFontSize" | "labelColor" | "labelBackground">>): this;
|
|
226
|
+
setIcon(icon: string | HTMLElement): this;
|
|
227
|
+
setIconSize(width: number, height: number): this;
|
|
228
|
+
getDraggable(): boolean;
|
|
229
|
+
setDraggable(draggable: boolean): this;
|
|
230
|
+
getAngle(): number;
|
|
231
|
+
setAngle(angle: number): this;
|
|
232
|
+
setOpacity(opacity: number): this;
|
|
233
|
+
setPopup(content: string | HTMLElement): this;
|
|
234
|
+
openPopup(): this;
|
|
235
|
+
closePopup(): this;
|
|
236
|
+
show(): this;
|
|
237
|
+
hide(): this;
|
|
238
|
+
isVisible(): boolean;
|
|
239
|
+
on(event: MarkerEventType, fn: Function): this;
|
|
240
|
+
off(event: MarkerEventType, fn: Function): this;
|
|
241
|
+
private _emit;
|
|
242
|
+
remove(): void;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
type LineType = "solid" | "dashed" | "dotted" | "dash-dot" | "long-dash" | "double-dash";
|
|
246
|
+
interface PolylineOptions {
|
|
247
|
+
path: [number, number][];
|
|
248
|
+
color?: string;
|
|
249
|
+
width?: number;
|
|
250
|
+
opacity?: number;
|
|
251
|
+
lineType?: LineType;
|
|
252
|
+
dasharray?: number[];
|
|
253
|
+
lineCap?: "butt" | "round" | "square";
|
|
254
|
+
lineJoin?: "bevel" | "round" | "miter";
|
|
255
|
+
miterLimit?: number;
|
|
256
|
+
roundLimit?: number;
|
|
257
|
+
blur?: number;
|
|
258
|
+
offset?: number;
|
|
259
|
+
translate?: [number, number];
|
|
260
|
+
gradient?: any[];
|
|
261
|
+
borderWidth?: number;
|
|
262
|
+
borderColor?: string;
|
|
263
|
+
showArrow?: boolean;
|
|
264
|
+
arrowSpacing?: number;
|
|
265
|
+
label?: string;
|
|
266
|
+
labelSize?: number;
|
|
267
|
+
labelColor?: string;
|
|
268
|
+
labelHaloColor?: string;
|
|
269
|
+
labelHaloWidth?: number;
|
|
270
|
+
labelOffset?: [number, number];
|
|
271
|
+
labelSpacing?: number;
|
|
272
|
+
cursor?: string;
|
|
273
|
+
beforeId?: string;
|
|
274
|
+
minZoom?: number;
|
|
275
|
+
maxZoom?: number;
|
|
276
|
+
properties?: Record<string, any>;
|
|
277
|
+
}
|
|
278
|
+
type PolylineStyleKey = "color" | "width" | "opacity" | "lineType" | "dasharray" | "blur" | "offset" | "translate" | "borderWidth" | "borderColor" | "lineCap" | "lineJoin";
|
|
279
|
+
declare class Polyline {
|
|
280
|
+
readonly id: string;
|
|
281
|
+
private _path;
|
|
282
|
+
private _options;
|
|
283
|
+
private _map;
|
|
284
|
+
private _visible;
|
|
285
|
+
private _sourceId;
|
|
286
|
+
private _borderLayerId;
|
|
287
|
+
private _layerId;
|
|
288
|
+
private _arrowLayerId;
|
|
289
|
+
private _labelLayerId;
|
|
290
|
+
constructor(options: PolylineOptions);
|
|
291
|
+
bindTo(mapOrSdk: any): this;
|
|
292
|
+
private _geojson;
|
|
293
|
+
private _resolveDasharray;
|
|
294
|
+
private _addToMap;
|
|
295
|
+
private _ensureArrowImage;
|
|
296
|
+
private _updateSource;
|
|
297
|
+
getPath(): [number, number][];
|
|
298
|
+
setPath(path: [number, number][]): this;
|
|
299
|
+
getLength(): number;
|
|
300
|
+
getBounds(): [[number, number], [number, number]];
|
|
301
|
+
setStyle(style: Partial<Pick<PolylineOptions, PolylineStyleKey>>): this;
|
|
302
|
+
setLabel(label: string): this;
|
|
303
|
+
show(): this;
|
|
304
|
+
hide(): this;
|
|
305
|
+
isVisible(): boolean;
|
|
306
|
+
remove(): void;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
interface PolygonOptions {
|
|
310
|
+
path: [number, number][][];
|
|
311
|
+
color?: string;
|
|
312
|
+
opacity?: number;
|
|
313
|
+
fillTranslate?: [number, number];
|
|
314
|
+
fillPattern?: string;
|
|
315
|
+
antialias?: boolean;
|
|
316
|
+
strokeColor?: string;
|
|
317
|
+
strokeWidth?: number;
|
|
318
|
+
strokeOpacity?: number;
|
|
319
|
+
strokeLineType?: StrokeLineType;
|
|
320
|
+
strokeDasharray?: number[];
|
|
321
|
+
strokeLineCap?: "butt" | "round" | "square";
|
|
322
|
+
strokeLineJoin?: "bevel" | "round" | "miter";
|
|
323
|
+
strokeBlur?: number;
|
|
324
|
+
strokeOffset?: number;
|
|
325
|
+
strokeTranslate?: [number, number];
|
|
326
|
+
label?: string;
|
|
327
|
+
labelSize?: number;
|
|
328
|
+
labelColor?: string;
|
|
329
|
+
labelHaloColor?: string;
|
|
330
|
+
labelHaloWidth?: number;
|
|
331
|
+
labelAnchor?: "center" | "left" | "right" | "top" | "bottom";
|
|
332
|
+
labelOffset?: [number, number];
|
|
333
|
+
cursor?: string;
|
|
334
|
+
beforeId?: string;
|
|
335
|
+
minZoom?: number;
|
|
336
|
+
maxZoom?: number;
|
|
337
|
+
properties?: Record<string, any>;
|
|
338
|
+
}
|
|
339
|
+
type PolygonStyleKey = "color" | "opacity" | "fillTranslate" | "fillPattern" | "antialias" | "strokeColor" | "strokeWidth" | "strokeOpacity" | "strokeLineType" | "strokeDasharray" | "strokeBlur" | "strokeOffset" | "strokeTranslate" | "strokeLineCap" | "strokeLineJoin";
|
|
340
|
+
declare class EnhancedPolygon {
|
|
341
|
+
readonly id: string;
|
|
342
|
+
private _path;
|
|
343
|
+
private _options;
|
|
344
|
+
private _map;
|
|
345
|
+
private _visible;
|
|
346
|
+
private _sourceId;
|
|
347
|
+
private _fillLayerId;
|
|
348
|
+
private _strokeLayerId;
|
|
349
|
+
private _labelLayerId;
|
|
350
|
+
constructor(options: PolygonOptions);
|
|
351
|
+
bindTo(mapOrSdk: any): this;
|
|
352
|
+
private _geojson;
|
|
353
|
+
private _centroid;
|
|
354
|
+
private _resolveStrokeDash;
|
|
355
|
+
private _addToMap;
|
|
356
|
+
private _updateSource;
|
|
357
|
+
getPath(): [number, number][][];
|
|
358
|
+
setPath(path: [number, number][][]): this;
|
|
359
|
+
getArea(): number;
|
|
360
|
+
getBounds(): [[number, number], [number, number]];
|
|
361
|
+
contains(lnglat: [number, number]): boolean;
|
|
362
|
+
setStyle(style: Partial<Pick<PolygonOptions, PolygonStyleKey>>): this;
|
|
363
|
+
setLabel(label: string): this;
|
|
364
|
+
show(): this;
|
|
365
|
+
hide(): this;
|
|
366
|
+
isVisible(): boolean;
|
|
367
|
+
remove(): void;
|
|
368
|
+
}
|
|
369
|
+
|
|
56
370
|
interface GraticuleConfig {
|
|
57
371
|
enabled?: boolean;
|
|
58
372
|
interval?: number;
|
|
@@ -660,6 +974,11 @@ declare class MapSDK implements IMapSDK {
|
|
|
660
974
|
addLine(coordinates: [], properties?: Record<string, any>, style?: StyleConfig, id?: string): string;
|
|
661
975
|
addPolygon(coordinates: [], properties?: Record<string, any>, style?: StyleConfig, id?: string): string;
|
|
662
976
|
addGeoJSON(sourceId: string, geojson?: any, props?: GeoJSONSourceSpecification | null | undefined): any;
|
|
977
|
+
createCircle(options: CircleOptions): Circle;
|
|
978
|
+
createText(options: TextOptions): Text;
|
|
979
|
+
createMarker(options: MarkerOptions): EnhancedMarker;
|
|
980
|
+
createPolyline(options: PolylineOptions): Polyline;
|
|
981
|
+
createPolygon(options: PolygonOptions): EnhancedPolygon;
|
|
663
982
|
addLayer(layerConfig: LayerConfig): void;
|
|
664
983
|
hoverLayer(layers: LayerRef, cb: (e: any) => void): void;
|
|
665
984
|
hoverPopup(layerId: LayerRef, f: HtmlFunction): () => void;
|
|
@@ -1629,7 +1948,7 @@ declare function buildLayersLight(): ({
|
|
|
1629
1948
|
"text-anchor": string;
|
|
1630
1949
|
"text-justify": string;
|
|
1631
1950
|
"text-size": (string | number | string[])[];
|
|
1632
|
-
"text-offset":
|
|
1951
|
+
"text-offset": number[];
|
|
1633
1952
|
"icon-allow-overlap": boolean;
|
|
1634
1953
|
"icon-ignore-placement": boolean;
|
|
1635
1954
|
"text-allow-overlap": boolean;
|
|
@@ -3225,4 +3544,4 @@ declare function buildLayersDark(): ({
|
|
|
3225
3544
|
maxzoom?: never;
|
|
3226
3545
|
})[];
|
|
3227
3546
|
|
|
3228
|
-
export { API, MapSDK as AviationChart, BuiltInLayer, CHART_THEMES, ClusteringConfig, DEFAULT_LAYER_VISIBILITY, DrawPlugin, ErrorHandler, ErrorManager, EventListener, GROUP_ALIASES, GeoJSONCollection, GeoJSONFeature, GeoJSONManager, GlobalConfigManager, HookCallback, HookContext, HookRegistry, IGeoJSONManager, ILayerManager, IMapSDK, IPlugin, LAYER_GROUPS, LAYER_LABELS, LODConfig, LayerConfig, LayerManager, MapEvent, MapSDK, MapSDKOptions, MeasurePlugin, NOTAM, PerformanceManager, PluginManager, SDKError, StyleConfig, TYPEMAP, WindFrame, WindManager, WindOptions, MapSDK as default, globalConfig };
|
|
3547
|
+
export { API, MapSDK as AviationChart, BuiltInLayer, CHART_THEMES, Circle, CircleOptions, ClusteringConfig, DEFAULT_LAYER_VISIBILITY, DrawPlugin, EnhancedMarker, EnhancedPolygon, ErrorHandler, ErrorManager, EventListener, GROUP_ALIASES, GeoJSONCollection, GeoJSONFeature, GeoJSONManager, GlobalConfigManager, HookCallback, HookContext, HookRegistry, IGeoJSONManager, ILayerManager, IMapSDK, IPlugin, LAYER_GROUPS, LAYER_LABELS, LODConfig, LayerConfig, LayerManager, LineType, MapEvent, MapSDK, MapSDKOptions, MarkerOptions, MeasurePlugin, NOTAM, PerformanceManager, PluginManager, PolygonOptions, Polyline, PolylineOptions, SDKError, StrokeLineType, StyleConfig, TYPEMAP, Text, TextOptions, WindFrame, WindManager, WindOptions, MapSDK as default, globalConfig };
|