Jump to content

vFleetTracker_v1.3


Kyle
Message added by Kyle

WARNING: This module is no longer supported from the developer as the developer is shifting their focus on phpVMS v4 Addons.

Recommended Posts

  • 1 month later...

''Warning: Invalid argument supplied for foreach() in /home//public_html/core/templates/vFleetTrack/map.tpl on line 16''

foreach($data as $l)

And

''Warning: Invalid argument supplied for foreach() in /home//public_html/core/templates/vFleetTrack/view.tpl on line 125''

foreach($pirep_list as $pirep)

any idea? Thanks!

Link to comment
Share on other sites

  • 3 months later...

''Warning: Invalid argument supplied for foreach() in /home//public_html/core/templates/vFleetTrack/map.tpl on line 16''

foreach($data as $l)

And

''Warning: Invalid argument supplied for foreach() in /home//public_html/core/templates/vFleetTrack/view.tpl on line 125''

foreach($pirep_list as $pirep)

any idea? Thanks!

Hi.

im with the same problem..

Anybody know how to issue?

Tnks a lot.

Hudson

Link to comment
Share on other sites

Are there any enabled aircraft or completed PIREPS in the database?

SimPilot, tnks for attencion.

In my case, i had only first problem, in the map.tpl on line 16 in the site, and in the line 20 in DW.

I have 2 aircrafts in database and 2 logs from 1 aircraft.

I need to do more flights?

Tnks a lot!

Hudson

Link to comment
Share on other sites

  • Administrators

If you have data in the database it looks like it should work. It is not my code so I would be guessing past anything other than if there is data for the module to calculate. Maybe try using var_dump on the incoming data variables and see what if anything is there.

  • Like 1
Link to comment
Share on other sites

Try changing:

foreach($data as $l)

to

if($data)
foreach($data as $l)

and

foreach($pirep_list as $pirep)

to

if($pirep_list)
foreach($pirep_list as $pirep)

I think Vansers just forgot to add it since probably when he wrote the module he had already done some flights with the aircraft and therefore didnt get the error.

  • Like 1
Link to comment
Share on other sites

Try changing:

foreach($data as $l)

to

if($data)
foreach($data as $l)

and

foreach($pirep_list as $pirep)

to

if($pirep_list)
foreach($pirep_list as $pirep)

I think Vansers just forgot to add it since probably when he wrote the module he had already done some flights with the aircraft and therefore didnt get the error.

mseiwald

Tnks a lot man, worked very well!

But, idk why, the "pin" that show where the is, dont appear.

I will try do the changes in last pages to see if work it.

Again, tkns very much!

Hudson

Link to comment
Share on other sites

Hi again.

I tried to do something to appear the "pin" point in the map, but i cant.

I have noticed that my map tpl is here: lib/skin/ocean blue/fly tracker/map.tpl

Is in the correct place?

The point showing where the plane is, dont appear, only information bellow the map.

Someone can help me?

Tnks a lot!

Hudson

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
  • 2 months later...

Hi Again.

Im trying to instal this fantastic module im my Va's site, but i cant.

In the principal page appears the map and the planes information, but dont appear in the map plane locations. When i enter in the plane's information, appear in the map the location.

Someone can help me?

Here is my Website.

http://voeglobal.besaba.com/index.php/vFleetTracker/

Thanks.

Hudson

Link to comment
Share on other sites

  • Administrators

I do not know much about this module but is your live map working at all? Looking at both your live map page and the page you have linked both have a js error showing that possibly may be a conflict between the map script and the header slide show script, or the fact that the slide show needs a different version of jquery.

Timestamp: 11/23/2014 7:18:49 PM

Warning: Use of getPreventDefault() is deprecated. Use defaultPrevented instead.

Source File: http://ajax.googleap...3/jquery.min.js

Line: 2

Link to comment
Share on other sites

Thanks for u attention Sim.

So, the live map in the home page, works good, showing the flight in real time.

The second map in the flight tracker, is to show where is the plane, but dont show. If you click in the "view details" you will see the plane location on the third map in this page...

If i open the Map.tpl here, is this problem on line 21:

var pointer_<?php echo $count;?> = new google.maps.LatLng(<?php echo $l->arrlat?>, <?php echo $l->arrlng?>);

I dont know why occours it.

Thanks for help me.

Hudson

Link to comment
Share on other sites

Thanks for u attention Sim.

So, the live map in the home page, works good, showing the flight in real time.

The second map in the flight tracker, is to show where is the plane, but dont show. If you click in the "view details" you will see the plane location on the third map in this page...

If i open the Map.tpl here, is this problem on line 21:

var pointer_<?php echo $count;?> = new google.maps.LatLng(<?php echo $l->arrlat?>, <?php echo $l->arrlng?>);

I dont know why occours it.

Thanks for help me.

Hudson

Can you paste here your code from map.tpl because You can see here in your gcmap missing the latest flight

http://voeglobal.bes...cker/view/PPGLA

/lib/skins/yourkins/vFleetTracker

or

/core/templates/vFleetTracker

Link to comment
Share on other sites

Hi FSX30HD, thanks for your attention.

Here is my map.tpl code from core/template/vfleet ok?

<div class="mapcenter" align="center">
<div id="routemap" style="width: 960px; height: 520px;"></div>
</div>

