@metoceanapi/wxtiles-leaflet 2.2.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.
Files changed (124) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/GPLv3.txt +674 -0
  3. package/LICENSE.txt +12 -9
  4. package/README.md +16 -3
  5. package/dep.dot +33 -0
  6. package/dep.svg +233 -0
  7. package/dist/es/customlayer/customlayer.d.ts +3 -0
  8. package/dist/es/index.d.ts +19 -13
  9. package/dist/es/index.js +6 -2
  10. package/dist/es/wxAPI/WxAPI.d.ts +3 -61
  11. package/dist/es/wxAPI/WxDataSetManager.d.ts +35 -123
  12. package/dist/es/wxsource/wxsource.d.ts +118 -51
  13. package/dist/es/wxsource/wxsourcetypes.d.ts +70 -10
  14. package/dist/web/index.js +6 -2
  15. package/docs/docs/assets/highlight.css +7 -0
  16. package/docs/docs/assets/search.js +1 -1
  17. package/docs/docs/classes/CustomWxTilesLayer.html +4 -1
  18. package/docs/docs/classes/DataIntegral.html +9 -9
  19. package/docs/docs/classes/QTree.html +41 -14
  20. package/docs/docs/classes/RawCLUT.html +9 -9
  21. package/docs/docs/classes/TilesCache.html +5 -5
  22. package/docs/docs/classes/WxAPI.html +109 -79
  23. package/docs/docs/classes/WxAPIControl.html +242 -0
  24. package/docs/docs/classes/WxDataSetManager.html +166 -118
  25. package/docs/docs/classes/WxInfoControl.html +172 -0
  26. package/docs/docs/classes/WxLegendControl.html +166 -0
  27. package/docs/docs/classes/WxStyleEditorControl.html +462 -0
  28. package/docs/docs/classes/WxTileSource.html +204 -108
  29. package/docs/docs/classes/WxTimeControl.html +219 -0
  30. package/docs/docs/enums/TileType.html +4 -4
  31. package/docs/docs/functions/WXLOG.html +10 -5
  32. package/docs/docs/functions/WxCreateLegend.html +14 -9
  33. package/docs/docs/functions/WxGetColorSchemes.html +10 -5
  34. package/docs/docs/functions/WxGetColorStyles.html +10 -5
  35. package/docs/docs/functions/WxTilesLogging.html +13 -5
  36. package/docs/docs/index.html +27 -7
  37. package/docs/docs/interfaces/CachedUriLoaderPromiseFunc.html +7 -5
  38. package/docs/docs/interfaces/ColorStylesIncomplete.html +10 -5
  39. package/docs/docs/interfaces/Converter.html +3 -5
  40. package/docs/docs/interfaces/DataPicture.html +5 -5
  41. package/docs/docs/interfaces/FrameworkOptions.html +12 -6
  42. package/docs/docs/interfaces/IntegralPare.html +3 -3
  43. package/docs/docs/interfaces/SLinePoint.html +4 -4
  44. package/docs/docs/interfaces/Tree.html +11 -7
  45. package/docs/docs/interfaces/WxAPIOptions.html +33 -24
  46. package/docs/docs/interfaces/WxAllBoundariesMeta.html +14 -9
  47. package/docs/docs/interfaces/WxAllDatasetsShortMetas.html +11 -6
  48. package/docs/docs/interfaces/WxBoundaryMeta.html +18 -10
  49. package/docs/docs/interfaces/WxColorSchemes.html +10 -5
  50. package/docs/docs/interfaces/WxColorStyleStrict.html +44 -26
  51. package/docs/docs/interfaces/WxColorStyleWeak.html +46 -26
  52. package/docs/docs/interfaces/WxColorStylesStrict.html +2 -2
  53. package/docs/docs/interfaces/WxColorStylesWeakMixed.html +10 -5
  54. package/docs/docs/interfaces/WxData.html +10 -6
  55. package/docs/docs/interfaces/WxDataSetManagerOptions.html +15 -15
  56. package/docs/docs/interfaces/WxDatasetMeta.html +20 -20
  57. package/docs/docs/interfaces/WxDatasetShortMeta.html +9 -8
  58. package/docs/docs/interfaces/WxLayerAPI.html +24 -28
  59. package/docs/docs/interfaces/WxLayerBaseAPI.html +18 -22
  60. package/docs/docs/interfaces/WxLayerOptions.html +18 -13
  61. package/docs/docs/interfaces/WxLegend.html +16 -15
  62. package/docs/docs/interfaces/WxLngLat.html +3 -3
  63. package/docs/docs/interfaces/WxRasterData.html +11 -8
  64. package/docs/docs/interfaces/WxRequestInit.html +2 -2
  65. package/docs/docs/interfaces/WxSourceLayerOptions.html +14 -12
  66. package/docs/docs/interfaces/WxTick.html +8 -7
  67. package/docs/docs/interfaces/WxTileInfo.html +10 -10
  68. package/docs/docs/interfaces/WxUnits.html +10 -5
  69. package/docs/docs/interfaces/WxVariableMeta.html +13 -12
  70. package/docs/docs/interfaces/WxVariablesMetas.html +11 -6
  71. package/docs/docs/interfaces/XYZ.html +4 -4
  72. package/docs/docs/modules.html +21 -8
  73. package/docs/docs/types/DataIntegrals.html +10 -5
  74. package/docs/docs/types/DataPictures.html +10 -5
  75. package/docs/docs/types/ListenerMethod.html +10 -5
  76. package/docs/docs/types/Loader.html +116 -0
  77. package/docs/docs/types/Painter.html +116 -0
  78. package/docs/docs/types/SLine.html +11 -6
  79. package/docs/docs/types/SubTrees.html +10 -5
  80. package/docs/docs/types/SubTreesN.html +12 -7
  81. package/docs/docs/types/TreeN.html +12 -7
  82. package/docs/docs/types/WxDate.html +10 -5
  83. package/docs/docs/types/WxEventType.html +10 -5
  84. package/docs/docs/types/WxInstances.html +13 -6
  85. package/docs/docs/types/WxLayer.html +116 -0
  86. package/docs/docs/types/WxLayerVarsNames.html +11 -6
  87. package/docs/docs/types/WxURIs.html +10 -5
  88. package/docs/docs/types/WxUnitTuple.html +10 -5
  89. package/docs/docs/variables/WxLayerBaseImplementation.html +116 -0
  90. package/docs/script/script.js +6 -6
  91. package/hooks/pre-commit +29 -0
  92. package/package.json +9 -2
  93. package/src_example/frwrkdeps.ts +57 -18
  94. package/src_example/index.ts +2 -2
  95. package/src_example/start.ts +101 -47
  96. package/watch-public.mjs +16 -12
  97. package/dist/es/controls/WxAPIControl.d.ts +0 -19
  98. package/dist/es/controls/WxInfoControl.d.ts +0 -16
  99. package/dist/es/controls/WxLegendControl.d.ts +0 -14
  100. package/dist/es/controls/WxStyleEditorControl.d.ts +0 -52
  101. package/dist/es/controls/WxTimeControl .d.ts +0 -18
  102. package/dist/es/defaults/colorschemes.d.ts +0 -2
  103. package/dist/es/defaults/styles.d.ts +0 -2
  104. package/dist/es/defaults/uconv.d.ts +0 -2
  105. package/dist/es/utils/RawCLUT.d.ts +0 -57
  106. package/dist/es/utils/mercator.d.ts +0 -4
  107. package/dist/es/utils/qtree.d.ts +0 -27
  108. package/dist/es/utils/tests_wxtools.d.ts +0 -1
  109. package/dist/es/utils/wxtools.d.ts +0 -357
  110. package/dist/es/wxAPI/WxAPItypes.d.ts +0 -152
  111. package/dist/es/wxlayer/WxImplementation.d.ts +0 -189
  112. package/dist/es/wxlayer/loader.d.ts +0 -54
  113. package/dist/es/wxlayer/loadertools.d.ts +0 -50
  114. package/dist/es/wxlayer/painter.d.ts +0 -58
  115. package/dist/es/wxlayer/wxlayer.d.ts +0 -186
  116. package/docs/docs/classes/Loader.html +0 -165
  117. package/docs/docs/classes/Painter.html +0 -161
  118. package/docs/docs/classes/WxLayer.html +0 -419
  119. package/docs/docs/classes/WxLayerBaseImplementation.html +0 -427
  120. package/docs/examples/interactive.html +0 -84
  121. package/docs/examples/res/icon.png +0 -0
  122. package/docs/examples/res/wxtiles-logo.png +0 -0
  123. package/docs/examples/seaMaskAndAnimatedBlur.html +0 -76
  124. package/docs/examples/simpleDemo.html +0 -70
@@ -1,84 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>WxTiles v2.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 v2.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 v2.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>