Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/app/map/_lib/managers/monitor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MonitorMapLayerManager extends MapLayerManager {
super.context,
super.controller, {
this.isReplayMode = false,
this.replayTimestamp = 0, //1751918230855,
this.replayTimestamp = 0, //1756300288424,
}) {
if (isReplayMode) {
GlobalProviders.data.setReplayMode(true, replayTimestamp);
Expand Down Expand Up @@ -951,6 +951,9 @@ class _MonitorMapLayerSheetState extends State<MonitorMapLayerSheet> {
localIntensity = intensityFloatToInt(info.i);
localArrivalTime = (data.info.time + sWaveTimeByDistance(data.info.depth, info.dist)).floor();

WidgetsBinding.instance.addPostFrameCallback((_) {
_updateCountdown();
});
_timer ??= Timer.periodic(const Duration(seconds: 1), (_) => _updateCountdown());

if (_isCollapsed) {
Expand Down
2 changes: 1 addition & 1 deletion lib/core/eew.dart
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ WaveTime calculateWaveTime(double depth, double distance) {
double userLat,
double userLon,
) {
final distSurface = LatLng(eqLat, eqLng).to(LatLng(userLat, userLon));
final distSurface = LatLng(eqLat, eqLng).to(LatLng(userLat, userLon)) /1000;
final dist = sqrt(pow(distSurface, 2) + pow(depth, 2));
final pga = 1.657 * exp(1.533 * mag) * pow(dist, -1.607);
var intensity = pgaToFloat(pga);
Expand Down
Loading