@windycom/plugin-devtools 3.0.1 → 3.0.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/README.md +1 -0
- package/package.json +1 -1
- package/types/client/Calendar.d.ts +104 -70
- package/types/client/Color.d.ts +25 -5
- package/types/client/DataTiler.d.ts +2 -2
- package/types/client/EcmwfProduct.d.ts +22 -0
- package/types/client/EventManager.d.ts +69 -0
- package/types/client/ExternalSveltePlugin.d.ts +4 -3
- package/types/client/GlBuffer.d.ts +45 -0
- package/types/client/GlMesh.d.ts +147 -0
- package/types/client/GlProgram.d.ts +41 -0
- package/types/client/GlRenderer.d.ts +95 -0
- package/types/client/GlTexture.d.ts +98 -0
- package/types/client/GlVertexArray.d.ts +38 -0
- package/types/client/IDB.d.ts +25 -4
- package/types/client/LabelsLayer.d.ts +69 -2
- package/types/client/Layer.d.ts +96 -26
- package/types/client/LayerClasses.d.ts +5 -0
- package/types/client/Metric.d.ts +31 -46
- package/types/client/MetricClasses.d.ts +1 -1
- package/types/client/Overlay.d.ts +5 -12
- package/types/client/OverlayClasses.d.ts +8 -0
- package/types/client/Particles.d.ts +1 -1
- package/types/client/Product.d.ts +38 -67
- package/types/client/ProductClasses.d.ts +51 -0
- package/types/client/RadarPlusProduct.d.ts +1 -1
- package/types/client/Renderer.d.ts +44 -19
- package/types/client/SatelliteProduct.d.ts +1 -1
- package/types/client/ShaderStorage.d.ts +25 -0
- package/types/client/StartupElementPlugin.d.ts +8 -0
- package/types/client/SveltePlugin.d.ts +5 -5
- package/types/client/SwitchableTileCache.d.ts +104 -0
- package/types/client/TileLayer.d.ts +12 -3
- package/types/client/TileLayerCustom.d.ts +51 -0
- package/types/client/TileLayerMulti.d.ts +53 -0
- package/types/client/TileLayerPreprocessorStandalone.d.ts +45 -0
- package/types/client/TileLayerRenderer.d.ts +24 -0
- package/types/client/TileLayerUtils.d.ts +43 -0
- package/types/client/TilePreprocessor.d.ts +27 -0
- package/types/client/TopoMap.d.ts +4 -4
- package/types/client/WindowPlugin.d.ts +7 -6
- package/types/client/appsFlyer.d.ts +2 -1
- package/types/client/baseMap.d.ts +12 -2
- package/types/client/broadcast.d.ts +1 -1
- package/types/client/cityLabels.d.ts +2 -3
- package/types/client/colorGradients.d.ts +4 -10
- package/types/client/colors.d.ts +1 -2
- package/types/client/css.test.d.ts +1 -0
- package/types/client/customProtocol.d.ts +11 -0
- package/types/client/d.ts.files/GlObj.d.ts +1 -5
- package/types/client/d.ts.files/Metric.d.ts +23 -2
- package/types/client/d.ts.files/alerts.d.ts +1 -0
- package/types/client/d.ts.files/broadcast.d.ts +31 -35
- package/types/client/d.ts.files/dataSpecifications.d.ts +82 -66
- package/types/client/d.ts.files/favs.d.ts +7 -18
- package/types/client/d.ts.files/glUtils.d.ts +71 -0
- package/types/client/d.ts.files/http.d.ts +4 -4
- package/types/client/d.ts.files/interpolatorTypes.d.ts +5 -5
- package/types/client/d.ts.files/lib.d.ts +1 -2
- package/types/client/d.ts.files/liveAlerts.d.ts +52 -0
- package/types/client/d.ts.files/mapUtils.d.ts +25 -0
- package/types/client/d.ts.files/outgoingMessages.d.ts +1 -1
- package/types/client/d.ts.files/plugin-params.d.ts +46 -24
- package/types/client/d.ts.files/plugins.d.ts +44 -31
- package/types/client/d.ts.files/rootScope.d.ts +2 -0
- package/types/client/d.ts.files/singleclick.d.ts +4 -2
- package/types/client/d.ts.files/startup.d.ts +7 -52
- package/types/client/d.ts.files/storage.d.ts +0 -11
- package/types/client/d.ts.files/user.d.ts +6 -1
- package/types/client/d.ts.files/webcams.d.ts +9 -2
- package/types/client/dataLoader.d.ts +2 -2
- package/types/client/detectDevice.d.ts +3 -0
- package/types/client/embed.d.ts +2 -7
- package/types/client/errorLogger.d.ts +20 -1
- package/types/client/externalPlugins.d.ts +5 -1
- package/types/client/fetch.d.ts +62 -5
- package/types/client/format.d.ts +12 -0
- package/types/client/glContextUtils.d.ts +9 -0
- package/types/client/glStatus.d.ts +7 -0
- package/types/client/glTileRender.d.ts +1 -7
- package/types/client/glUtils.d.ts +119 -0
- package/types/client/http.d.ts +0 -6
- package/types/client/idbConnection.d.ts +13 -0
- package/types/client/idbInstances.d.ts +118 -13
- package/types/client/landLayer.d.ts +3 -0
- package/types/client/layers.d.ts +5 -2
- package/types/client/legends.d.ts +1 -1
- package/types/client/lib.d.ts +11 -21
- package/types/client/liveAlerts.d.ts +2 -2
- package/types/client/location.d.ts +1 -1
- package/types/client/map.d.ts +94 -15
- package/types/client/mapUtils.d.ts +66 -0
- package/types/client/math.d.ts +14 -0
- package/types/client/mobile.d.ts +16 -41
- package/types/client/mobileUtils.d.ts +10 -0
- package/types/client/models.d.ts +2 -6
- package/types/client/overlays.d.ts +4 -3
- package/types/client/particleRenderers.d.ts +1 -1
- package/types/client/picker.d.ts +4 -8
- package/types/client/plugins.d.ts +0 -4
- package/types/client/products.d.ts +53 -2
- package/types/client/promo.d.ts +28 -5
- package/types/client/pushNotifications.d.ts +19 -1
- package/types/client/renderCtrl.d.ts +1 -1
- package/types/client/renderTile.d.ts +2 -2
- package/types/client/renderUtils.d.ts +21 -27
- package/types/client/renderers.d.ts +6 -9
- package/types/client/reverseName.d.ts +2 -1
- package/types/client/rhMessage.d.ts +1 -1
- package/types/client/rootScope.d.ts +17 -9
- package/types/client/router.d.ts +41 -9
- package/types/client/seoParser.d.ts +35 -0
- package/types/client/showableErrorsService.d.ts +10 -6
- package/types/client/singleclick.d.ts +1 -1
- package/types/client/startup.d.ts +48 -0
- package/types/client/startupUtils.d.ts +19 -0
- package/types/client/store.d.ts +20 -52
- package/types/client/subscription.d.ts +3 -26
- package/types/client/throttler.d.ts +32 -0
- package/types/client/tileHelpers.d.ts +35 -0
- package/types/client/tileInterpolator.d.ts +1 -1
- package/types/client/tileLayerInterpolator.d.ts +40 -0
- package/types/client/tileLayerSource.d.ts +98 -0
- package/types/client/timestampUtils.test.d.ts +1 -0
- package/types/client/topMessage.d.ts +22 -0
- package/types/client/user.d.ts +1 -0
- package/types/client/userAlerts.d.ts +0 -4
- package/types/client/userConsent.d.ts +0 -2
- package/types/client/userFavs.d.ts +17 -12
- package/types/client/utils.d.ts +78 -25
- package/types/client/utils.test.d.ts +1 -0
- package/types/iconfont.d.ts +2 -5
- package/types/interfaces.d.ts +290 -88
- package/types/lang-files.d.ts +578 -98
- package/types/leaflet-gl.d.ts +12773 -0
- package/types/types.d.ts +323 -11
- package/types/client/d.ts.files/Calendar.d.ts +0 -96
- package/types/client/d.ts.files/CanvasLayer.d.ts +0 -70
- package/types/client/d.ts.files/Color.d.ts +0 -94
- package/types/client/d.ts.files/DataTiler.d.ts +0 -45
- package/types/client/d.ts.files/LandMask.d.ts +0 -17
- package/types/client/d.ts.files/Layer.d.ts +0 -191
- package/types/client/d.ts.files/PoisOverlay.d.ts +0 -27
- package/types/client/d.ts.files/Renderer.d.ts +0 -44
- package/types/client/d.ts.files/TileLayerCanvas.d.ts +0 -78
- package/types/client/d.ts.files/TileLayerMultiPatch.d.ts +0 -13
- package/types/client/d.ts.files/products.d.ts +0 -60
- package/types/client/imaker.d.ts +0 -112
- package/types/offline.d.ts +0 -100
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Bounds, LeafletGlMap, TileCache, type Coords } from '@leafletGl';
|
|
2
|
+
type OnCacheDestroy = () => void;
|
|
3
|
+
export type Cache<TTile> = {
|
|
4
|
+
cache: TileCache<TTile>;
|
|
5
|
+
/**
|
|
6
|
+
* Completely cleans up the cache: disposes of the internal TileCache, un-registers event listeners, cleans up tile preprocessor.
|
|
7
|
+
*/
|
|
8
|
+
destroy: OnCacheDestroy;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* This class serves as a tile cache with the added functionality of
|
|
12
|
+
* being able to swap the internal set of tiles (internal tile cache)
|
|
13
|
+
* for a new set of tiles, but only once the new tiles are fully loaded.
|
|
14
|
+
*
|
|
15
|
+
* This is useful for when you want to eg. swap current forecast refTime or model and only display the new data once it is fully ready.
|
|
16
|
+
*
|
|
17
|
+
* Additionally, this class supports {@link awaitTile} function, which asynchronously waits for a given tile to be loaded.
|
|
18
|
+
* This does not trigger a new tile load, but waits for the tile to become required by the current map view.
|
|
19
|
+
*/
|
|
20
|
+
export declare class SwitchableTileCache<TTile> {
|
|
21
|
+
private _nextCache;
|
|
22
|
+
private _currentCache;
|
|
23
|
+
private _keepBuffer;
|
|
24
|
+
private _maxLowerZoom;
|
|
25
|
+
private _maxHigherZoom;
|
|
26
|
+
private _lastMapBounds;
|
|
27
|
+
private _lastMapZoom;
|
|
28
|
+
onSwitch?: () => void;
|
|
29
|
+
get currentCache(): Cache<TTile>;
|
|
30
|
+
get keepBuffer(): number;
|
|
31
|
+
/**
|
|
32
|
+
* Gets the map bounds, as computed at the last {@link update} call,
|
|
33
|
+
* with {@link keepBuffer} taken into account.
|
|
34
|
+
*/
|
|
35
|
+
get lastBounds(): Bounds;
|
|
36
|
+
/**
|
|
37
|
+
* Gets the map integer zoom, as computed at the last {@link update} call.
|
|
38
|
+
*/
|
|
39
|
+
get lastZoom(): number;
|
|
40
|
+
/**
|
|
41
|
+
* Creates a new instance of {@link SwitchableTileCache}.
|
|
42
|
+
* @param initialCache - The initial tile cache to be used.
|
|
43
|
+
* @param keepBuffer - How many extra tiles in each of the four directions should be loaded in addition to the set that optimally covers the current map view.
|
|
44
|
+
* @param maxLowerZoom - If a tile at the specified zoom level is unavailable, its parent or children may be rendered instead.
|
|
45
|
+
* This value is the maximal allowed difference in zoom levels when rendering a **less** detailed tile instead of the ideal one.
|
|
46
|
+
* @param maxHigherZoom - If a tile at the specified zoom level is unavailable, its parent or children may be rendered instead.
|
|
47
|
+
* This value is the maximal allowed difference in zoom levels when rendering a **more** detailed tile instead of the ideal one.
|
|
48
|
+
*/
|
|
49
|
+
constructor(initialCache: Cache<TTile>, keepBuffer?: number, maxLowerZoom?: number, maxHigherZoom?: number);
|
|
50
|
+
/**
|
|
51
|
+
* Initializes a switch to the supplied tile cache.
|
|
52
|
+
* The current cache is switched for the supplied one once the supplied cache is done loading.
|
|
53
|
+
* Loading of new tiles for the current cache is suspended in the meantime.
|
|
54
|
+
* If a switch to another new cache was already taking place, then that new cache gets deleted.
|
|
55
|
+
*
|
|
56
|
+
* When you pass a cache to this function, you must not use that object directly anymore,
|
|
57
|
+
* as it will now be managed and later disposed of by this class.
|
|
58
|
+
*
|
|
59
|
+
* You may not pass the same instance of a tle cache to this function multiple times.
|
|
60
|
+
*/
|
|
61
|
+
setCache(cache: Cache<TTile>): void;
|
|
62
|
+
/**
|
|
63
|
+
* Updates the caches with the map's current view and zoom.
|
|
64
|
+
* Call every time the map moves.
|
|
65
|
+
*/
|
|
66
|
+
update(map: LeafletGlMap): void;
|
|
67
|
+
/**
|
|
68
|
+
* Returns an ordered array of tile coords that should be rendered to optimally cover the current map view.
|
|
69
|
+
* May return tiles of different zoom level than what is optimal, depending on
|
|
70
|
+
* what tiles are currently available and on the cache settings.
|
|
71
|
+
* Is not affected by `keepBuffer`.
|
|
72
|
+
*/
|
|
73
|
+
getRenderableCoords(): Coords[];
|
|
74
|
+
/**
|
|
75
|
+
* Returns the data in the current cache associated with the given tile.
|
|
76
|
+
* May return `null` both when the tile load failed and when the tile is not present at all.
|
|
77
|
+
* Distinguish between these two cases using {@link hasTile}.
|
|
78
|
+
*/
|
|
79
|
+
getTile(coords: Coords): TTile | null;
|
|
80
|
+
/**
|
|
81
|
+
* Returns whether the current cache has loaded the given tile.
|
|
82
|
+
*/
|
|
83
|
+
hasTile(coords: Coords): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Asynchronously returns a tile once it is loaded.
|
|
86
|
+
* However the loading of this tile can only be triggered by the user moving the map
|
|
87
|
+
* and the tile becoming visible in the map view.
|
|
88
|
+
* Always returns tiles from the latest cache available at the time of calling this function:
|
|
89
|
+
* returns tiles from the next cache, if any is present, otherwise returns tiles from the current cache.
|
|
90
|
+
*
|
|
91
|
+
* You can optionally supply an abort signal. Signalling it will cancel the tile request
|
|
92
|
+
* and remove it from the internal queues.
|
|
93
|
+
*/
|
|
94
|
+
awaitTile(coords: Coords, abort?: AbortSignal): Promise<any>;
|
|
95
|
+
/**
|
|
96
|
+
* Deletes all resources associated with this {@link SwitchableTileCache}, including its internal caches.
|
|
97
|
+
*/
|
|
98
|
+
dispose(): void;
|
|
99
|
+
/**
|
|
100
|
+
* Updates one of the internal tile caches with up-to-date map bounds and zoom.
|
|
101
|
+
*/
|
|
102
|
+
private _updateInternal;
|
|
103
|
+
}
|
|
104
|
+
export {};
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { Renderer } from '@windy/Renderer';
|
|
2
|
-
import type { FullRenderParameters } from '@windy/
|
|
3
|
-
import type { RendererInitParams, Renderers } from '@windy/Renderer
|
|
2
|
+
import type { FullRenderParameters, WeatherParameters } from '@windy/interfaces';
|
|
3
|
+
import type { RendererInitParams, Renderers } from '@windy/Renderer';
|
|
4
|
+
import type { Layers } from '@windy/Layer';
|
|
5
|
+
import type { Timestamp } from '@windy/types';
|
|
4
6
|
export declare class TileLayer extends Renderer {
|
|
7
|
+
private readonly _layerId;
|
|
8
|
+
private _lastUsedMapParams;
|
|
9
|
+
private _initializeCallbackSet;
|
|
5
10
|
constructor(params: RendererInitParams);
|
|
6
|
-
onopen(params
|
|
11
|
+
onopen(params: FullRenderParameters): void;
|
|
7
12
|
close(rqrdRenderers: Renderers[]): void;
|
|
13
|
+
redraw(): void;
|
|
14
|
+
paramsChanged(layerIdent: Layers, weatherParams: WeatherParameters, timestamp: Timestamp): Promise<void>;
|
|
15
|
+
private _ensureMapAndSetParams;
|
|
16
|
+
private _initialize;
|
|
8
17
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { MapLibreMap } from '@leafletGl';
|
|
2
|
+
import { EventManager } from '@windy/EventManager';
|
|
3
|
+
import type { CustomLayerInterface, CustomRenderMethodInput } from '@leafletGl';
|
|
4
|
+
import type { FullRenderParameters } from '@windy/interfaces';
|
|
5
|
+
/**
|
|
6
|
+
* This is the "main" layer class for rendering forecast layers.
|
|
7
|
+
* It implement's MapLibre's custom layer interface (`onAdd`, `onRemove` and `render`)
|
|
8
|
+
* and several helper methods for handling render params change and layer enable/disable.
|
|
9
|
+
*/
|
|
10
|
+
export declare class TileLayerCustom implements CustomLayerInterface {
|
|
11
|
+
private _renderer;
|
|
12
|
+
private _enabled;
|
|
13
|
+
private _hasSea;
|
|
14
|
+
private _landOnly;
|
|
15
|
+
private _latestParams;
|
|
16
|
+
private _switchableCache;
|
|
17
|
+
private _paramsChangeId;
|
|
18
|
+
readonly eventManager: EventManager;
|
|
19
|
+
readonly type: "custom";
|
|
20
|
+
id: string;
|
|
21
|
+
constructor(layerId: string, params: FullRenderParameters);
|
|
22
|
+
get switchableCache(): any;
|
|
23
|
+
render(gl: WebGLRenderingContext | WebGL2RenderingContext, _options: CustomRenderMethodInput): void;
|
|
24
|
+
onAdd(_maplibreMap: MapLibreMap, gl: WebGLRenderingContext | WebGL2RenderingContext): void;
|
|
25
|
+
/**
|
|
26
|
+
* @summary Hides/shows the layer
|
|
27
|
+
* - useful for example in case when we cycle between various TileLayer renderers
|
|
28
|
+
* - for the old one (e.g. accumulation) we need to hide the layer and for the new one (e.g. tileLayer) we need to show it
|
|
29
|
+
*/
|
|
30
|
+
enableDisableLayer(enable: boolean): void;
|
|
31
|
+
paramsChanged(newParams: FullRenderParameters, layerReopen?: boolean): void;
|
|
32
|
+
onRemove(_maplibreMap: MapLibreMap, gl: WebGLRenderingContext | WebGL2RenderingContext): void;
|
|
33
|
+
private _init;
|
|
34
|
+
private _onUpdate;
|
|
35
|
+
/**
|
|
36
|
+
* Sets land or sea mask visibility.
|
|
37
|
+
* Called when {@link _switchableCache} switches to a new set of tiles
|
|
38
|
+
* or when {@link _switchableCache} is first created.
|
|
39
|
+
*/
|
|
40
|
+
private _updateLandSeaMask;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a tile cache from the current {@link _latestParams}
|
|
43
|
+
* and passes this cache to {@link _switchableCache}.
|
|
44
|
+
*
|
|
45
|
+
* If no instance of {@link _switchableCache} exists, it is created.
|
|
46
|
+
* and {@link _updateLandSeaMask} is called.
|
|
47
|
+
*
|
|
48
|
+
* Call when {@link _latestParams} changes.
|
|
49
|
+
*/
|
|
50
|
+
private _updateCache;
|
|
51
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { TileLayer, type TileLayerOptions } from '@leafletGl';
|
|
2
|
+
/**
|
|
3
|
+
* Rectangle coords at a specific zoom level; left and top are inclusive, right and bottom tiles excluded.
|
|
4
|
+
* `[ left, top, right, bottom, zoom ]`
|
|
5
|
+
*/
|
|
6
|
+
export type TileDefPatch = [number, number, number, number, number];
|
|
7
|
+
export type TileDef = {
|
|
8
|
+
/**
|
|
9
|
+
* The main tile url.
|
|
10
|
+
*/
|
|
11
|
+
url: string;
|
|
12
|
+
subdomains?: string | string[];
|
|
13
|
+
/**
|
|
14
|
+
* Tile URL for the patch region, if any is present.
|
|
15
|
+
*/
|
|
16
|
+
patchUrl?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Rectangle coords at a specific zoom level; left and top are inclusive, right and bottom tiles excluded.
|
|
19
|
+
* `[ left, top, right, bottom, zoom ]`
|
|
20
|
+
*/
|
|
21
|
+
patch?: TileDefPatch;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @class Wrapper class over LeafletGl's TileLayer used for loading data from various sources based on zoom.
|
|
25
|
+
* These sources are defined in the {@link tileDefs} object.
|
|
26
|
+
* Can optionally apply a "patch", a rectangular region which loads different tiles that the rest of the map.
|
|
27
|
+
*/
|
|
28
|
+
export declare class TileLayerMulti extends TileLayer {
|
|
29
|
+
/**
|
|
30
|
+
* Map of zoom level -> tile def.
|
|
31
|
+
* Each tiledef contains:
|
|
32
|
+
* - tile url
|
|
33
|
+
* - patch region precomputed for the current zoom level (if a patch is present)
|
|
34
|
+
* - patch tile url
|
|
35
|
+
*/
|
|
36
|
+
private _preparedTileDefs;
|
|
37
|
+
/**
|
|
38
|
+
* Maps tile coords X/Y/Z to the index of the corresponding string segment when the tile url is split with `/`.
|
|
39
|
+
*/
|
|
40
|
+
private _urlMapping;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a TileLayerMulti object.
|
|
43
|
+
* Each tile source url is defined by its url, its upper bound zoom level and an optional patch.
|
|
44
|
+
* @param tileDefs - An object where a TileDef with a given numeric key is applied to all zoom levels
|
|
45
|
+
* lower than and including its key and that are not yet covered by a different TileDef with a lower numeric key.
|
|
46
|
+
* @param options - Standard TileLayer options. Optional.
|
|
47
|
+
*/
|
|
48
|
+
constructor(tileDefs: Record<number, TileDef>, options?: TileLayerOptions);
|
|
49
|
+
/**
|
|
50
|
+
* @summary Handler for constructing the correct tile url based on the zoom
|
|
51
|
+
*/
|
|
52
|
+
private _modifyTileRequest;
|
|
53
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type TileHeader } from '@windy/TileLayerUtils';
|
|
2
|
+
import { PreprocessedTileParams } from '@windy/TilePreprocessor';
|
|
3
|
+
import type { FullRenderParameters } from '@windy/interfaces';
|
|
4
|
+
/**
|
|
5
|
+
* A refactored TileLayer preprocessor intended for use with the new tile management.
|
|
6
|
+
* Assumes that it is only created once for a given set of render params and then disposed when render params change.
|
|
7
|
+
* Render params may not be changed after initialization.
|
|
8
|
+
*/
|
|
9
|
+
export declare class TileLayerPreprocessorStandalone {
|
|
10
|
+
private static _textures;
|
|
11
|
+
private static _texturesLoadPromise;
|
|
12
|
+
private _renderer;
|
|
13
|
+
private _primaryGradient?;
|
|
14
|
+
private _secondaryGradient?;
|
|
15
|
+
private _renderProperties;
|
|
16
|
+
private _ptypeColors;
|
|
17
|
+
private _params;
|
|
18
|
+
private _gl;
|
|
19
|
+
private _initialized;
|
|
20
|
+
private _destroyed;
|
|
21
|
+
constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, params: FullRenderParameters);
|
|
22
|
+
init(): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Renders a tile with the preprocessing shader into the currently bound framebuffer.
|
|
25
|
+
*/
|
|
26
|
+
renderTile(gl: WebGLRenderingContext | WebGL2RenderingContext, tileTexture: WebGLTexture, tileHeader: TileHeader, tileParams: PreprocessedTileParams): void;
|
|
27
|
+
destroy(): void;
|
|
28
|
+
private _bindUniforms;
|
|
29
|
+
/**
|
|
30
|
+
* @summary Initializes the preprocessor renderer including its shader program and geometry
|
|
31
|
+
*/
|
|
32
|
+
private _initRenderer;
|
|
33
|
+
/**
|
|
34
|
+
* @summary Function called on each params update (in case user changed color palette)
|
|
35
|
+
*/
|
|
36
|
+
private _createUpdateGradients;
|
|
37
|
+
/**
|
|
38
|
+
* Ensures that pattern textures are loaded.
|
|
39
|
+
* Either initiates the load and awaits it, or,
|
|
40
|
+
* if the textures are already loaded, returns immediately.
|
|
41
|
+
* If called while the textures are loading, waits until they are ready.
|
|
42
|
+
*/
|
|
43
|
+
private _prepareTextures;
|
|
44
|
+
private static _prepareTextures;
|
|
45
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GlRenderer } from '@windy/glUtils';
|
|
2
|
+
import type { ReadyTile } from '@windy/tileHelpers';
|
|
3
|
+
import type { SwitchableTileCache } from '@windy/SwitchableTileCache';
|
|
4
|
+
/**
|
|
5
|
+
* Handles rendering of already preprocessed tiles with a simple shader.
|
|
6
|
+
* Does not depend on current map/render params,
|
|
7
|
+
* only needs a {@link SwitchableTileCache} instance in order to render its tiles.
|
|
8
|
+
* Has no internal state other than compiled shaders and empty placeholder texture.
|
|
9
|
+
*/
|
|
10
|
+
export declare class TileLayerRenderer extends GlRenderer {
|
|
11
|
+
private _emptyPlaceholderTexture;
|
|
12
|
+
private _bindings;
|
|
13
|
+
constructor(gl: WebGL2RenderingContext | WebGLRenderingContext);
|
|
14
|
+
render(_gl: WebGLRenderingContext | WebGL2RenderingContext): void;
|
|
15
|
+
/**
|
|
16
|
+
* Renders the layer using the currently loaded tiles in the current cache of the supplied SwitchableTileCache.
|
|
17
|
+
*/
|
|
18
|
+
renderTiles(gl: WebGL2RenderingContext | WebGLRenderingContext, cache: SwitchableTileCache<ReadyTile>): void;
|
|
19
|
+
/**
|
|
20
|
+
* @summary Renderer destructor
|
|
21
|
+
*/
|
|
22
|
+
destroy(gl: WebGLRenderingContext | WebGL2RenderingContext): void;
|
|
23
|
+
private _initializeRenderer;
|
|
24
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { GlTexture } from '@windy/glUtils';
|
|
2
|
+
import type { Color } from '@windy/Color';
|
|
3
|
+
import type { DataQuality } from '@windy/Product';
|
|
4
|
+
import type { Vector2 } from '@windy/math';
|
|
5
|
+
export type TileHeader = {
|
|
6
|
+
decoderRstep: number;
|
|
7
|
+
decoderRmin: number;
|
|
8
|
+
decoderGstep: number;
|
|
9
|
+
decoderGmin: number;
|
|
10
|
+
decoderBstep: number;
|
|
11
|
+
decoderBmin: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* TileLayer min-max zoom - affects all tileLayer-based layers (tileLayer, accumulations, etc)
|
|
15
|
+
*/
|
|
16
|
+
export declare const tileLayerZoomBounds: Vector2;
|
|
17
|
+
export type GradientProps = {
|
|
18
|
+
texture: GlTexture | null;
|
|
19
|
+
mul: number;
|
|
20
|
+
add: number;
|
|
21
|
+
} | null;
|
|
22
|
+
export declare function decodeHeader(imageData: Uint8Array | Uint8ClampedArray, width: number): Float32Array;
|
|
23
|
+
export declare function processHeader(decodedHeader: Float32Array): TileHeader;
|
|
24
|
+
export declare function imageBitmapToUint8Array(imageBitmap: ImageBitmap): Uint8Array;
|
|
25
|
+
/**
|
|
26
|
+
* Creates color gradient texture
|
|
27
|
+
* @param colorObj Color instance
|
|
28
|
+
* @returns texture with additional params
|
|
29
|
+
*/
|
|
30
|
+
export declare function createGradientObject(gl: WebGL2RenderingContext | WebGLRenderingContext, colorObj: Color): GradientProps;
|
|
31
|
+
export declare function prepareRainPattern(gl: WebGL2RenderingContext | WebGLRenderingContext): GlTexture;
|
|
32
|
+
/**
|
|
33
|
+
* @summary Returns data zoom offset for the supplied data quality
|
|
34
|
+
* - zoom offset is used to offset the current map/tile zoom for fetching data tiles
|
|
35
|
+
* @param dataQuality
|
|
36
|
+
*/
|
|
37
|
+
export declare function dataQualityToZoomOffset(dataQuality: DataQuality): number;
|
|
38
|
+
export declare const decodedTileDataSize = 257;
|
|
39
|
+
/**
|
|
40
|
+
* Returns a 257x257 texture containing the image with the header removed.
|
|
41
|
+
*/
|
|
42
|
+
export declare function decodeImageBytesCompact(imageData: Uint8Array | Uint8ClampedArray): Uint8Array;
|
|
43
|
+
export declare function decodeImage(imageData: Uint8Array): Promise<ImageBitmap>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { GlTexture } from '@windy/glUtils';
|
|
2
|
+
import type { Coords } from '@leafletGl';
|
|
3
|
+
export declare enum TilePreprocessorType {
|
|
4
|
+
NONE = 0,
|
|
5
|
+
RADAR_FLOW = 1,
|
|
6
|
+
RADAR_DATA_WEBP = 2,
|
|
7
|
+
SATELLITE_DATA = 3,
|
|
8
|
+
SATELLITE_FLOW = 4,
|
|
9
|
+
TILE_LAYER = 5,
|
|
10
|
+
RADAR_PTYPE = 6
|
|
11
|
+
}
|
|
12
|
+
export declare class PreprocessedTileParams {
|
|
13
|
+
tileCoords: Coords;
|
|
14
|
+
payload?: unknown;
|
|
15
|
+
}
|
|
16
|
+
export declare abstract class TilePreprocessor {
|
|
17
|
+
/**
|
|
18
|
+
* @summary Renders given tile (texture) using the preprocessor into the the currently bound framebuffer
|
|
19
|
+
* @param tileTexture Texture to preprocess
|
|
20
|
+
* @param params Additional optional parameters which might be required for some preprocessing
|
|
21
|
+
*/
|
|
22
|
+
abstract renderTile(gl: WebGLRenderingContext | WebGL2RenderingContext, tileTexture: GlTexture, tileParams: PreprocessedTileParams): void;
|
|
23
|
+
/**
|
|
24
|
+
* @summary Deletes the preprocessor (releases its resources)
|
|
25
|
+
*/
|
|
26
|
+
abstract destroy(gl: WebGLRenderingContext | WebGL2RenderingContext): void;
|
|
27
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Renderer } from '@windy/Renderer';
|
|
2
|
-
import
|
|
3
|
-
import type { Renderers } from '@windy/Renderer
|
|
2
|
+
import { TileLayer } from '@leafletGl';
|
|
3
|
+
import type { Renderers } from '@windy/Renderer';
|
|
4
4
|
export declare class TopoMap extends Renderer {
|
|
5
|
-
baseLayer:
|
|
6
|
-
open(
|
|
5
|
+
baseLayer: TileLayer | null;
|
|
6
|
+
open(): Promise<void>;
|
|
7
7
|
close(rqrdRenderers: Renderers[]): void;
|
|
8
8
|
addOrUpdateBaseLayer(): void;
|
|
9
9
|
removeBaseLayer(): void;
|
|
@@ -6,11 +6,9 @@ import type { WindowInitParams } from '@windy/Window';
|
|
|
6
6
|
import type { PluginOpeningOptions, WindowClosingOptions } from '@windy/interfaces.d';
|
|
7
7
|
import type { InterpolatorFactory } from '@windy/interpolator';
|
|
8
8
|
import type { PluginsOpenParams, PluginsQsParams } from '@windy/plugin-params.d';
|
|
9
|
-
import type {
|
|
9
|
+
import type { WindowPlugins } from '@windy/plugins.d';
|
|
10
10
|
import type { ListeningPriority } from '@windy/singleclick.d';
|
|
11
11
|
import type { LoadedTranslations, ParsedQueryString } from '@windy/types';
|
|
12
|
-
export interface WindowPlugins extends TagPlugins, SveltePlugins, SveltePanePlugins, BottomSveltePlugins {
|
|
13
|
-
}
|
|
14
12
|
/** Allowed params to WindowPlugin constructor (private and protected props are omited by default) */
|
|
15
13
|
export type WindowPluginInitParams<P extends keyof WindowPlugins> = PluginInitParams<P> & Omit<WindowInitParams, 'ident' | 'html'> & Partial<Omit<WindowPlugin<P>, 'open' | 'load' | 'refs' | 'node' | 'domEl'>>;
|
|
16
14
|
export declare abstract class WindowPlugin<P extends keyof WindowPlugins> extends Plugin<P> {
|
|
@@ -146,10 +144,13 @@ export declare abstract class WindowPlugin<P extends keyof WindowPlugins> extend
|
|
|
146
144
|
beforeLoad(..._args: unknown[]): void;
|
|
147
145
|
/**
|
|
148
146
|
* Called by router when URL matches plugin's router (feel free to overload it)
|
|
147
|
+
*
|
|
148
|
+
* Typing is difficult here, because captured groups provide just object with string values
|
|
149
|
+
* and we dunno that it adheres to PluginsOpenParams[P] type.
|
|
150
|
+
*
|
|
151
|
+
* Yet the return type MUST BE PluginsOpenParams[P] so it can be used
|
|
149
152
|
*/
|
|
150
|
-
onRouteMatch(
|
|
151
|
-
groups: PluginsOpenParams[P];
|
|
152
|
-
}, _qs?: ParsedQueryString): PluginsOpenParams[P] | undefined;
|
|
153
|
+
onRouteMatch(regExpGroups: Record<string, string>, _qs?: ParsedQueryString): PluginsOpenParams[P];
|
|
153
154
|
/**
|
|
154
155
|
* When called with params, it will create valid URL for plugin
|
|
155
156
|
* as defined in router property.
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import type { AppsFlyerPlugin } from 'appsflyer-capacitor-plugin/src/definitions';
|
|
2
|
+
export declare const appsFlyerPromise: Promise<AppsFlyerPlugin | undefined>;
|
|
2
3
|
export declare function logAppsFlyerProductChange(): void;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
export type MapTilesKeys = 'graymap' | 'landmaskmap' | 'simplemap' | 'graymapPatch5' | 'graymapPatch11' | 'simplemapPatch5' | 'simplemapPatch9' | 'sznmap' | 'winter' | 'satLocal' | 'sat';
|
|
2
|
+
/**
|
|
3
|
+
* Last zoom level at which the gray base map is displayed.
|
|
4
|
+
* At higher zooms, outdoor map is used instead.
|
|
5
|
+
*/
|
|
6
|
+
export declare const grayMapZoomEnd = 11;
|
|
2
7
|
/**
|
|
3
8
|
* Return just record of different map tilesURLs that we use as basemap
|
|
4
9
|
*/
|
|
5
10
|
export declare const mapTilesRecord: (patchType?: string | null) => Record<MapTilesKeys, string>;
|
|
11
|
+
export declare const baseMapLayerId = "raster-basemap";
|
|
6
12
|
/**
|
|
7
13
|
* Adds basemap to Leaflet map or updates source of tiles it if already exists
|
|
8
14
|
*/
|
|
9
|
-
export declare function addOrUpdateBasemap(
|
|
15
|
+
export declare function addOrUpdateBasemap(): void;
|
|
10
16
|
/**
|
|
11
17
|
* Remove basemap from Leaflet map
|
|
12
18
|
*/
|
|
13
|
-
export declare function removeBasemap(
|
|
19
|
+
export declare function removeBasemap(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Move basemap to a new bucket
|
|
22
|
+
*/
|
|
23
|
+
export declare function reorderBasemapLayer(newBucketId: number): void;
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module cityLabels.ts
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
export declare const add: () => void;
|
|
8
|
-
export declare const remove: () => void;
|
|
6
|
+
import LabelsLayer from '@windy/LabelsLayer';
|
|
9
7
|
export declare const disable: () => void;
|
|
10
8
|
export declare const enable: () => void;
|
|
9
|
+
export declare const cityLabels: LabelsLayer;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Reusable color gradients
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const cloudBaseAndVisibility: RGBA[];
|
|
9
|
-
export declare const radarGradientAndValues: ColorGradient;
|
|
10
|
-
/**
|
|
11
|
-
* Creates a color gradient from array of prepared ones
|
|
12
|
-
*/
|
|
13
|
-
export declare const createColorGradient: (gradient: RGBA[], numValues: NumValue[]) => ColorGradient;
|
|
4
|
+
import type { RGBString } from '@windy/types.d';
|
|
5
|
+
export declare const moistureAnomaly: RGBString[];
|
|
6
|
+
export declare const airPollutant: RGBString[];
|
|
7
|
+
export declare const cloudBaseAndVisibility: RGBString[];
|
package/types/client/colors.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CustomProtocol, TileDataPreprocessCallback, TransformedUrlPayload } from '@windy/mapUtils.d';
|
|
2
|
+
/**
|
|
3
|
+
* @summary Registers custom protocol to the maplibre, which tells maplibre that we would like to take responsibility for fetching these tiles
|
|
4
|
+
* - this is useful when we want to modify the original tile request url etc.
|
|
5
|
+
* - for example to inject additional parameters such as timestamp, satellite key etc., since maplibre supports only {x}/{y}/{z} parameters
|
|
6
|
+
* @param protocol Placeholder protocol (e.g. "myProtocol") which is set to the tile url instead of the standard http/https protocol and which is used by maplibre to differentiate between tiles to be intercepted
|
|
7
|
+
* @param urlTransformCallback Callback function to be called for each intercepted tile request
|
|
8
|
+
* - the provided callback should take two parameters (the current tile url and the custom protocol) and should output valid tile url or empty string in case the tile should be aborted
|
|
9
|
+
* @param usePlaceholderImage Whether to use "no-data" placeholder tile in case the original tile could not be loaded
|
|
10
|
+
*/
|
|
11
|
+
export declare function registerCustomTileProtocol(protocol: CustomProtocol, urlTransformCallback: (url: string, protocol: string) => TransformedUrlPayload, tilePreprocessCallback?: TileDataPreprocessCallback, fallbackImageData?: ArrayBuffer, replaceEmpty?: boolean): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Texture2D } from 'plugins/
|
|
1
|
+
import type { Texture2D } from '@plugins/shared/gl-lib/gl-lib';
|
|
2
2
|
import type {
|
|
3
3
|
Mat2,
|
|
4
4
|
Mat2d,
|
|
@@ -18,10 +18,6 @@ export interface CustomError extends Error {
|
|
|
18
18
|
full?: string;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
// export type WebGLProgramObject = {
|
|
22
|
-
// [whatever: string]: any;
|
|
23
|
-
// };
|
|
24
|
-
|
|
25
21
|
export type UniformName = `u${string}`;
|
|
26
22
|
|
|
27
23
|
export type AttributeName = `a${string}`;
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
SatelliteMetric,
|
|
7
7
|
UVIndexMetric,
|
|
8
8
|
} from '@windy/MetricClasses';
|
|
9
|
+
import { Metric } from '@windy/Metric';
|
|
9
10
|
import { NumValue } from '@windy/types.d';
|
|
10
11
|
|
|
11
12
|
/*
|
|
@@ -46,6 +47,7 @@ export type MetricItem =
|
|
|
46
47
|
| 'type'
|
|
47
48
|
| 'l/km²'
|
|
48
49
|
| 'W/m²'
|
|
50
|
+
| 'kW/m'
|
|
49
51
|
| 'drought'
|
|
50
52
|
| 'fwi'
|
|
51
53
|
| 'mm/h'
|
|
@@ -53,7 +55,9 @@ export type MetricItem =
|
|
|
53
55
|
| 'uvindex'
|
|
54
56
|
| 'EDR'
|
|
55
57
|
| 'km²'
|
|
56
|
-
| 'acres'
|
|
58
|
+
| 'acres'
|
|
59
|
+
| 'AQI'
|
|
60
|
+
| 'gr./m³';
|
|
57
61
|
|
|
58
62
|
/**
|
|
59
63
|
* # @windy/metrics
|
|
@@ -116,11 +120,14 @@ export interface MetricTypes {
|
|
|
116
120
|
fwi: NumberedMetric;
|
|
117
121
|
dfm10h: NumberedMetric;
|
|
118
122
|
solarpower: NumberedMetric;
|
|
123
|
+
wavePower: NumberedMetric;
|
|
119
124
|
uvindex: UVIndexMetric;
|
|
120
125
|
capAlerts: NumberedMetric;
|
|
121
126
|
turbulence: NumberedMetric;
|
|
122
127
|
icing: NumberedMetric;
|
|
123
128
|
area: NumberedMetric;
|
|
129
|
+
aqi: NumberedMetric;
|
|
130
|
+
pollen: NumberedMetric;
|
|
124
131
|
}
|
|
125
132
|
|
|
126
133
|
/** @ignore */
|
|
@@ -190,4 +197,18 @@ export interface Conversion {
|
|
|
190
197
|
export type ConvObj = { [K in MetricItem]?: Conversion };
|
|
191
198
|
|
|
192
199
|
/** @ignore */
|
|
193
|
-
export type MetricInitParams = Pick<
|
|
200
|
+
export type MetricInitParams = Pick<Metric, 'ident'> &
|
|
201
|
+
Partial<
|
|
202
|
+
Pick<
|
|
203
|
+
Metric,
|
|
204
|
+
| 'lines'
|
|
205
|
+
| 'conv'
|
|
206
|
+
| 'backConv'
|
|
207
|
+
| 'defaults'
|
|
208
|
+
| 'cohesion'
|
|
209
|
+
| 'nativeSync'
|
|
210
|
+
| 'description'
|
|
211
|
+
| 'separator'
|
|
212
|
+
| 'discreteLegend'
|
|
213
|
+
>
|
|
214
|
+
>;
|