@metoceanapi/wxtiles-leaflet 2.3.0-0 → 2.4.0-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.md +2 -0
- package/README.md +16 -3
- package/dep.dot +33 -0
- package/dep.svg +233 -0
- package/dist/es/customlayer/customlayer.d.ts +3 -0
- package/dist/es/index.d.ts +19 -13
- package/dist/es/index.js +6 -2
- package/dist/es/wxAPI/WxAPI.d.ts +3 -61
- package/dist/es/wxAPI/WxDataSetManager.d.ts +35 -123
- package/dist/es/wxsource/wxsource.d.ts +118 -51
- package/dist/es/wxsource/wxsourcetypes.d.ts +70 -10
- package/dist/web/index.js +6 -2
- package/docs/docs/assets/highlight.css +7 -0
- package/docs/docs/assets/search.js +1 -1
- package/docs/docs/classes/CustomWxTilesLayer.html +4 -1
- package/docs/docs/classes/DataIntegral.html +9 -9
- package/docs/docs/classes/QTree.html +41 -14
- package/docs/docs/classes/RawCLUT.html +9 -9
- package/docs/docs/classes/TilesCache.html +5 -5
- package/docs/docs/classes/WxAPI.html +109 -79
- package/docs/docs/classes/WxAPIControl.html +242 -0
- package/docs/docs/classes/WxDataSetManager.html +166 -118
- package/docs/docs/classes/WxInfoControl.html +172 -0
- package/docs/docs/classes/WxLegendControl.html +166 -0
- package/docs/docs/classes/WxStyleEditorControl.html +462 -0
- package/docs/docs/classes/WxTileSource.html +204 -108
- package/docs/docs/classes/WxTimeControl.html +219 -0
- package/docs/docs/enums/TileType.html +4 -4
- package/docs/docs/functions/WXLOG.html +10 -5
- package/docs/docs/functions/WxCreateLegend.html +14 -9
- package/docs/docs/functions/WxGetColorSchemes.html +10 -5
- package/docs/docs/functions/WxGetColorStyles.html +10 -5
- package/docs/docs/functions/WxTilesLogging.html +13 -5
- package/docs/docs/index.html +27 -7
- package/docs/docs/interfaces/CachedUriLoaderPromiseFunc.html +7 -5
- package/docs/docs/interfaces/ColorStylesIncomplete.html +10 -5
- package/docs/docs/interfaces/Converter.html +3 -5
- package/docs/docs/interfaces/DataPicture.html +5 -5
- package/docs/docs/interfaces/FrameworkOptions.html +12 -6
- package/docs/docs/interfaces/IntegralPare.html +3 -3
- package/docs/docs/interfaces/SLinePoint.html +4 -4
- package/docs/docs/interfaces/Tree.html +11 -7
- package/docs/docs/interfaces/WxAPIOptions.html +33 -24
- package/docs/docs/interfaces/WxAllBoundariesMeta.html +14 -9
- package/docs/docs/interfaces/WxAllDatasetsShortMetas.html +11 -6
- package/docs/docs/interfaces/WxBoundaryMeta.html +18 -10
- package/docs/docs/interfaces/WxColorSchemes.html +10 -5
- package/docs/docs/interfaces/WxColorStyleStrict.html +28 -28
- package/docs/docs/interfaces/WxColorStyleWeak.html +28 -28
- package/docs/docs/interfaces/WxColorStylesStrict.html +2 -2
- package/docs/docs/interfaces/WxColorStylesWeakMixed.html +10 -5
- package/docs/docs/interfaces/WxData.html +10 -6
- package/docs/docs/interfaces/WxDataSetManagerOptions.html +15 -15
- package/docs/docs/interfaces/WxDatasetMeta.html +20 -20
- package/docs/docs/interfaces/WxDatasetShortMeta.html +9 -8
- package/docs/docs/interfaces/WxLayerAPI.html +24 -28
- package/docs/docs/interfaces/WxLayerBaseAPI.html +18 -22
- package/docs/docs/interfaces/WxLayerOptions.html +18 -13
- package/docs/docs/interfaces/WxLegend.html +16 -15
- package/docs/docs/interfaces/WxLngLat.html +3 -3
- package/docs/docs/interfaces/WxRasterData.html +11 -8
- package/docs/docs/interfaces/WxRequestInit.html +2 -2
- package/docs/docs/interfaces/WxSourceLayerOptions.html +14 -12
- package/docs/docs/interfaces/WxTick.html +8 -7
- package/docs/docs/interfaces/WxTileInfo.html +10 -10
- package/docs/docs/interfaces/WxUnits.html +10 -5
- package/docs/docs/interfaces/WxVariableMeta.html +13 -12
- package/docs/docs/interfaces/WxVariablesMetas.html +11 -6
- package/docs/docs/interfaces/XYZ.html +4 -4
- package/docs/docs/modules.html +21 -8
- package/docs/docs/types/DataIntegrals.html +10 -5
- package/docs/docs/types/DataPictures.html +10 -5
- package/docs/docs/types/ListenerMethod.html +10 -5
- package/docs/docs/types/Loader.html +116 -0
- package/docs/docs/types/Painter.html +116 -0
- package/docs/docs/types/SLine.html +11 -6
- package/docs/docs/types/SubTrees.html +10 -5
- package/docs/docs/types/SubTreesN.html +12 -7
- package/docs/docs/types/TreeN.html +12 -7
- package/docs/docs/types/WxDate.html +10 -5
- package/docs/docs/types/WxEventType.html +10 -5
- package/docs/docs/types/WxInstances.html +13 -6
- package/docs/docs/types/WxLayer.html +116 -0
- package/docs/docs/types/WxLayerVarsNames.html +11 -6
- package/docs/docs/types/WxURIs.html +10 -5
- package/docs/docs/types/WxUnitTuple.html +10 -5
- package/docs/docs/variables/WxLayerBaseImplementation.html +116 -0
- package/docs/script/script.css +1 -1
- package/docs/script/script.js +8 -8
- package/hooks/pre-commit +29 -0
- package/package.json +9 -2
- package/src_example/frwrkdeps.ts +57 -18
- package/src_example/index.ts +2 -2
- package/src_example/start.ts +100 -46
- package/watch-public.mjs +16 -12
- package/dist/es/controls/WxAPIControl.d.ts +0 -19
- package/dist/es/controls/WxInfoControl.d.ts +0 -16
- package/dist/es/controls/WxLegendControl.d.ts +0 -14
- package/dist/es/controls/WxStyleEditorControl.d.ts +0 -52
- package/dist/es/controls/WxTimeControl .d.ts +0 -18
- package/dist/es/defaults/colorschemes.d.ts +0 -2
- package/dist/es/defaults/styles.d.ts +0 -2
- package/dist/es/defaults/uconv.d.ts +0 -2
- package/dist/es/utils/RawCLUT.d.ts +0 -57
- package/dist/es/utils/mercator.d.ts +0 -4
- package/dist/es/utils/qtree.d.ts +0 -27
- package/dist/es/utils/tests_wxtools.d.ts +0 -1
- package/dist/es/utils/wxtools.d.ts +0 -361
- package/dist/es/wxAPI/WxAPItypes.d.ts +0 -152
- package/dist/es/wxlayer/WxImplementation.d.ts +0 -189
- package/dist/es/wxlayer/loader.d.ts +0 -54
- package/dist/es/wxlayer/loadertools.d.ts +0 -50
- package/dist/es/wxlayer/painter.d.ts +0 -58
- package/dist/es/wxlayer/wxlayer.d.ts +0 -186
- package/docs/docs/classes/Loader.html +0 -165
- package/docs/docs/classes/Painter.html +0 -161
- package/docs/docs/classes/WxLayer.html +0 -419
- package/docs/docs/classes/WxLayerBaseImplementation.html +0 -427
- package/docs/examples/interactive.html +0 -84
- package/docs/examples/res/icon.png +0 -0
- package/docs/examples/res/wxtiles-logo.png +0 -0
- package/docs/examples/seaMaskAndAnimatedBlur.html +0 -76
- package/docs/examples/simpleDemo.html +0 -70
- package/docs/server.py +0 -11
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { type WxColorStyleWeak, type XYZ, type WxColorStyleStrict } from '../utils/wxtools';
|
|
2
|
-
import type { WxRequestInit, WxDate, WxLayerVarsNames, WxLngLat, WxTileInfo, WxRasterDataCache, WxLayerOptions } from './wxlayer';
|
|
3
|
-
import { WxLayer } from './wxlayer';
|
|
4
|
-
import type { WxDatasetMeta, WxVariableMeta } from '../wxAPI/WxAPItypes';
|
|
5
|
-
import { FrameworkParentClass, type FrameworkOptions } from '../wxsource/wxsourcetypes';
|
|
6
|
-
import type { WxDataSetManager } from '../wxAPI/WxDataSetManager';
|
|
7
|
-
import { WxRasterData } from './painter';
|
|
8
|
-
/**
|
|
9
|
-
* Mandatory Interface to be implemented by a {@link WxLayerBaseImplementation}
|
|
10
|
-
*/
|
|
11
|
-
export interface WxLayerBaseAPI {
|
|
12
|
-
wxdatasetManager: WxDataSetManager;
|
|
13
|
-
getCurrentVariableMeta(): WxVariableMeta;
|
|
14
|
-
getVariablesNames(): WxLayerVarsNames;
|
|
15
|
-
clearCache(): void;
|
|
16
|
-
getCurrentStyleObjectCopy(): WxColorStyleStrict;
|
|
17
|
-
getTime(): string;
|
|
18
|
-
setTime(time?: WxDate, requestInit?: WxRequestInit): Promise<string>;
|
|
19
|
-
preloadTime(time: WxDate, requestInit?: WxRequestInit): Promise<void>;
|
|
20
|
-
startAnimation(): void;
|
|
21
|
-
stopAnimation(): Promise<void>;
|
|
22
|
-
setCoarseLevel(level: number): Promise<void>;
|
|
23
|
-
unsetCoarseLevel(): Promise<void>;
|
|
24
|
-
setStyleByName(wxstyleName: string, reload: boolean): Promise<void>;
|
|
25
|
-
updateCurrentStyleObject(style?: WxColorStyleWeak, reload?: boolean, requestInit?: WxRequestInit): Promise<void>;
|
|
26
|
-
}
|
|
27
|
-
export type ListenerMethod = <T extends keyof WxEventType>(arg?: WxEventType[T]) => void;
|
|
28
|
-
export type WxEventType = {
|
|
29
|
-
changed: any;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Mandatory Interface to be implemented by a {@link WxTileSource} implementation
|
|
33
|
-
* These methods *Requires* framework specific implementation
|
|
34
|
-
* */
|
|
35
|
-
export interface WxLayerAPI extends WxLayerBaseAPI {
|
|
36
|
-
getLayerInfoAtLatLon(lnglat: WxLngLat, anymap: any): WxTileInfo | undefined;
|
|
37
|
-
_reloadVisible(requestInit?: WxRequestInit): Promise<void>;
|
|
38
|
-
update(): void;
|
|
39
|
-
coveringTiles(): XYZ[];
|
|
40
|
-
on<T extends keyof WxEventType>(type: T, listener: ListenerMethod): void;
|
|
41
|
-
off<T extends keyof WxEventType>(type: T, listener: ListenerMethod): void;
|
|
42
|
-
once<T extends keyof WxEventType>(type: T, listener: ListenerMethod): void;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Implementation of universal methods for the layer (for Mapbox and Leaflet)
|
|
46
|
-
* To be extended by framework specific implementation
|
|
47
|
-
* Wrapps some methods of {@link WxLayer}
|
|
48
|
-
*/
|
|
49
|
-
export declare class WxLayerBaseImplementation extends FrameworkParentClass implements WxLayerBaseAPI {
|
|
50
|
-
/**
|
|
51
|
-
* @ignore
|
|
52
|
-
* if true, the source is animating
|
|
53
|
-
* */
|
|
54
|
-
protected _animation: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* @ignore
|
|
57
|
-
* a seed for the animation
|
|
58
|
-
* */
|
|
59
|
-
protected _animationSeed: number;
|
|
60
|
-
/**
|
|
61
|
-
* @ignore
|
|
62
|
-
* An instance of the layer
|
|
63
|
-
* */
|
|
64
|
-
protected readonly _layer: WxLayer;
|
|
65
|
-
/**
|
|
66
|
-
* @ignore
|
|
67
|
-
* used to avoid multiple animation requests
|
|
68
|
-
* */
|
|
69
|
-
protected _redrawRequested?: Promise<void>;
|
|
70
|
-
/**
|
|
71
|
-
* @internal
|
|
72
|
-
* Do not use this constructor directly
|
|
73
|
-
* */
|
|
74
|
-
constructor(wxLayerOptions: WxLayerOptions, frwOptions: FrameworkOptions);
|
|
75
|
-
/**
|
|
76
|
-
* returns the dataset manager of the source
|
|
77
|
-
* @returns {WxDataSetManager} the dataset manager of the source
|
|
78
|
-
* */
|
|
79
|
-
get wxdatasetManager(): WxDataSetManager;
|
|
80
|
-
/**
|
|
81
|
-
* Get the metadata of the current variable(s).
|
|
82
|
-
* @returns {WxVariableMeta} - The metadata of the current variable.
|
|
83
|
-
*/
|
|
84
|
-
getCurrentVariableMeta(): WxVariableMeta;
|
|
85
|
-
getDatasetMeta(): WxDatasetMeta;
|
|
86
|
-
/**
|
|
87
|
-
* Get the metadata of the current variable(s).
|
|
88
|
-
* @deprecated
|
|
89
|
-
* @returns {WxVariableMeta} - The metadata of the current variable.
|
|
90
|
-
*/
|
|
91
|
-
getMetadata(): WxVariableMeta;
|
|
92
|
-
/**
|
|
93
|
-
* Get current variables (1 or 2) of the source/layer.
|
|
94
|
-
* @returns {WxLayerVarsNames} variables of the source.
|
|
95
|
-
*/
|
|
96
|
-
getVariablesNames(): WxLayerVarsNames;
|
|
97
|
-
/**
|
|
98
|
-
* Clears the cache of the source.
|
|
99
|
-
*/
|
|
100
|
-
clearCache(): void;
|
|
101
|
-
getCache(): WxRasterDataCache;
|
|
102
|
-
/**
|
|
103
|
-
* Get a copy of the current style of the source.
|
|
104
|
-
* @returns {WxColorStyleStrict} A copy of the current style of the source.
|
|
105
|
-
*/
|
|
106
|
-
getCurrentStyleObjectCopy(): WxColorStyleStrict;
|
|
107
|
-
/**
|
|
108
|
-
* Get the current time of the source.
|
|
109
|
-
* @returns {string} The current time of the source from array of times.
|
|
110
|
-
*/
|
|
111
|
-
getTime(): string;
|
|
112
|
-
getAllTimes(): string[];
|
|
113
|
-
/**
|
|
114
|
-
* Set time and render the source. If the time is not available, the closest time will be used.
|
|
115
|
-
* @param {WxDate} time - Time to set.
|
|
116
|
-
* @param {WxRequestInit | undefined} requestInit - Request options for fetch.
|
|
117
|
-
* @returns {Promise<string>} A promise that resolves with current time step when the time is set and the source is loaded and rendered.
|
|
118
|
-
*/
|
|
119
|
-
setTime(time?: WxDate, requestInit?: WxRequestInit): Promise<string>;
|
|
120
|
-
/**
|
|
121
|
-
* Cache tiles for faster rendering for {@link setTime}. If the time is not available, the closest time will be used.
|
|
122
|
-
* @param time - Time to preload.
|
|
123
|
-
* @param requestInit - Request options.
|
|
124
|
-
* @returns {Promise<void>} A promise that resolves when finished preload.
|
|
125
|
-
*/
|
|
126
|
-
preloadTime(time: WxDate, requestInit?: WxRequestInit): Promise<void>;
|
|
127
|
-
/**
|
|
128
|
-
* Starts the particle animation for wind and currents if sutiable.
|
|
129
|
-
*/
|
|
130
|
-
startAnimation(): void;
|
|
131
|
-
/**
|
|
132
|
-
* Stops the particle animation.
|
|
133
|
-
*/
|
|
134
|
-
stopAnimation(): Promise<void>;
|
|
135
|
-
/** set coarse maximum zoom level to make tiles load faster during animation */
|
|
136
|
-
setCoarseLevel(level?: number): Promise<void>;
|
|
137
|
-
/** restores to the dataset's maximum zoom level */
|
|
138
|
-
unsetCoarseLevel(): Promise<void>;
|
|
139
|
-
/**
|
|
140
|
-
* Set the style of the source by its name from default styles.
|
|
141
|
-
* @param {string} wxstyleName - Name of the new style to set.
|
|
142
|
-
* @param {boolean} reload - If true, the source will be reloaded and rerendered.
|
|
143
|
-
* @returns {Promise<void>} A promise that resolves when the style is set.
|
|
144
|
-
*/
|
|
145
|
-
setStyleByName(wxstyleName: string, reload?: boolean): Promise<void>;
|
|
146
|
-
/**
|
|
147
|
-
* Update the current style object of the source partially or completely.
|
|
148
|
-
* @param {WxColorStyleWeak | undefined} style - Style's fields to set.
|
|
149
|
-
* @param {boolean} reload - If true, the source will be reloaded and rerendered.
|
|
150
|
-
* @param {WxRequestInit | undefined} requestInit - Request options.
|
|
151
|
-
* @returns {Promise<void>} A promise that resolves when the style is set.
|
|
152
|
-
*/
|
|
153
|
-
updateCurrentStyleObject(style?: WxColorStyleWeak, reload?: boolean, requestInit?: WxRequestInit): Promise<void>;
|
|
154
|
-
/** @ignore */
|
|
155
|
-
protected _redrawTiles(): Promise<void>;
|
|
156
|
-
/**
|
|
157
|
-
* @ignore
|
|
158
|
-
* A dummy function to be replaced by ancestor classes.
|
|
159
|
-
*/
|
|
160
|
-
protected _reloadVisible(requestInit?: WxRequestInit): Promise<void>;
|
|
161
|
-
/**
|
|
162
|
-
* @ignore
|
|
163
|
-
* A dummy function to be replaced by ancestor classes.
|
|
164
|
-
*/
|
|
165
|
-
protected coveringTiles(): XYZ[];
|
|
166
|
-
/**
|
|
167
|
-
* @ignore
|
|
168
|
-
* A dummy function to be replaced by ancestor classes.
|
|
169
|
-
* Force reload and redraw all tiles.
|
|
170
|
-
*/
|
|
171
|
-
protected update(): void;
|
|
172
|
-
/**
|
|
173
|
-
* A boolean flag indicating whether the dataset manager needs to be updated or not.
|
|
174
|
-
*/
|
|
175
|
-
protected _needUpdateDSManager: boolean;
|
|
176
|
-
/**
|
|
177
|
-
* @ignore
|
|
178
|
-
* @internal
|
|
179
|
-
* Helper method that loads a tile with the given coordinates and request options.
|
|
180
|
-
* It returns null during datasetManager update or in case of any other error (e.g. network error, not found, etc.)
|
|
181
|
-
* It tries to update datasetManager if e.reason === 'instance-not-found' and update the layer
|
|
182
|
-
* (MAY BE COPY-PASTED!!!)
|
|
183
|
-
*
|
|
184
|
-
* @param {XYZ} coords - The tile coordinates to be loaded.
|
|
185
|
-
* @param {WxRequestInit} requestInit - The request options.
|
|
186
|
-
* @returns {Promise<WxRasterData | null>} - A promise that resolves with the loaded tile or null.
|
|
187
|
-
*/
|
|
188
|
-
protected _loadTileHelper(coords: XYZ, requestInit?: WxRequestInit): Promise<WxRasterData | null>;
|
|
189
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { TileType } from '../utils/qtree';
|
|
2
|
-
import { type DataIntegral, type DataIntegrals, type DataPictures, type XYZ, CachedUriLoaderPromiseFunc } from '../utils/wxtools';
|
|
3
|
-
import { WxRequestInit, WxURIs, type WxLayer } from './wxlayer';
|
|
4
|
-
/** Point on pixel grid */
|
|
5
|
-
export interface SLinePoint {
|
|
6
|
-
x: number;
|
|
7
|
-
y: number;
|
|
8
|
-
}
|
|
9
|
-
/** Line on pixel grid */
|
|
10
|
-
export type SLine = SLinePoint[];
|
|
11
|
-
/** Data of a single tile */
|
|
12
|
-
export interface WxData {
|
|
13
|
-
/**
|
|
14
|
-
* data of the tile one for scalar data, three for vector data (two vars+vector lengths)*/
|
|
15
|
-
data: DataPictures;
|
|
16
|
-
/** streamlines */
|
|
17
|
-
slines: SLine[];
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* A class to load and preprocess data from PNG tiles. Used intenally by WxLayer.
|
|
21
|
-
* Do not use directly.
|
|
22
|
-
*/
|
|
23
|
-
export declare class Loader {
|
|
24
|
-
/** refference to the Layer {@link WxLayer} in which this loader is used */
|
|
25
|
-
protected readonly _layer: WxLayer;
|
|
26
|
-
/** function to load, decode and cache data from URL */
|
|
27
|
-
protected _loadDataFunc: CachedUriLoaderPromiseFunc<DataIntegral>;
|
|
28
|
-
/** Do not use constructor directly */
|
|
29
|
-
constructor(layer: WxLayer);
|
|
30
|
-
/**
|
|
31
|
-
* Load and preprocess data for a single tile
|
|
32
|
-
* @param tile - tile coordinates
|
|
33
|
-
* @param requestInit - requestInit for fetch
|
|
34
|
-
* @returns {Promise<WxData | null> } data of the tile
|
|
35
|
-
* */
|
|
36
|
-
load(tile: XYZ, requestInit?: WxRequestInit): Promise<WxData | null>;
|
|
37
|
-
cacheLoad(tile: XYZ, uris: WxURIs, requestInit?: WxRequestInit): Promise<{
|
|
38
|
-
rawdata: DataIntegrals;
|
|
39
|
-
subCoords?: XYZ | undefined;
|
|
40
|
-
tileType: TileType;
|
|
41
|
-
} | null>;
|
|
42
|
-
/** Clear cache */
|
|
43
|
-
clearCache(): void;
|
|
44
|
-
/** @ignore */
|
|
45
|
-
protected _applyMask(data: DataPictures, tile: XYZ, tileType: TileType, needCopy: boolean): Promise<void>;
|
|
46
|
-
/** @ignore */
|
|
47
|
-
protected _vectorMagnitudesPrepare(data: DataPictures): void;
|
|
48
|
-
/** @ignore */
|
|
49
|
-
protected _checkTypeAndMask(coords: XYZ): TileType | undefined;
|
|
50
|
-
/** @ignore */
|
|
51
|
-
protected _checkInsideBoundaries(coords: XYZ): boolean;
|
|
52
|
-
/** @ignore */
|
|
53
|
-
protected _createStreamLines(data: DataPictures): SLine[];
|
|
54
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { DataPicture, XYZ } from '../utils/wxtools';
|
|
2
|
-
import { WxBoundaryMeta } from '../wxAPI/WxAPItypes';
|
|
3
|
-
/**
|
|
4
|
-
* Get sub-tile of a mask via baricemrtric interpolation
|
|
5
|
-
* @param {ImageData} inputData - input data
|
|
6
|
-
* @param {XYZ | undefined} subCoords - subtile coordinates
|
|
7
|
-
* @returns {ImageData} subtile data
|
|
8
|
-
* */
|
|
9
|
-
export declare function subMask(inputData: ImageData, subCoords: XYZ | undefined, channel: number): ImageData;
|
|
10
|
-
/**
|
|
11
|
-
* Get sub-tile of a regular data via baricemrtric interpolation
|
|
12
|
-
* @param {DataPicture} inputData - input data
|
|
13
|
-
* @param {XYZ | undefined} subCoords - subtile coordinates
|
|
14
|
-
* @returns {DataPicture} subtile data
|
|
15
|
-
* */
|
|
16
|
-
export declare function subData(inputData: DataPicture, subCoords?: XYZ): DataPicture;
|
|
17
|
-
/**
|
|
18
|
-
* Get sub-tile of a degree data tile via bilinear degree interpolation, so middle of 350..10 degree is 0 degree.
|
|
19
|
-
* @param {DataPicture} inputData - input data
|
|
20
|
-
* @param {XYZ | undefined} subCoords - subtile coordinates
|
|
21
|
-
* @returns {DataPicture} subtile data
|
|
22
|
-
* */
|
|
23
|
-
export declare function subDataDegree(inputData: DataPicture, subCoords?: XYZ): DataPicture;
|
|
24
|
-
/**
|
|
25
|
-
* Upply sea/land mask to a data tile
|
|
26
|
-
* 0 - for the masks from Sarah (current), 3 - for the masks from Mapbox
|
|
27
|
-
* @param {DataPicture} dataIn - data tile
|
|
28
|
-
* @param {ImageData} mask - sea/land mask
|
|
29
|
-
* @param {number} mc - mask channel of the mask picture to use (0 - Red, 1 - Green, 2 - Blue, 3 - Alpha)
|
|
30
|
-
* @param {'sea' | 'land'} maskType - sea or land masking to apply
|
|
31
|
-
* @returns {DataPicture} - masked data tile
|
|
32
|
-
* */
|
|
33
|
-
export declare function applyMask(dataIn: DataPicture, { data }: ImageData, mc: number, maskType: 'land' | 'sea'): DataPicture;
|
|
34
|
-
/**
|
|
35
|
-
* Create a bounding box for a tile
|
|
36
|
-
* @param coords - tile coordinates
|
|
37
|
-
* @returns {WxBoundaryMeta} [minLon, minLat, maxLon, maxLat]
|
|
38
|
-
* */
|
|
39
|
-
export declare function makeBox(coords: XYZ): WxBoundaryMeta;
|
|
40
|
-
/**
|
|
41
|
-
* Splits tile coordinates into a tile coords at maximum zoom and a subtile coords.
|
|
42
|
-
* If the tile is below maximum zoom, the subtile coords are undefined.
|
|
43
|
-
* @param coords - tile coordinates
|
|
44
|
-
* @param maxZoom - maximum zoom
|
|
45
|
-
* @returns [tile coords, subtile coords (or undefined)]
|
|
46
|
-
* */
|
|
47
|
-
export declare function splitCoords(coords: XYZ, maxZoom: number): {
|
|
48
|
-
upCoords: XYZ;
|
|
49
|
-
subCoords?: XYZ;
|
|
50
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { type WxData } from './loader';
|
|
2
|
-
import { type WxLayer } from './wxlayer';
|
|
3
|
-
/**
|
|
4
|
-
* data object contains raw data, contexts, and other info for fast rendering of a single tile
|
|
5
|
-
* */
|
|
6
|
-
export interface WxRasterData {
|
|
7
|
-
/**
|
|
8
|
-
* Context for drawing back fill and isolines
|
|
9
|
-
*/
|
|
10
|
-
ctxFill: CanvasRenderingContext2D;
|
|
11
|
-
/**
|
|
12
|
-
* Context for rendering vector arrows, and other text
|
|
13
|
-
* */
|
|
14
|
-
ctxText: CanvasRenderingContext2D;
|
|
15
|
-
/**
|
|
16
|
-
* Context for rendering animated streamlines
|
|
17
|
-
* */
|
|
18
|
-
ctxStreamLines: CanvasRenderingContext2D;
|
|
19
|
-
/**
|
|
20
|
-
* {@link WxData} data object for this tile
|
|
21
|
-
* */
|
|
22
|
-
data: WxData;
|
|
23
|
-
rd?: {
|
|
24
|
-
vectorTextureU: WebGLTexture;
|
|
25
|
-
vectorTextureV: WebGLTexture;
|
|
26
|
-
gl: WebGLRenderingContext;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Calss for rendering a single tile.
|
|
31
|
-
* Do not create manually
|
|
32
|
-
* */
|
|
33
|
-
export declare class Painter {
|
|
34
|
-
/**
|
|
35
|
-
* @internal
|
|
36
|
-
* {@link WxLayer} - parent layer
|
|
37
|
-
* */
|
|
38
|
-
protected _layer: WxLayer;
|
|
39
|
-
/**
|
|
40
|
-
* @internal
|
|
41
|
-
* Do not use constructor directly
|
|
42
|
-
* */
|
|
43
|
-
constructor(layer: WxLayer);
|
|
44
|
-
/**
|
|
45
|
-
* @internal
|
|
46
|
-
* Render data of a single tile into canvases passed in {@link WxRasterData}
|
|
47
|
-
* @param {WxRasterData} data - data object for this tile
|
|
48
|
-
* */
|
|
49
|
-
paint({ data, ctxFill, ctxText, ctxStreamLines }: WxRasterData): void;
|
|
50
|
-
getPaintedCanvas(data: WxRasterData, animation: boolean, seed: number): HTMLCanvasElement;
|
|
51
|
-
/**
|
|
52
|
-
* @internal
|
|
53
|
-
* Render animated streamlines for a single tile with time seed
|
|
54
|
-
* @param {WxRasterData} data - data object for this tile
|
|
55
|
-
* @param {number} seed - time seed
|
|
56
|
-
* */
|
|
57
|
-
imprintVectorAnimationLinesStep({ data, ctxFill, ctxStreamLines }: WxRasterData, seed: number): void;
|
|
58
|
-
}
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import { RawCLUT } from '../utils/RawCLUT';
|
|
2
|
-
import type { WxColorStyleStrict, XYZ, DataPictures, WxColorStyleWeak } from '../utils/wxtools';
|
|
3
|
-
import type { WxAllBoundariesMeta, WxVariableMeta } from '../wxAPI/WxAPItypes';
|
|
4
|
-
import type { WxDataSetManager } from '../wxAPI/WxDataSetManager';
|
|
5
|
-
import { Loader } from './loader';
|
|
6
|
-
import { Painter, type WxRasterData } from './painter';
|
|
7
|
-
/**
|
|
8
|
-
* Type used to set a time step for the layer.
|
|
9
|
-
* Can be
|
|
10
|
-
* 1. a string in the dataset's format,
|
|
11
|
-
* 2. a number of a time step in the dataset's meta data,
|
|
12
|
-
* 3. a number of milliseconds since 1970-01-01T00:00:00Z
|
|
13
|
-
* 4. a Date object.
|
|
14
|
-
* */
|
|
15
|
-
export type WxDate = string | number | Date;
|
|
16
|
-
/** Used to make an abortable call to the layer update */
|
|
17
|
-
export interface WxRequestInit {
|
|
18
|
-
signal?: AbortSignal;
|
|
19
|
-
}
|
|
20
|
-
/** Information about the current point on map returned by the {@link WxLayer} method. */
|
|
21
|
-
export interface WxTileInfo {
|
|
22
|
-
/** values of all variables in datasets's units */
|
|
23
|
-
data: number[];
|
|
24
|
-
/** RAW values of all variables in internal representation */
|
|
25
|
-
raw: number[];
|
|
26
|
-
/** **uint32** colors defined by curent values {@link WxTileInfo.data} and the style */
|
|
27
|
-
rgba: number[];
|
|
28
|
-
/** web colors defined by curent values {@link WxTileInfo.data} and the style */
|
|
29
|
-
hexColor: string[];
|
|
30
|
-
/** values of all variables in Style's units */
|
|
31
|
-
inStyleUnits: number[];
|
|
32
|
-
/** The current point on map. */
|
|
33
|
-
tilePoint: {
|
|
34
|
-
x: number;
|
|
35
|
-
y: number;
|
|
36
|
-
};
|
|
37
|
-
/** WxUnits defined style */
|
|
38
|
-
styleUnits: string;
|
|
39
|
-
/** WxUnits defined dataset */
|
|
40
|
-
dataUnits: string;
|
|
41
|
-
}
|
|
42
|
-
/** Array of variable names to be used in {@link WxLayer} */
|
|
43
|
-
export type WxLayerVarsNames = [string] | [string, string];
|
|
44
|
-
/** @internal Array of URIs to request tiles */
|
|
45
|
-
export type WxURIs = [string] | [string, string];
|
|
46
|
-
/** Lon/Lat coordinates */
|
|
47
|
-
export interface WxLngLat {
|
|
48
|
-
/** Longitude */
|
|
49
|
-
lng: number;
|
|
50
|
-
/** Latitude */
|
|
51
|
-
lat: number;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* @internal
|
|
55
|
-
* Used in {@link WxLayerBaseImplementation} cache of the renderes tiles
|
|
56
|
-
* */
|
|
57
|
-
export declare class WxRasterDataCache extends Map<string, WxRasterData> {
|
|
58
|
-
clear(): void;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* @internal
|
|
62
|
-
* Do not use this type directly, use {@link WxSourceLayerOptions} instead
|
|
63
|
-
* */
|
|
64
|
-
export interface WxLayerOptions {
|
|
65
|
-
/** Variables of the layer */
|
|
66
|
-
variables: WxLayerVarsNames;
|
|
67
|
-
/** Dataset Manager */
|
|
68
|
-
wxdatasetManager: WxDataSetManager;
|
|
69
|
-
/** initial time step */
|
|
70
|
-
time: WxDate;
|
|
71
|
-
/** initial style name */
|
|
72
|
-
wxstyleName?: string;
|
|
73
|
-
/** initial style, applyed on top of style passed by name {@link wxstyleName} */
|
|
74
|
-
wxstyle?: WxColorStyleWeak;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* @internal
|
|
78
|
-
* Used in {@link WxLayerBaseImplementation} to manipulate the the layer's style, data and time
|
|
79
|
-
* */
|
|
80
|
-
export declare class WxLayer {
|
|
81
|
-
/** @internal Variables to be displayed by the layer */
|
|
82
|
-
readonly variables: WxLayerVarsNames;
|
|
83
|
-
/** @internal Data manager created this layer */
|
|
84
|
-
readonly wxdatasetManager: WxDataSetManager;
|
|
85
|
-
/** @internal Current time*/
|
|
86
|
-
protected _time: string;
|
|
87
|
-
/** @internal Current variable's Meta data of the layer*/
|
|
88
|
-
currentVariableMeta: WxVariableMeta;
|
|
89
|
-
/** @internal current URIs to fetch tiles */
|
|
90
|
-
tilesURIs: WxURIs;
|
|
91
|
-
/** @internal current Style Object */
|
|
92
|
-
style: WxColorStyleStrict;
|
|
93
|
-
/** @internal Current "Color lookup table" object */
|
|
94
|
-
CLUT: RawCLUT;
|
|
95
|
-
/** @internal cahce: URI->rendered data on canvases */
|
|
96
|
-
tilesRasterCache: WxRasterDataCache;
|
|
97
|
-
/** @internal current coarsing zoom level */
|
|
98
|
-
coarseLevel: number;
|
|
99
|
-
/** @internal Painter object to render tiles */
|
|
100
|
-
protected readonly _painter: Painter;
|
|
101
|
-
/** @internal Loader object to load and preprocess tiles */
|
|
102
|
-
protected readonly _loader: Loader;
|
|
103
|
-
constructor(wxLayerOptions: WxLayerOptions);
|
|
104
|
-
/** Check if the layer is vector and may be animated according to style */
|
|
105
|
-
get nonanimatable(): boolean;
|
|
106
|
-
/**
|
|
107
|
-
* @internal
|
|
108
|
-
* Get maximum zoom according to the layer's Dataset manager
|
|
109
|
-
* @returns {number} maximum zoom
|
|
110
|
-
*/
|
|
111
|
-
getMaxZoom(): number;
|
|
112
|
-
getCoarseMaxZoom(): number;
|
|
113
|
-
/**
|
|
114
|
-
* @internal
|
|
115
|
-
* Get boundaries zoom according to the layer's Dataset manager
|
|
116
|
-
* @returns {WxAllBoundariesMeta | undefined} boundaries
|
|
117
|
-
* */
|
|
118
|
-
getBoundaries(): WxAllBoundariesMeta | undefined;
|
|
119
|
-
/**
|
|
120
|
-
* @internal
|
|
121
|
-
* Get the current time step of the layer
|
|
122
|
-
* @returns {string} time step in the dataset meta's format */
|
|
123
|
-
getTime(): string;
|
|
124
|
-
/**
|
|
125
|
-
* @internal
|
|
126
|
-
* Clear the cache of tiles
|
|
127
|
-
* Not to use when loading is in progress. */
|
|
128
|
-
clearCache(): void;
|
|
129
|
-
/** @internal */
|
|
130
|
-
getCurrentStyleObjectCopy(): WxColorStyleStrict;
|
|
131
|
-
/** @internal */
|
|
132
|
-
updateCurrentStyleObject(style?: WxColorStyleWeak): void;
|
|
133
|
-
/** @internal Used by {@link WxTileSource.getLayerInfoAtLatLon} */
|
|
134
|
-
getTileData(tileCoord: XYZ, tilePixel: {
|
|
135
|
-
x: number;
|
|
136
|
-
y: number;
|
|
137
|
-
}): WxTileInfo | undefined;
|
|
138
|
-
/** @internal reassign URIs and a time step with a new given time step */
|
|
139
|
-
setURLsAndTime(time_?: WxDate): void;
|
|
140
|
-
getPaintedCanvas(data: WxRasterData, animation: boolean, seed: number): HTMLCanvasElement;
|
|
141
|
-
/**
|
|
142
|
-
* @internal
|
|
143
|
-
* load, cache, draw the tile. Abortable
|
|
144
|
-
* */
|
|
145
|
-
loadTile(tile: XYZ, requestInit?: WxRequestInit): Promise<WxRasterData | null>;
|
|
146
|
-
/**
|
|
147
|
-
* @internal
|
|
148
|
-
* cache given time step for faster access when needed. Resolved when done.
|
|
149
|
-
* @param time_ time step to cache
|
|
150
|
-
* @param requestInit request options
|
|
151
|
-
* @returns {Promise<void>}
|
|
152
|
-
* */
|
|
153
|
-
preloadTime(time_: WxDate, tiles: XYZ[], requestInit?: WxRequestInit): Promise<void>;
|
|
154
|
-
/**
|
|
155
|
-
* @internal
|
|
156
|
-
* Load all tiles, draw it on canvas, save to cache and return. Resolved when done.
|
|
157
|
-
* @param tiles
|
|
158
|
-
* @param requestInit
|
|
159
|
-
* @returns {Promise<viod>} */
|
|
160
|
-
reloadTiles(tiles: XYZ[], requestInit?: WxRequestInit): Promise<void>;
|
|
161
|
-
/**
|
|
162
|
-
* @internal
|
|
163
|
-
* @ignore
|
|
164
|
-
* */
|
|
165
|
-
protected _loadCacheDrawTile(tile: XYZ, tilesRasterCache: WxRasterDataCache, requestInit?: WxRequestInit): Promise<WxRasterData | null>;
|
|
166
|
-
/**
|
|
167
|
-
* @internal
|
|
168
|
-
* @ignore
|
|
169
|
-
* creates/calculates meta data for vector layers
|
|
170
|
-
* */
|
|
171
|
-
protected _getCurrentVariableMeta(): WxVariableMeta;
|
|
172
|
-
/** @ignore x, y - pixel on tile, data - data tile */
|
|
173
|
-
protected _getPixelInfo({ x, y }: {
|
|
174
|
-
x: number;
|
|
175
|
-
y: number;
|
|
176
|
-
}, data: DataPictures): {
|
|
177
|
-
raw: number[];
|
|
178
|
-
data: number[];
|
|
179
|
-
} | undefined;
|
|
180
|
-
/** @ignore */
|
|
181
|
-
protected _createStyleAndCLUT(style_?: WxColorStyleWeak): [WxColorStyleStrict, RawCLUT];
|
|
182
|
-
/** @ignore Create a new CLUT for the given style */
|
|
183
|
-
protected _prepareCLUT(style: WxColorStyleStrict): RawCLUT;
|
|
184
|
-
/** @ignore calculate valid timestep and URIs */
|
|
185
|
-
protected _createURLsAndTime(time_?: WxDate): [WxURIs, string];
|
|
186
|
-
}
|