Jump to content
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...
Posted

''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!

  • 3 months later...
Posted

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

Posted

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

  • Administrators
Posted

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
Posted

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
Posted

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

Posted

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

  • 3 weeks later...
Posted

[sOLVED]

Hi all

See the question about the zoom level of the map being too close in, but can see no answer of how to change it so the zoom is not so far in.

Gary

  • 1 month later...
Posted

what would interest me more is a country flag aliased to planes registrations

as above SP-* for Poland or I-* for Italy EI-* for Ireland guess that it will be do able with else if statements

  • 2 months later...
  • Administrators
Posted

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

Posted

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

  • Administrators
Posted

Without dissecting the module I really am shooting in the dark here. If I were you I would start by seeing if there is actually data in any of those variables you are pointing out. If not then work your way back to why there is not any.

Posted

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

Posted

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

Posted

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;
}
?>

Posted

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
  • 2 months later...
Posted

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

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