@metoceanapi/wxtiles-leaflet 2.4.0-1 → 2.4.1-3
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 +4 -0
- package/README.md +214 -92
- package/dist/es/index.d.ts +12 -16
- package/dist/es/index.js +4 -4
- package/dist/es/wxAPI/WxAPI.d.ts +17 -0
- package/dist/es/wxAPI/WxDataSetManager.d.ts +14 -4
- package/dist/es/wxsource/wxsource.d.ts +24 -20
- package/dist/es/wxsource/wxsourcetypes.d.ts +22 -10
- package/dist/web/index.js +4 -4
- package/docs/docs/assets/highlight.css +12 -19
- package/docs/docs/assets/search.js +1 -1
- package/docs/docs/classes/WxAPI.html +31 -18
- package/docs/docs/classes/WxAPIControl.html +70 -24
- package/docs/docs/classes/WxDataSetManager.html +22 -21
- package/docs/docs/classes/WxInfoControl.html +37 -10
- package/docs/docs/classes/WxLegendControl.html +33 -11
- package/docs/docs/classes/WxStyleEditorControl.html +206 -94
- package/docs/docs/classes/WxTileSource.html +40 -40
- package/docs/docs/classes/WxTimeControl.html +58 -20
- package/docs/docs/index.html +188 -101
- package/docs/docs/interfaces/FrameworkOptions.html +3 -3
- package/docs/docs/interfaces/WxSourceLayerOptions.html +5 -5
- package/docs/docs/modules.html +12 -130
- package/docs/docs/types/Loader.html +3 -59
- package/docs/docs/types/Painter.html +3 -59
- package/docs/docs/types/WxLayer.html +3 -59
- package/docs/docs/variables/WxLayerBaseImplementation.html +3 -59
- package/docs/script/script.css +1 -1
- package/docs/script/script.js +6 -6
- package/package.json +3 -3
- package/src_example/frwrkdeps.ts +131 -80
- package/src_example/index.ts +2 -53
- package/src_example/start.ts +143 -300
- package/dep.dot +0 -33
- package/dep.svg +0 -233
- package/docs/docs/classes/DataIntegral.html +0 -154
- package/docs/docs/classes/QTree.html +0 -185
- package/docs/docs/classes/RawCLUT.html +0 -143
- package/docs/docs/classes/TilesCache.html +0 -108
- package/docs/docs/enums/TileType.html +0 -80
- package/docs/docs/functions/WXLOG.html +0 -127
- package/docs/docs/functions/WxCreateLegend.html +0 -135
- package/docs/docs/functions/WxGetColorSchemes.html +0 -122
- package/docs/docs/functions/WxGetColorStyles.html +0 -122
- package/docs/docs/functions/WxTilesLogging.html +0 -130
- package/docs/docs/interfaces/CachedUriLoaderPromiseFunc.html +0 -108
- package/docs/docs/interfaces/ColorStylesIncomplete.html +0 -125
- package/docs/docs/interfaces/Converter.html +0 -81
- package/docs/docs/interfaces/DataPicture.html +0 -95
- package/docs/docs/interfaces/IntegralPare.html +0 -81
- package/docs/docs/interfaces/SLinePoint.html +0 -77
- package/docs/docs/interfaces/Tree.html +0 -74
- package/docs/docs/interfaces/WxAPIOptions.html +0 -173
- package/docs/docs/interfaces/WxAllBoundariesMeta.html +0 -90
- package/docs/docs/interfaces/WxAllDatasetsShortMetas.html +0 -125
- package/docs/docs/interfaces/WxBoundaryMeta.html +0 -99
- package/docs/docs/interfaces/WxColorSchemes.html +0 -126
- package/docs/docs/interfaces/WxColorStyleStrict.html +0 -359
- package/docs/docs/interfaces/WxColorStyleWeak.html +0 -388
- package/docs/docs/interfaces/WxColorStylesStrict.html +0 -74
- package/docs/docs/interfaces/WxColorStylesWeakMixed.html +0 -125
- package/docs/docs/interfaces/WxData.html +0 -85
- package/docs/docs/interfaces/WxDataSetManagerOptions.html +0 -117
- package/docs/docs/interfaces/WxDatasetMeta.html +0 -144
- package/docs/docs/interfaces/WxDatasetShortMeta.html +0 -91
- package/docs/docs/interfaces/WxLayerAPI.html +0 -375
- package/docs/docs/interfaces/WxLayerBaseAPI.html +0 -242
- package/docs/docs/interfaces/WxLayerOptions.html +0 -113
- package/docs/docs/interfaces/WxLegend.html +0 -118
- package/docs/docs/interfaces/WxLngLat.html +0 -81
- package/docs/docs/interfaces/WxRasterData.html +0 -118
- package/docs/docs/interfaces/WxRequestInit.html +0 -70
- package/docs/docs/interfaces/WxTick.html +0 -100
- package/docs/docs/interfaces/WxTileInfo.html +0 -142
- package/docs/docs/interfaces/WxUnits.html +0 -125
- package/docs/docs/interfaces/WxVariableMeta.html +0 -109
- package/docs/docs/interfaces/WxVariablesMetas.html +0 -125
- package/docs/docs/interfaces/XYZ.html +0 -84
- package/docs/docs/types/DataIntegrals.html +0 -118
- package/docs/docs/types/DataPictures.html +0 -118
- package/docs/docs/types/ListenerMethod.html +0 -134
- package/docs/docs/types/SLine.html +0 -118
- package/docs/docs/types/SubTrees.html +0 -118
- package/docs/docs/types/SubTreesN.html +0 -118
- package/docs/docs/types/TreeN.html +0 -118
- package/docs/docs/types/WxDate.html +0 -125
- package/docs/docs/types/WxEventType.html +0 -121
- package/docs/docs/types/WxInstances.html +0 -118
- package/docs/docs/types/WxLayerVarsNames.html +0 -118
- package/docs/docs/types/WxURIs.html +0 -118
- package/docs/docs/types/WxUnitTuple.html +0 -118
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,63 +1,58 @@
|
|
|
1
1
|
# wxtiles
|
|
2
2
|
|
|
3
3
|
This is a project for weather data visualization.
|
|
4
|
-
There are
|
|
4
|
+
There are two main parts of the project:
|
|
5
5
|
|
|
6
|
-
1. [Splitter](https://github.com/metocean/wxtile-splitter) - a service that splits the datasets into tiles (PNG) and some metadata (JSON) served by a fileserver backend
|
|
7
|
-
2. [
|
|
8
|
-
3. [WxTiles-leaflet source code](https://github.com/metoceanapi/wxtiles-leaflet), npm [@metoceanapi/wxtiles-leaflet](https://www.npmjs.com/package/@metoceanapi/wxtiles-leaflet) - a JS API providing work with metadata, dataset manager and an implementation of a Custom Leaflet Layer for visualizing the tiles using [Leaflet](https://leafletjs.com/).
|
|
6
|
+
1. [Splitter](https://github.com/metocean/wxtile-splitter) - a service that splits the datasets into tiles (PNG) and some metadata (JSON) served by a fileserver backend.
|
|
7
|
+
2. [@metoceanapi/wxtiles-leaflet](https://www.npmjs.com/package/@metoceanapi/wxtiles-leaflet) - a JS API providing work with metadata, dataset manager and an implementation of a Custom Leaflet Layer for visualizing the tiles using [Leaflet](https://leafletjs.com/).
|
|
9
8
|
|
|
10
9
|
## API
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Usage and API documentation is mainly equal for both frameworks.
|
|
11
|
+
The API for Leaflet is designed for working with weather data tiles and allows the integration of custom layers for data visualization.
|
|
15
12
|
|
|
16
13
|
## DOCS
|
|
17
14
|
|
|
18
|
-
-
|
|
19
|
-
- Leaflet: https://metoceanapi.github.io/wxtiles-leaflet/docs/
|
|
15
|
+
- [Leaflet](https://metoceanapi.github.io/wxtiles-leaflet/docs/)
|
|
20
16
|
|
|
21
17
|
## Examples
|
|
22
18
|
|
|
23
|
-
1. [SimpleDemo](https://metoceanapi.github.io/wxtiles-leaflet/examples/simpleDemo.html)
|
|
19
|
+
1. [SimpleDemo](https://metoceanapi.github.io/wxtiles-leaflet/examples/simpleDemo.html)
|
|
24
20
|
2. [Animated blur parameter](https://metoceanapi.github.io/wxtiles-leaflet/examples/seaMaskAndAnimatedBlur.html)
|
|
25
21
|
3. [Mouse Interaction](https://metoceanapi.github.io/wxtiles-leaflet/examples/interactive.html)
|
|
26
22
|
|
|
27
23
|
### Leaflet
|
|
28
24
|
|
|
29
25
|
```ts
|
|
30
|
-
import
|
|
31
|
-
import L from
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}()
|
|
26
|
+
import "leaflet/dist/leaflet.css";
|
|
27
|
+
import L from "leaflet";
|
|
28
|
+
|
|
29
|
+
async function start() {
|
|
30
|
+
const wxapi = new WxAPI({
|
|
31
|
+
dataServerURL: "https://tiles.metoceanapi.com/data/",
|
|
32
|
+
requestInit: {
|
|
33
|
+
headers: new Headers({'x-api-key': 'your_key_here'}),
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const wxdatasetManager = await wxapi.createDatasetManager("gfs.global");
|
|
38
|
+
const variable = "air.temperature.at-2m";
|
|
39
|
+
// 'wind.speed.eastward.at-10m' - Vector example
|
|
40
|
+
|
|
41
|
+
const leafletOptions = {
|
|
42
|
+
opacity: 1,
|
|
43
|
+
attribution: "WxTiles",
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// Create a layer
|
|
47
|
+
const wxsource = wxdatasetManager.createSourceLayer(
|
|
48
|
+
{ variable },
|
|
49
|
+
leafletOptions
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const map = L.map("map", { center: [0, 0], zoom: 2, zoomControl: true });
|
|
53
|
+
map.addLayer(wxsource);
|
|
54
|
+
await new Promise((done) => wxsource.once("load", done)); // Highly recommended to await the first load
|
|
55
|
+
}
|
|
61
56
|
```
|
|
62
57
|
|
|
63
58
|
### Change the time step
|
|
@@ -69,7 +64,7 @@ await wxsource.setTimeStep(1); // 1 - index of the time step in the dataset
|
|
|
69
64
|
or
|
|
70
65
|
|
|
71
66
|
```ts
|
|
72
|
-
await wxsource.setTimeStep(
|
|
67
|
+
await wxsource.setTimeStep("2020-01-01T00:00:00Z"); // '2020-01-01T00:00:00Z' - time step in the dataset
|
|
73
68
|
```
|
|
74
69
|
|
|
75
70
|
or
|
|
@@ -81,95 +76,222 @@ await wxsource.setTimeStep(2345323454); // time in seconds since 1970-01-01T00:
|
|
|
81
76
|
or
|
|
82
77
|
|
|
83
78
|
```ts
|
|
84
|
-
await wxsource.setTimeStep(new Date(
|
|
79
|
+
await wxsource.setTimeStep(new Date("2020-01-01T00:00:00Z")); // Date object
|
|
85
80
|
```
|
|
86
81
|
|
|
87
|
-
### Update the
|
|
82
|
+
### Update the Style
|
|
88
83
|
|
|
89
84
|
```ts
|
|
90
|
-
await wxsource.updateCurrentStyleObject({ units:
|
|
85
|
+
await wxsource.updateCurrentStyleObject({ units: "m/s", levels: undefined }); // set levels to undefined - to automatically calculate the levels from the dataset
|
|
91
86
|
```
|
|
92
87
|
|
|
93
|
-
### Preload the
|
|
88
|
+
### Preload the Time Steps
|
|
94
89
|
|
|
95
90
|
```ts
|
|
96
|
-
//
|
|
97
|
-
|
|
98
|
-
// do stuff asyncronously
|
|
91
|
+
const prom = wxsource.preloadTime(10); // Load the time step 10 to the cache but do not render it
|
|
92
|
+
// Do stuff asynchronously
|
|
99
93
|
// ...
|
|
100
|
-
await prom; //
|
|
101
|
-
//
|
|
102
|
-
await wxsource.setTime(10); // will be fast rendered from the cache
|
|
94
|
+
await prom; // Wait for the time step to finish loading
|
|
95
|
+
await wxsource.setTime(10); // Now set the time step to 10; it will render quickly from the cache
|
|
103
96
|
```
|
|
104
97
|
|
|
105
|
-
### Abort
|
|
98
|
+
### Abort Loading
|
|
106
99
|
|
|
107
100
|
```ts
|
|
108
101
|
const abortController = new AbortController();
|
|
109
|
-
console.log(
|
|
102
|
+
console.log("setTime(5)");
|
|
110
103
|
const prom = wxsource.setTime(5, abortController);
|
|
111
|
-
abortController.abort(); //
|
|
112
|
-
await prom; // await
|
|
113
|
-
console.log(
|
|
104
|
+
abortController.abort(); // Aborts the request
|
|
105
|
+
await prom; // Always await, even if aborted
|
|
106
|
+
console.log("aborted");
|
|
114
107
|
```
|
|
115
108
|
|
|
116
|
-
### Get the
|
|
109
|
+
### Get the Current Time Step
|
|
117
110
|
|
|
118
111
|
```ts
|
|
119
112
|
const timeStep = wxsource.getTime();
|
|
120
113
|
```
|
|
121
114
|
|
|
122
|
-
###
|
|
115
|
+
### Read Lon/Lat Data
|
|
123
116
|
|
|
124
117
|
```ts
|
|
125
|
-
map.on(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
118
|
+
map.on("mousemove", (e) => {
|
|
119
|
+
if (!wxsource) return;
|
|
120
|
+
const pos = position(e);
|
|
121
|
+
const tileInfo: WxTileInfo | undefined = wxsource.getLayerInfoAtLatLon(
|
|
122
|
+
pos.wrap(),
|
|
123
|
+
map
|
|
124
|
+
);
|
|
125
|
+
if (tileInfo) {
|
|
126
|
+
console.log(tileInfo);
|
|
127
|
+
}
|
|
132
128
|
});
|
|
133
129
|
```
|
|
134
130
|
|
|
135
|
-
###
|
|
131
|
+
### Animated Blur Effect
|
|
136
132
|
|
|
137
133
|
```ts
|
|
138
134
|
(async function step(n: number = 0) {
|
|
139
|
-
|
|
140
|
-
|
|
135
|
+
await wxsource.updateCurrentStyleObject({
|
|
136
|
+
isolineText: false,
|
|
137
|
+
blurRadius: ~~(10 * Math.sin(n / 500) + 10),
|
|
138
|
+
});
|
|
139
|
+
requestAnimationFrame(step);
|
|
141
140
|
})();
|
|
142
141
|
```
|
|
143
142
|
|
|
144
|
-
###
|
|
143
|
+
### More Interactive – Additional Level and Red Transparency around the Level Based on Current Mouse Position
|
|
145
144
|
|
|
146
145
|
```ts
|
|
147
|
-
await wxsource.updateCurrentStyleObject({ levels: undefined }); //
|
|
148
|
-
const levels = wxsource.getCurrentStyleObjectCopy().levels || [];
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
await wxsource.updateCurrentStyleObject({ levels: undefined }); // Reset levels if they exist in the style
|
|
147
|
+
const levels = wxsource.getCurrentStyleObjectCopy().levels || [];
|
|
148
|
+
const colMap: [number, string][] = levels.map((level) => [
|
|
149
|
+
level,
|
|
150
|
+
"#" + Math.random().toString(16).slice(2, 8) + "ff",
|
|
151
|
+
]);
|
|
152
|
+
|
|
151
153
|
let busy = false;
|
|
152
|
-
map.on(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
154
|
+
map.on("mousemove", async (e) => {
|
|
155
|
+
if (!wxsource || busy) return;
|
|
156
|
+
busy = true;
|
|
157
|
+
const tileInfo: WxTileInfo | undefined = wxsource.getLayerInfoAtLatLon(
|
|
158
|
+
position(e),
|
|
159
|
+
map
|
|
160
|
+
);
|
|
161
|
+
if (tileInfo) {
|
|
162
|
+
await wxsource.updateCurrentStyleObject({
|
|
163
|
+
colorMap: [...colMap, [tileInfo.inStyleUnits[0], "#ff000000"]],
|
|
164
|
+
});
|
|
165
|
+
console.log(tileInfo);
|
|
166
|
+
}
|
|
167
|
+
busy = false;
|
|
161
168
|
});
|
|
162
169
|
```
|
|
163
170
|
|
|
164
|
-
|
|
171
|
+
### Legend Usage
|
|
165
172
|
|
|
166
|
-
|
|
173
|
+
The `WxCreateLegend` function is used to generate a color legend for weather map visualizations. This legend helps represent weather data with corresponding colors, making it easier to interpret the map.
|
|
174
|
+
Pass the `legendSize` and `style` to the `WxCreateLegend` function to generate the legend. The function returns a `WxLegend` object containing:
|
|
167
175
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
176
|
+
- `size`: The number of color steps.
|
|
177
|
+
- `colors`: A `Uint32Array` of color values.
|
|
178
|
+
- `ticks`: An array of `WxTick` objects representing data points and their corresponding colors.
|
|
179
|
+
- `units`: The units of the data.
|
|
180
|
+
- `showBelowMin` / `showAboveMax`: Whether values outside the range are shown.
|
|
181
|
+
|
|
182
|
+
#### Example: Temperature Legend
|
|
183
|
+
|
|
184
|
+
Here’s an example of creating a temperature legend:
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
const style: WxColorStyleStrict = {
|
|
188
|
+
colorMap: [
|
|
189
|
+
[0, "#0000FF"], // blue at 0°C
|
|
190
|
+
[15, "#00FF00"], // green at 15°C
|
|
191
|
+
[30, "#FF0000"], // red at 30°C
|
|
192
|
+
],
|
|
193
|
+
showBelowMin: true,
|
|
194
|
+
showAboveMax: true,
|
|
195
|
+
units: "°C",
|
|
196
|
+
fill: "gradient",
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const legend = WxCreateLegend(100, style);
|
|
200
|
+
console.log(legend);
|
|
175
201
|
```
|
|
202
|
+
|
|
203
|
+
This creates legend with:
|
|
204
|
+
|
|
205
|
+
- 100 color steps interpolating between blue, green, and red.
|
|
206
|
+
- Ticks at 0°C, 15°C, and 30°C.
|
|
207
|
+
- Support for values below 0°C and above 30°C.
|
|
208
|
+
|
|
209
|
+
### Color Style
|
|
210
|
+
|
|
211
|
+
The `WxColorStyleStrict` interface defines the configuration for styling visualizations. It includes properties for controlling colors, gradients, isolines, vectors, streamlines, and more. Below is a detailed explanation of each property.
|
|
212
|
+
|
|
213
|
+
#### Properties
|
|
214
|
+
|
|
215
|
+
##### Basic Properties
|
|
216
|
+
|
|
217
|
+
- **`name`**: The name of the style.
|
|
218
|
+
- **`parent`**: The name of a parent style to inherit properties from (optional).
|
|
219
|
+
|
|
220
|
+
##### Tile Filling
|
|
221
|
+
|
|
222
|
+
- **`fill`**: Defines how tiles are filled:
|
|
223
|
+
- `"none"`: No fill, leaves the tile transparent.
|
|
224
|
+
- `"solid"`: Solid fill, no gradient between levels.
|
|
225
|
+
- `"gradient"`: Gradient fill between levels.
|
|
226
|
+
|
|
227
|
+
##### Isolines
|
|
228
|
+
|
|
229
|
+
- **`isolineColor`**: Defines the color of isolines:
|
|
230
|
+
- `"none"`: Do not render isolines.
|
|
231
|
+
- `"fill"`: Use the value of `fill` for each pixel.
|
|
232
|
+
- `"inverted"`: Use the inverted value of `fill` for each pixel.
|
|
233
|
+
- `#RGB`, `#RRGGBB`, or `#RRGGBBAA`: Use a specific web color.
|
|
234
|
+
- **`isolineText`**: If `true`, render text values on isolines.
|
|
235
|
+
- **`isolineTextSizeEm`**: Font size of isoline text values in `em` units.
|
|
236
|
+
- **`isolineTextBackground`**: If `true`, render a solid background behind isoline text values.
|
|
237
|
+
|
|
238
|
+
##### Vectors (Wind/Current Fields)
|
|
239
|
+
|
|
240
|
+
- **`vectorType`**: Defines how vectors are represented:
|
|
241
|
+
- `"none"`: Do not render vectors.
|
|
242
|
+
- `"arrows"`: Use arrows to represent winds/currents.
|
|
243
|
+
- `"barbs"`: Use barbs to represent winds/currents.
|
|
244
|
+
- **`vectorColor`**: Defines the color of vectors:
|
|
245
|
+
- `"none"`: Do not render vectors.
|
|
246
|
+
- `"fill"`: Use the value of `fill` for each pixel.
|
|
247
|
+
- `"inverted"`: Use the inverted value of `fill` for each pixel.
|
|
248
|
+
- `#RGB`, `#RRGGBB`, or `#RRGGBBAA`: Use a specific web color.
|
|
249
|
+
- **`vectorFactor`**: Scaling factor for vector length.
|
|
250
|
+
|
|
251
|
+
##### Streamlines
|
|
252
|
+
|
|
253
|
+
- **`streamLineColor`**: Defines the color of streamlines:
|
|
254
|
+
- `"none"`: Do not render streamlines.
|
|
255
|
+
- `"fill"`: Use the value of `fill` for each pixel.
|
|
256
|
+
- `"inverted"`: Use the inverted value of `fill` for each pixel.
|
|
257
|
+
- `#RGB`, `#RRGGBB`, or `#RRGGBBAA`: Use a specific web color.
|
|
258
|
+
- **`streamLineSpeedFactor`**: Scaling factor for streamline length.
|
|
259
|
+
- **`streamLineGridStep`**: Step to seed streamlines. Smaller values create more streamlines.
|
|
260
|
+
- **`streamLineSteps`**: Number of steps in each streamline.
|
|
261
|
+
- **`streamLineStatic`**: If `true`, render streamlines as static lines. If `false`, render as animated lines.
|
|
262
|
+
|
|
263
|
+
##### Color Configuration
|
|
264
|
+
|
|
265
|
+
- **`showBelowMin`**: If `true`, fill values below the minimum range.
|
|
266
|
+
- **`showAboveMax`**: If `true`, fill values above the maximum range.
|
|
267
|
+
- **`colorScheme`**: Name of the color scheme from the default set.
|
|
268
|
+
- **`colors`**: Custom array of colors to use for interpolation (optional).
|
|
269
|
+
- **`colorMap`**: Array of `[level, color]` tuples to map specific data values to colors (optional).
|
|
270
|
+
- **`levels`**: Array of levels to build the legend. If not provided, 10 levels are calculated evenly based on the data.
|
|
271
|
+
|
|
272
|
+
##### Additional Styling
|
|
273
|
+
|
|
274
|
+
- **`blurRadius`**: Radius for the BOX filter (used for blurring).
|
|
275
|
+
- **`addDegrees`**: Additional rotation of wind or current vectors by a specified angle in degrees.
|
|
276
|
+
- **`units`**: Units of the style (e.g., `°C` for temperature).
|
|
277
|
+
- **`extraUnits`**: Additional units to extend the default set (optional).
|
|
278
|
+
|
|
279
|
+
##### Masking
|
|
280
|
+
|
|
281
|
+
- **`mask`**: Defines masking behavior:
|
|
282
|
+
- `"none"`: No masking.
|
|
283
|
+
- `"sea"`: Make sea areas transparent.
|
|
284
|
+
- `"land"`: Make land areas transparent.
|
|
285
|
+
|
|
286
|
+
##### WebGL Configuration (Optional)
|
|
287
|
+
|
|
288
|
+
- **`gl`**: Configuration for WebGL rendering:
|
|
289
|
+
- `animationSpeed`: Speed of animations.
|
|
290
|
+
- `noiseTexturePow`: Power of noise texture.
|
|
291
|
+
- `vectorFieldFactor`: Scaling factor for vector fields.
|
|
292
|
+
- `animationIntensity`: Intensity of animations.
|
|
293
|
+
- `wavesCount`: Number of waves to render.
|
|
294
|
+
|
|
295
|
+
##### Default styles
|
|
296
|
+
|
|
297
|
+
Default styles can be found [here](https://github.com/metoceanapi/wxtiles-common/blob/master/defaults/styles.ts)
|
package/dist/es/index.d.ts
CHANGED
|
@@ -1,35 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Main classes and interfaces to use in your application are:
|
|
3
|
-
* - {@link WxAPIOptions} options to pass to the constructor of {@link WxAPI}.
|
|
3
|
+
* - {@link https://www.npmjs.com/package/@metoceanapi/wxtiles-common | @metoceanapi/wxtiles-common/types/WxAPIOptions} options to pass to the constructor of {@link WxAPI}.
|
|
4
4
|
* - {@link WxAPI} the main class to use to interact with the *WxTiles* API and to create {@link WxDataSetManager} instances
|
|
5
|
-
* - {@link WxDataSetManagerOptions} options to pass to the constructor of {@link WxDataSetManager}.
|
|
5
|
+
* - {@link https://www.npmjs.com/package/@metoceanapi/wxtiles-common | @metoceanapi/wxtiles-common/types/WxDataSetManagerOptions} options to pass to the constructor of {@link WxDataSetManager}.
|
|
6
6
|
* - {@link WxDataSetManager} class for managing WX datasets and create {@link WxTileSource}.
|
|
7
7
|
* * {@link FrameworkOptions} framework specific options to pass to the constructor of {@link WxTileSource}.
|
|
8
|
-
* - {@link WxLayerOptions} options to pass to the constructor of {@link WxTileSource}.
|
|
8
|
+
* - {@link https://www.npmjs.com/package/@metoceanapi/wxtiles-common | @metoceanapi/wxtiles-common/types/WxLayerOptions} options to pass to the constructor of {@link WxTileSource}.
|
|
9
9
|
* - {@link WxTileSource} class for managing WX tiles sources.
|
|
10
|
-
* - {@link WxColorStyleWeak} interface for color styles.
|
|
11
|
-
* - {@link WxDate} type for dates.
|
|
12
|
-
* - {@link WxDatasetMeta} interface for dataset's metadata.
|
|
13
|
-
* - {@link WxVariableMeta} interface for variable's meta data.
|
|
14
|
-
* - {@link WxAllBoundariesMeta} interface for boundaries of a dataset.
|
|
15
|
-
* - {@link WxTileInfo} interface for tile's information.
|
|
10
|
+
* - {@link https://www.npmjs.com/package/@metoceanapi/wxtiles-common | @metoceanapi/wxtiles-common/utils/WxColorStyleWeak} interface for color styles.
|
|
11
|
+
* - {@link https://www.npmjs.com/package/@metoceanapi/wxtiles-common | @metoceanapi/wxtiles-common/types/WxDate} type for dates.
|
|
12
|
+
* - {@link https://www.npmjs.com/package/@metoceanapi/wxtiles-common | @metoceanapi/wxtiles-common/types/WxDatasetMeta} interface for dataset's metadata.
|
|
13
|
+
* - {@link https://www.npmjs.com/package/@metoceanapi/wxtiles-common | @metoceanapi/wxtiles-common/types/WxVariableMeta} interface for variable's meta data.
|
|
14
|
+
* - {@link https://www.npmjs.com/package/@metoceanapi/wxtiles-common | @metoceanapi/wxtiles-common/types/WxAllBoundariesMeta} interface for boundaries of a dataset.
|
|
15
|
+
* - {@link https://www.npmjs.com/package/@metoceanapi/wxtiles-common | @metoceanapi/wxtiles-common/types/WxTileInfo} interface for tile's information.
|
|
16
16
|
* ### Note
|
|
17
17
|
* In case of use **async** member functions, you must use the **await** syntax.
|
|
18
18
|
* @module
|
|
19
19
|
*/
|
|
20
20
|
import type { WxDataSetManager } from "./wxAPI/WxDataSetManager";
|
|
21
|
-
import { Loader as BaseLoader } from "@metoceanapi/wxtiles-common/wxlayer/loader";
|
|
21
|
+
import type { Loader as BaseLoader } from "@metoceanapi/wxtiles-common/wxlayer/loader";
|
|
22
22
|
export type Loader = BaseLoader<WxDataSetManager>;
|
|
23
|
-
import { Painter as BasePainter } from "@metoceanapi/wxtiles-common/wxlayer/painter";
|
|
23
|
+
import type { Painter as BasePainter } from "@metoceanapi/wxtiles-common/wxlayer/painter";
|
|
24
24
|
export type Painter = BasePainter<WxDataSetManager>;
|
|
25
|
-
export { QTree, type SubTrees, type SubTreesN, type TileType, type Tree, type TreeN } from "@metoceanapi/wxtiles-common/utils/qtree";
|
|
26
25
|
export { WxAPI } from "./wxAPI/WxAPI";
|
|
27
|
-
export type { WxAllBoundariesMeta, WxAllDatasetsShortMetas, WxAPIOptions, WxBoundaryMeta, WxDatasetMeta, WxDatasetShortMeta, WxInstances, WxVariableMeta, WxVariablesMetas, WxRequestInit, WxRasterDataCache as TilesCache, WxDate, WxLayerVarsNames, WxLngLat, WxTileInfo, WxURIs, ListenerMethod, WxEventType, WxLayerBaseAPI, WxLayerAPI, SLine, SLinePoint, WxData, WxRasterData, WxLayerOptions, WxDataSetManagerOptions } from "@metoceanapi/wxtiles-common/types";
|
|
28
26
|
export { WxDataSetManager, type WxSourceLayerOptions } from "./wxAPI/WxDataSetManager";
|
|
29
|
-
export {
|
|
27
|
+
export { WxLayer, WxLayerBaseImplementation, WxTileSource } from "./wxsource/wxsource";
|
|
30
28
|
export type { FrameworkOptions } from "./wxsource/wxsourcetypes";
|
|
31
|
-
export { WxCreateLegend, type RawCLUT, type WxLegend, type WxTick } from "@metoceanapi/wxtiles-common/utils/RawCLUT";
|
|
32
|
-
export { DataIntegral, WxGetColorSchemes, WxGetColorStyles, WXLOG, WxTilesLogging, type CachedUriLoaderPromiseFunc, type ColorStylesIncomplete, type Converter, type DataIntegrals, type DataPicture, type DataPictures, type IntegralPare, type WxColorSchemes, type WxColorStylesStrict, type WxColorStyleStrict, type WxColorStylesWeakMixed, type WxColorStyleWeak, type WxUnits, type WxUnitTuple, type XYZ } from "@metoceanapi/wxtiles-common/utils/wxtools";
|
|
33
29
|
export { CustomWxTilesLayer } from "./customlayer/customlayer";
|
|
34
30
|
export { WxAPIControl } from "@metoceanapi/wxtiles-common/controls/WxAPIControl";
|
|
35
31
|
export { WxInfoControl } from "@metoceanapi/wxtiles-common/controls/WxInfoControl";
|