@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,84 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>WxTiles v3.0</title>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<link rel="shortcut icon" href="res/icon.png" type="image/x-icon" />
|
|
8
|
-
|
|
9
|
-
<!-- LEAFLET lib goes first -->
|
|
10
|
-
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css" crossorigin="" />
|
|
11
|
-
<script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js" crossorigin=""></script>
|
|
12
|
-
|
|
13
|
-
<!-- WxTile lib goes here -->
|
|
14
|
-
<script src="https://unpkg.com/@metoceanapi/wxtiles-leaflet@2.1.3/dist/web/index.js"></script>
|
|
15
|
-
<link rel="stylesheet" href="https://unpkg.com/@metoceanapi/wxtiles-leaflet@2.1.3/dist/web/index.css" />
|
|
16
|
-
</head>
|
|
17
|
-
|
|
18
|
-
<body style="margin: 0">
|
|
19
|
-
<div id="map" style="height: 100vh; width: 100vw"></div>
|
|
20
|
-
<script>
|
|
21
|
-
('use strict');
|
|
22
|
-
start();
|
|
23
|
-
async function start() {
|
|
24
|
-
//// Leaflet initialization START
|
|
25
|
-
const map = L.map('map', { center: [0, 0], zoom: 2, zoomControl: true });
|
|
26
|
-
// add navigation controls
|
|
27
|
-
L.control.zoom({ position: 'bottomright' }).addTo(map);
|
|
28
|
-
//// Leaflet initialization END
|
|
29
|
-
|
|
30
|
-
//// Helper
|
|
31
|
-
const addWxLayer = async (wxsource) => {
|
|
32
|
-
map.addLayer(wxsource);
|
|
33
|
-
await new Promise((done) => wxsource.once('load', done)); // highly recommended to await for the first load
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const getCoords = (e) => e.latlng.wrap();
|
|
37
|
-
//// Helpers END
|
|
38
|
-
|
|
39
|
-
//// WXTILES START
|
|
40
|
-
// grab the WxTiles API
|
|
41
|
-
const { WxTilesLogging, WxAPI } = window.wxtilesleaflet;
|
|
42
|
-
|
|
43
|
-
WxTilesLogging(true); // log WxTiles info to console if needed
|
|
44
|
-
|
|
45
|
-
const dataServerURL = 'https://tiles.metoceanapi.com/data/';
|
|
46
|
-
// Get the API ready - should be ONE per application
|
|
47
|
-
const wxapi = new WxAPI({ dataServerURL, maskURL: 'auto', qtreeURL: 'auto' });
|
|
48
|
-
|
|
49
|
-
// Define the dataset and variable
|
|
50
|
-
const datasetName = 'gfs.global';
|
|
51
|
-
const variable = 'air.temperature.at-2m'; // Scalar example
|
|
52
|
-
// const variable = 'wind.speed.eastward.at-10m'; // Vector example
|
|
53
|
-
|
|
54
|
-
// Create a dataset manager (may be used for many layers from this dataset)
|
|
55
|
-
const wxdatasetManager = await wxapi.createDatasetManager(datasetName);
|
|
56
|
-
|
|
57
|
-
// create a layer
|
|
58
|
-
const layerFrameworkOptions = { id: 'wxsource', opacity: 1, attribution: 'WxTiles' };
|
|
59
|
-
const wxsource = wxdatasetManager.createSourceLayer({ variable }, layerFrameworkOptions);
|
|
60
|
-
|
|
61
|
-
// add the layer to the map
|
|
62
|
-
await addWxLayer(wxsource);
|
|
63
|
-
|
|
64
|
-
// extra magic
|
|
65
|
-
// on mouse movement, add a new color to the color map and re-render the layer
|
|
66
|
-
await wxsource.updateCurrentStyleObject({ levels: undefined, mask: 'land' }); // reset levels if existing in the style
|
|
67
|
-
|
|
68
|
-
const levels = wxsource.getCurrentStyleObjectCopy().levels || []; // get current/default/any levels
|
|
69
|
-
// generate a new color map from the existing levels
|
|
70
|
-
const colMap = levels.map((level) => [level, '#' + Math.random().toString(16).slice(2, 8) + 'ff']);
|
|
71
|
-
let busy = false;
|
|
72
|
-
map.on('mousemove', async (e) => {
|
|
73
|
-
if (!wxsource || busy) return;
|
|
74
|
-
busy = true;
|
|
75
|
-
const tileInfo = wxsource.getLayerInfoAtLatLon(getCoords(e), map);
|
|
76
|
-
if (tileInfo) {
|
|
77
|
-
await wxsource.updateCurrentStyleObject({ colorMap: [...colMap, [tileInfo.inStyleUnits[0], '#ff000000']] });
|
|
78
|
-
}
|
|
79
|
-
busy = false;
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
</script>
|
|
83
|
-
</body>
|
|
84
|
-
</html>
|
|
Binary file
|
|
Binary file
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>WxTiles v3.0</title>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<link rel="shortcut icon" href="res/icon.png" type="image/x-icon" />
|
|
8
|
-
|
|
9
|
-
<!-- LEAFLET lib goes first -->
|
|
10
|
-
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css" crossorigin="" />
|
|
11
|
-
<script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js" crossorigin=""></script>
|
|
12
|
-
|
|
13
|
-
<!-- WxTile lib goes here -->
|
|
14
|
-
<script src="https://unpkg.com/@metoceanapi/wxtiles-leaflet@2.1.3/dist/web/index.js"></script>
|
|
15
|
-
<link rel="stylesheet" href="https://unpkg.com/@metoceanapi/wxtiles-leaflet@2.1.3/dist/web/index.css" />
|
|
16
|
-
</head>
|
|
17
|
-
|
|
18
|
-
<body style="margin: 0">
|
|
19
|
-
<div id="map" style="height: 100vh; width: 100vw"></div>
|
|
20
|
-
|
|
21
|
-
<script>
|
|
22
|
-
('use strict');
|
|
23
|
-
start();
|
|
24
|
-
async function start() {
|
|
25
|
-
//// Leaflet initialization START
|
|
26
|
-
const map = L.map('map', { center: [0, 0], zoom: 2, zoomControl: true });
|
|
27
|
-
// add navigation controls
|
|
28
|
-
L.control.zoom({ position: 'bottomright' }).addTo(map);
|
|
29
|
-
//// Leaflet initialization END
|
|
30
|
-
|
|
31
|
-
//// Helper
|
|
32
|
-
const addWxLayer = async (wxsource) => {
|
|
33
|
-
map.addLayer(wxsource);
|
|
34
|
-
await new Promise((done) => wxsource.once('load', done)); // highly recommended to await for the first load
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const getCoords = (e) => e.latlng.wrap();
|
|
38
|
-
//// Helpers END
|
|
39
|
-
|
|
40
|
-
//// WXTILES START
|
|
41
|
-
// grab the WxTiles API
|
|
42
|
-
const { WxTilesLogging, WxAPI } = window.wxtilesleaflet;
|
|
43
|
-
|
|
44
|
-
WxTilesLogging(true); // log WxTiles info to console if needed
|
|
45
|
-
|
|
46
|
-
const dataServerURL = 'https://tiles.metoceanapi.com/data/';
|
|
47
|
-
// Get the API ready - should be ONE per application
|
|
48
|
-
const wxapi = new WxAPI({ dataServerURL, maskURL: 'auto', qtreeURL: 'auto' });
|
|
49
|
-
|
|
50
|
-
// Define the dataset and variable
|
|
51
|
-
const datasetName = 'gfs.global';
|
|
52
|
-
const variable = 'air.temperature.at-2m'; // Scalar example
|
|
53
|
-
// const variable = 'wind.speed.eastward.at-10m'; // Vector example
|
|
54
|
-
|
|
55
|
-
// Create a dataset manager (may be used for many layers from this dataset)
|
|
56
|
-
const wxdatasetManager = await wxapi.createDatasetManager(datasetName);
|
|
57
|
-
|
|
58
|
-
// create a layer
|
|
59
|
-
const layerFrameworkOptions = { id: 'wxsource', opacity: 1, attribution: 'WxTiles' };
|
|
60
|
-
const wxsource = wxdatasetManager.createSourceLayer({ variable }, layerFrameworkOptions);
|
|
61
|
-
|
|
62
|
-
// add the layer to the map
|
|
63
|
-
await addWxLayer(wxsource);
|
|
64
|
-
|
|
65
|
-
// extra magic
|
|
66
|
-
// update the style: mask sea
|
|
67
|
-
await wxsource.updateCurrentStyleObject({ mask: 'land' });
|
|
68
|
-
// start the blur animation
|
|
69
|
-
(async function step(n = 0) {
|
|
70
|
-
await wxsource.updateCurrentStyleObject({ isolineText: false, blurRadius: ~~(10 * Math.sin(n / 500) + 10) });
|
|
71
|
-
requestAnimationFrame(step);
|
|
72
|
-
})();
|
|
73
|
-
}
|
|
74
|
-
</script>
|
|
75
|
-
</body>
|
|
76
|
-
</html>
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>WxTiles v3.0</title>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<link rel="shortcut icon" href="res/icon.png" type="image/x-icon" />
|
|
8
|
-
|
|
9
|
-
<!-- LEAFLET lib goes first -->
|
|
10
|
-
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css" crossorigin="" />
|
|
11
|
-
<script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js" crossorigin=""></script>
|
|
12
|
-
|
|
13
|
-
<!-- WxTile lib goes here -->
|
|
14
|
-
<script src="https://unpkg.com/@metoceanapi/wxtiles-leaflet@2.1.3/dist/web/index.js"></script>
|
|
15
|
-
<link rel="stylesheet" href="https://unpkg.com/@metoceanapi/wxtiles-leaflet@2.1.3/dist/web/index.css" />
|
|
16
|
-
</head>
|
|
17
|
-
|
|
18
|
-
<body style="margin: 0">
|
|
19
|
-
<div id="map" style="height: 100vh; width: 100vw"></div>
|
|
20
|
-
|
|
21
|
-
<script>
|
|
22
|
-
('use strict');
|
|
23
|
-
start();
|
|
24
|
-
async function start() {
|
|
25
|
-
//// Leaflet initialization START
|
|
26
|
-
const map = L.map('map', { center: [0, 0], zoom: 2, zoomControl: true });
|
|
27
|
-
// add navigation controls
|
|
28
|
-
L.control.zoom({ position: 'bottomright' }).addTo(map);
|
|
29
|
-
//// Leaflet initialization END
|
|
30
|
-
|
|
31
|
-
//// Helper
|
|
32
|
-
const addWxLayer = async (wxsource) => {
|
|
33
|
-
map.addLayer(wxsource);
|
|
34
|
-
await new Promise((done) => wxsource.once('load', done)); // highly recommended to await for the first load
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const getCoords = (e) => e.latlng.wrap();
|
|
38
|
-
//// Helpers END
|
|
39
|
-
|
|
40
|
-
//// WXTILES START
|
|
41
|
-
// grab the WxTiles API
|
|
42
|
-
const { WxTilesLogging, WxAPI } = window.wxtilesleaflet;
|
|
43
|
-
|
|
44
|
-
WxTilesLogging(true); // log WxTiles info to console if needed
|
|
45
|
-
|
|
46
|
-
const dataServerURL = 'https://tiles.metoceanapi.com/data/';
|
|
47
|
-
// Get the API ready - should be ONE per application
|
|
48
|
-
const wxapi = new WxAPI({ dataServerURL, maskURL: 'auto', qtreeURL: 'auto' });
|
|
49
|
-
|
|
50
|
-
// Define the dataset and variable
|
|
51
|
-
const datasetName = 'gfs.global';
|
|
52
|
-
// const variable = 'air.temperature.at-2m'; // Scalar example
|
|
53
|
-
const variable = 'wind.speed.eastward.at-10m'; // Vector example
|
|
54
|
-
|
|
55
|
-
// Create a dataset manager (may be used for many layers from this dataset)
|
|
56
|
-
const wxdatasetManager = await wxapi.createDatasetManager(datasetName);
|
|
57
|
-
|
|
58
|
-
// create a layer
|
|
59
|
-
const layerFrameworkOptions = { id: 'wxsource', opacity: 1, attribution: 'WxTiles' };
|
|
60
|
-
const wxsource = wxdatasetManager.createSourceLayer({ variable }, layerFrameworkOptions);
|
|
61
|
-
|
|
62
|
-
// add the layer to the map
|
|
63
|
-
await addWxLayer(wxsource);
|
|
64
|
-
|
|
65
|
-
// extra magic
|
|
66
|
-
await wxsource.updateCurrentStyleObject({ streamLineColor: 'inverted' });
|
|
67
|
-
}
|
|
68
|
-
</script>
|
|
69
|
-
</body>
|
|
70
|
-
</html>
|
package/docs/server.py
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
from http.server import HTTPServer, SimpleHTTPRequestHandler, test
|
|
3
|
-
import sys
|
|
4
|
-
|
|
5
|
-
class CORSRequestHandler (SimpleHTTPRequestHandler):
|
|
6
|
-
def end_headers (self):
|
|
7
|
-
self.send_header('Access-Control-Allow-Origin', '*')
|
|
8
|
-
SimpleHTTPRequestHandler.end_headers(self)
|
|
9
|
-
|
|
10
|
-
if __name__ == '__main__':
|
|
11
|
-
test(CORSRequestHandler, HTTPServer, port=int(sys.argv[1]) if len(sys.argv) > 1 else 8000)
|