@aguacerowx/javascript-sdk 0.0.11 → 0.0.12
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/package.json +1 -1
- package/src/AguaceroCore.js +0 -24
package/package.json
CHANGED
package/src/AguaceroCore.js
CHANGED
|
@@ -526,29 +526,6 @@ export class AguaceroCore extends EventEmitter {
|
|
|
526
526
|
const conversionFunc = getUnitConversionFunction(dataNativeUnit, displayUnit);
|
|
527
527
|
let displayValue = conversionFunc ? conversionFunc(nativeValue) : nativeValue;
|
|
528
528
|
|
|
529
|
-
// --- START: ADDED CODE ---
|
|
530
|
-
|
|
531
|
-
// Create a variable to hold the precipitation type, if any.
|
|
532
|
-
let precipType = null;
|
|
533
|
-
|
|
534
|
-
// Check if the current variable is one of the special ptype variables.
|
|
535
|
-
if (variable === 'ptypeRefl' || variable === 'ptypeRate') {
|
|
536
|
-
const value = nativeValue; // Use the raw, unconverted value for ptype logic
|
|
537
|
-
|
|
538
|
-
if (value >= 100 && value < 200) {
|
|
539
|
-
displayValue -= 100;
|
|
540
|
-
precipType = 'Snow';
|
|
541
|
-
} else if (value >= 200 && value < 300) {
|
|
542
|
-
displayValue -= 200;
|
|
543
|
-
precipType = 'Frzg Rain'; // Abbreviated for tooltips
|
|
544
|
-
} else if (value >= 300 && value < 400) {
|
|
545
|
-
displayValue -= 300;
|
|
546
|
-
precipType = 'Ice Pellets';
|
|
547
|
-
} else {
|
|
548
|
-
precipType = 'Rain';
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
|
|
552
529
|
// Return the final payload, now including the precipType.
|
|
553
530
|
return {
|
|
554
531
|
lngLat: { lng, lat },
|
|
@@ -558,7 +535,6 @@ export class AguaceroCore extends EventEmitter {
|
|
|
558
535
|
},
|
|
559
536
|
value: displayValue,
|
|
560
537
|
unit: displayUnit,
|
|
561
|
-
precipType: precipType // NEW: Add this to the return object
|
|
562
538
|
};
|
|
563
539
|
} catch (error) {
|
|
564
540
|
return null;
|