mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-17 17:19:30 -07:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11c54391b2 | ||
|
|
0b47cf79c1 | ||
|
|
ba36904477 | ||
|
|
dae5b20bc6 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "ws4kp",
|
"name": "ws4kp",
|
||||||
"version": "6.5.5",
|
"version": "6.5.7",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ws4kp",
|
"name": "ws4kp",
|
||||||
"version": "6.5.5",
|
"version": "6.5.7",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dotenv": "^17.0.1",
|
"dotenv": "^17.0.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ws4kp",
|
"name": "ws4kp",
|
||||||
"version": "6.5.5",
|
"version": "6.5.7",
|
||||||
"description": "Welcome to the WeatherStar 4000+ project page!",
|
"description": "Welcome to the WeatherStar 4000+ project page!",
|
||||||
"main": "index.mjs",
|
"main": "index.mjs",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -101,7 +101,11 @@ class CurrentWeather extends WeatherDisplay {
|
|||||||
debugContext: 'currentweather',
|
debugContext: 'currentweather',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// copy enhanced data and restore the timestamp if it was overwritten by older data from mapclick
|
||||||
|
const { timestamp } = candidateObservation.features[0].properties;
|
||||||
candidateObservation.features[0].properties = enhancedResult.data;
|
candidateObservation.features[0].properties = enhancedResult.data;
|
||||||
|
candidateObservation.features[0].properties.timestamp = timestamp;
|
||||||
|
|
||||||
const { missingFields } = enhancedResult;
|
const { missingFields } = enhancedResult;
|
||||||
const missingRequired = missingFields.filter((fieldName) => {
|
const missingRequired = missingFields.filter((fieldName) => {
|
||||||
const field = requiredFields.find((f) => f.name === fieldName && f.required);
|
const field = requiredFields.find((f) => f.name === fieldName && f.required);
|
||||||
|
|||||||
@@ -9,10 +9,12 @@ const pixelToFile = (xPixel, yPixel) => {
|
|||||||
return `${yTile}-${xTile}`;
|
return `${yTile}-${xTile}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
// convert a pixel location in the overall map to a pixel location on the tile
|
// convert a pixel location in the overall map to a pixel location on the tile set
|
||||||
const modTile = (xPixel, yPixel) => {
|
const modTile = (xPixel, yPixel) => {
|
||||||
const x = Math.round(xPixel) % TILE_SIZE.x;
|
// adjust for additional 1 tile when odd
|
||||||
const y = Math.round(yPixel) % TILE_SIZE.y;
|
const x = (Math.floor(xPixel) % (TILE_SIZE.x));
|
||||||
|
const y = (Math.floor(yPixel) % (TILE_SIZE.y));
|
||||||
|
|
||||||
return { x, y };
|
return { x, y };
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -46,8 +48,8 @@ const setTiles = (data) => {
|
|||||||
// determine which tiles are used
|
// determine which tiles are used
|
||||||
const usedTiles = [
|
const usedTiles = [
|
||||||
true,
|
true,
|
||||||
TILE_SIZE.x - tileShift.x < RADAR_FINAL_SIZE.width,
|
tileShift.x + TILE_SIZE.x > RADAR_FINAL_SIZE.width,
|
||||||
TILE_SIZE.y - tileShift.y < RADAR_FINAL_SIZE.width,
|
tileShift.y + TILE_SIZE.y > RADAR_FINAL_SIZE.height,
|
||||||
];
|
];
|
||||||
// if we need t[1] and t[2] then we also need t[3]
|
// if we need t[1] and t[2] then we also need t[3]
|
||||||
usedTiles.push(usedTiles[1] && usedTiles[2]);
|
usedTiles.push(usedTiles[1] && usedTiles[2]);
|
||||||
|
|||||||
Reference in New Issue
Block a user