Jump to content

Distance/Time Remain


FSVKenny

Recommended Posts

Hi.

I have been using Kacars free for about a year now and it's great! http://www.fsvintage...pvms/index.php/

I do have a question, on the live map everting is working fine, but the Distance/Time Remain does not work. Does the Distance/Time Remain only work for the paid version or is there somthing I need to do to get the Distance/Time Remain working?

Thank you for your time,

Kenny.

Link to comment
Share on other sites

Guest lorathon

The distance remaining and time remaining are based on the lat/lng of the dep airport and arr airport. These should be populated even in the free version. They are populated by a calculation inside of the module. You should check for sites errors and ensure that the airports have the proper lat/lng.

From the module. Case liveupdate

$lat = str_replace(",", ".", $xml->liveupdate->latitude);
$lon = str_replace(",", ".", $xml->liveupdate->longitude);

# Get the distance remaining
$depapt = OperationsData::GetAirportInfo($xml->liveupdate->depICAO);
$arrapt = OperationsData::GetAirportInfo($xml->liveupdate->arrICAO);
$dist_remain = round(SchedulesData::distanceBetweenPoints(
$lat, $lon, $arrapt->lat, $arrapt->lng));

# Estimate the time remaining
if($xml->liveupdate->groundSpeed > 0)
{
 $Minutes = round($dist_remain / $xml->liveupdate->groundSpeed * 60);
 $time_remain = self::ConvertMinutes2Hours($Minutes);
}
else
{
 $time_remain = '00:00';
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...