From 2bd107d7bb4bc5bc3735fe5600c588fea6deea29 Mon Sep 17 00:00:00 2001 From: jonsowman Date: Sat, 5 Jun 2010 01:42:05 +0100 Subject: [PATCH] Hover marker information added and fixed JS getHours bug --- predict/includes/functions.inc.php | 2 +- predict/js/pred.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/predict/includes/functions.inc.php b/predict/includes/functions.inc.php index b179897..3fa948a 100644 --- a/predict/includes/functions.inc.php +++ b/predict/includes/functions.inc.php @@ -9,7 +9,7 @@ function createModel($post_array) { $pred_model = array(); // first, populate the prediction model - $pred_model['hour'] = $post_array['hour'] + 1; //adjust for GMT + $pred_model['hour'] = $post_array['hour']; //adjust for GMT $pred_model['min'] = $post_array['min']; $pred_model['sec'] = $post_array['sec']; diff --git a/predict/js/pred.js b/predict/js/pred.js index d15535a..082833a 100644 --- a/predict/js/pred.js +++ b/predict/js/pred.js @@ -214,14 +214,14 @@ function parseCSV(lines) { position: launch_pt, map: map, icon: launch_icon, - title: 'Balloon launch ('+launch_lat+', '+launch_lon+')' + title: 'Balloon launch ('+launch_lat+', '+launch_lon+') at ' + POSIXtoHM(launch_time) }); var land_marker = new google.maps.Marker({ position: land_pt, map:map, icon: land_icon, - title: 'Predicted Landing ('+land_lat+', '+land_lon+')' + title: 'Predicted Landing ('+land_lat+', '+land_lon+') at ' + POSIXtoHM(land_time) }); var path_polyline = new google.maps.Polyline({ @@ -381,6 +381,14 @@ function toggleWindow(window_name, linker, onhide, onshow, force) { } } +function POSIXtoHM(timestamp) { + var ts = new Date(); + ts.setTime(timestamp*1000); + var adjHours = ts.getHours() + (ts.getTimezoneOffset()/60); + var str = adjHours + ":" + ts.getMinutes(); + return str; +} + // launch site dropdown switcher function UpdateLaunchSite(id) { txtLat = document.getElementById("lat");