<script type="text/javascript">
var options = {
zoom: 4,
center: new google.maps.LatLng(<?php echo Config::Get('MAP_CENTER_LAT'); ?>, <?php echo Config::Get('MAP_CENTER_LNG'); ?>),
mapTypeId: google.maps.MapTypeId.ROADMAP,
}
var map = new google.maps.Map(document.getElementById("routemap"), options);
</script>

<?php
$count = 1;
if($data)
foreach($data as $l)
{
?>
<script type="text/javascript">
var pointer_<?php echo $count;?> = new google.maps.LatLng(<?php echo $l->arrlat?>, <?php echo $l->arrlng?>);
var point_<?php echo $count;?> = new google.maps.Marker({
position: pointer_<?php echo $count;?>,
map: map,
title: "<?php echo "$l->acregistration is at $l->arrname ($l->arricao)";?>",
});
var contentString = '<?php echo $l->acname;?> (<?php echo $l->acregistration;?>) is at <?php echo $l->arrname.'('.$l->arricao.')';?>';
var infowindow_<?php echo $count;?> = new google.maps.InfoWindow({
content: contentString
});
google.maps.event.addListener(point_<?php echo $count;?>, 'click', function() {
infowindow_<?php echo $count;?>.open(map,point_<?php echo $count;?>);
});
</script>
<?php
$count = 1 + $count;
}
?>

There is an error in the line 21, idk why.

Thnaks again.

Hudson

Link to comment
Share on other sites

Can you edit please your message and use "code balise" it's more clear to read for us.

Original code is :

<?php
$count = 0;
foreach($data as $l)
{
?>

your:

<?php
$count = 1;
if($data)
foreach($data as $l)
{
?>

Try this:

<script type="text/javascript">
var options = {
zoom: 4,
center: new google.maps.LatLng(<?php echo Config::Get('MAP_CENTER_LAT'); ?>, <?php echo Config::Get('MAP_CENTER_LNG'); ?>),
mapTypeId: google.maps.MapTypeId.ROADMAP,
}
var map = new google.maps.Map(document.getElementById("routemap"), options);
</script>
<?php
$count = 0;
//if(!$data)
foreach($data as $l)
{
?>
<script type="text/javascript">
var pointer_<?php echo $count;?> = new google.maps.LatLng(<?php echo $l->arrlat?>, <?php echo $l->arrlng?>);
var point_<?php echo $count;?> = new google.maps.Marker({
position: pointer_<?php echo $count;?>,
map: map,
title: "<?php echo "$l->acregistration is at $l->arrname ($l->arricao)";?>",
});
var contentString = '<?php echo $l->acname;?> (<?php echo $l->acregistration;?>) is at <?php echo $l->arrname.'('.$l->arricao.')';?>';
var infowindow_<?php echo $count;?> = new google.maps.InfoWindow({
content: contentString
});
google.maps.event.addListener(point_<?php echo $count;?>, 'click', function() {
infowindow_<?php echo $count;?>.open(map,point_<?php echo $count;?>);
});
</script>
<?php
$count = 1 + $count;
}
?>

Link to comment
Share on other sites

Works now:

<?php
$count = 0;
//if(!$data)
foreach($data as $l)
{
if (!$l->arrlat || !$l->arrlng || $l->arrlat == '' || $l->arrlng == '')
{
	 continue;
	 }
?>

Change:

<script type="text/javascript">
var pointer_<?php echo $count;?> = new google.maps.LatLng(<?php echo $l->arrlat?>, <?php echo $l->arrlng?>);
var point_<?php echo $count;?> = new google.maps.Marker({
position: pointer_<?php echo $count;?>,
map: map,
title: "<?php echo "$l->acregistration is at $l->arrname ($l->arricao)";?>",
});
var contentString = '<?php echo $l->acname;?> (<?php echo $l->acregistration;?>) is at <?php echo $l->arrname.'('.$l->arricao.')';?>';
var infowindow_<?php echo $count;?> = new google.maps.InfoWindow({
content: contentString
});
google.maps.event.addListener(point_<?php echo $count;?>, 'click', function() {
infowindow_<?php echo $count;?>.open(map,point_<?php echo $count;?>);
});
</script>

by:

<script type="text/javascript">
var pointer_<?php echo $count;?> = new google.maps.LatLng(<?php echo $l->arrlat?>, <?php echo $l->arrlng?>);
var point_<?php echo $count;?> = new google.maps.Marker({
position: pointer_<?php echo $count;?>,
map: map,
title: "<?php echo "$l->acregistration is at $l->arrname ($l->arricao)";?>",
});
var contentString = "<?php echo $l->acname;?> (<?php echo $l->acregistration;?>) is at <?php echo $l->arrname.'('.$l->arricao.')';?>";
var infowindow_<?php echo $count;?> = new google.maps.InfoWindow({
content: contentString
});
google.maps.event.addListener(point_<?php echo $count;?>, 'click', function() {
infowindow_<?php echo $count;?>.open(map,point_<?php echo $count;?>);
});
</script>

I have make the changes in your website

Best Regards

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

I'm having an issue with this addon and php5.5+, I hope it is just something I overlooked. The module is working, but I get this Warning: Invalid argument supplied for foreach() in /home4/jroggjr/public_html/core/templates/vFleetTrack/map.php on line 16. I had this working with an older version of php, and when I reinstalled it I used the php version for 5.5. Any suggestions? I haven't made any changes to the stock files. I have attached a copy of the map.php file

map.php

Link to comment
Share on other sites

  • 1 month later...

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...