Jump to content

Map not visible


VIELMA16

Recommended Posts

Hello everybody!

 

I hope you are well. Could you help me?

 

I am trying to place the route map (CreazyCreatives) and another of the online flights out of the installation (phpVMS) and it is not possible that it appears visible. I've tried various things and I don't know what I'm doing wrong. I have the google map API KEY included.

 

Does anyone have a code to help solve this problem?

 

Thank you so much.

Link to comment
Share on other sites

  • 4 weeks later...
On 7/26/2021 at 8:26 PM, VIELMA16 said:

Well, doing a little research I was able to make the map visible but now when there is someone online it is not seen on the map.

 

https://ibb.co/0rnSnrc


You've changed to Leaflet?

You have to modify the scripts for displaying the whatever things you want at your map to Leaflet script too...



Regards

 

Link to comment
Share on other sites

1 hour ago, YusufBudi said:


You've changed to Leaflet?

You have to modify the scripts for displaying the whatever things you want at your map to Leaflet script too...



Regards

 

 

Hello Yusuf Budi!

 

I'm not sure about that but I don't know exactly what to modify because I'm afraid of damaging something.

 

I leave here the current code of that page, external to phpvms, where I intend to make the online flights visible. As I said before, I made the map visible but it doesn't work properly because no traffic is visible. So I ask for help from someone who has knowledge and who can help me with that.

 

 <!-- section content begin -->
 <div class="page-title-container">
	<nav aria-label="breadcrumb">
	  <ol class="breadcrumb">
	    <li class="breadcrumb-item active" aria-current="page">Home</li>
	    <li class="breadcrumb-item active" aria-current="page">Operations</li>
	    <li class="breadcrumb-item active" aria-current="page">Live Flights</li>
	  </ol>
	</nav>
  <div class="uk-section">
       <div class="section-headline text-center">
         <h2>Live Flights</h2>
         
<div class="uk-card uk-card-default uk-card-body">
<p><?php Template::Show('acarsmap.php'); ?> </p>

<div class="table-responsive">
        <table class="uk-table uk-table-striped">
         <thead>
        <tr>
            <th><center>FLIGHT STATUS</center></th>
            <th><center>AIRLINE</center></th>
            <th><center>FLIGHT</center></th>
            <th><center>DESTINATION</center></th>
            <th><center>ETE</center></th>
            <th><center>DISTANCE REMAINING</center></th>
            <th><center>REMARKS</center></th>
        </tr>
 </thead>
    <tbody>
	 <?php
$results = ACARSData::GetACARSData();
if(is_array ($results) || $results instanceof Countable) {	if (count($results) > 0)	{
	foreach($results as $flight)
	{

	 ?>
<tr>
<td><center><?php echo $flight->phasedetail; ?></center></td>
<td><center><?php $flightcode= SchedulesData::getProperFlightNum($flight->flightnum);?><img src="<?php echo SITE_URL?>/lib/images/logos/<?php echo $flightcode['code'];?>.png" alt="<?php echo $flight->flightnum;?>"/></center></td>
<td><center><?php echo $flight->flightnum; ?></center></td>
<td><center><?php echo $flight->arrname; ?></center></td>
<td><center><?php echo $flight->timeremaining; ?></center></td>
        <td><center><?php echo $flight->distremain ?> Nm.</center></td>
        <td><center><?php
		 $schedule = SchedulesData::getScheduleByFlight($flight->code,$flight->flightnum);
		 $fltime = explode(".", $schedule->flighttime);
		 $minstar = substr($fltime[1],0,1);
		 $minstarmin = substr($fltime[1],1,2);
		 $flmin = $minstar * 10;
		 $flhou = $fltime[0] * 60;
		 $flminu = $flhou + $flmin + $minstarmin;

		 $actfltime = explode(".", $pirep->flighttime);
		 $actminstar = substr($actfltime[1],0,1);
		 $actminstarmin = substr($actfltime[1],1,2);
		 $actflmin = $actminstar * 10;
		 $actflhou = $actfltime[0] * 60;
		 $actflminu = $actflhou + $actflmin + $actminstarmin;

		 if(($flminu - 20) > $actflminu) {
		 echo "<font color='#FF9900'><b>EARLY</b></font>";
		 } elseif (($flminu + 15) < $actflminu) {
		 echo "<font color='#FF0000'><b>DELAYED</b></font>";
		 } else {
		 echo "<font color='#008000'><b>ON TIME</b></font>"; }
		 ?></center></td> 
        </tr>
        <?php		
		 }
	} } else { ?>
	 <tr>
	 
	<div class="uk-alert-danger" uk-alert>
    <a class="uk-alert-close" uk-close></a>
    <p><strong> Oh No!</strong> Looks Like No Pilots Are Currently Flying.</p>
    </div>
	 </tr>
	 </tbody>
	<?php
	 }
	 ?>
</table>
</br>
</br>
</div>
</div>
</div>
</div>
</div>
<!-- End Latest Flights -->

 

Link to comment
Share on other sites

2 minutes ago, YusufBudi said:

Hola ..

Siento no haber sido claro antes.

Está en acarsmap.php, cambie el script a Leaflet.

¿Son los módulos CC payware?



Saludos

 

Do not worry! No, it is not a payware CC module. I simply wanted to create on the website  (external to phpVMS) a page with the online flights. But I ran into that problem.  This is my acarsmap.php code:

 

<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
/**
 * These are some options for the ACARS map, you can change here
 * 
 * By default, the zoom level and center are ignored, and the map 
 * will try to fit the all the flights in. If you want to manually set
 * the zoom level and center, set "autozoom" to false.
 */
?>

<div id="acarsmap" style="width: 100%; height: 500px; position: relative; overflow: hidden;"></div>

<script src="<?php echo SITE_URL?>/lib/js/base_map.js"></script>
<script src="<?php echo SITE_URL?>/lib/js/acarsmap.js"></script>
<?php
/* This is the template which is used in the table above, for each row. 
	Be careful modifying it. You can simply add/remove columns, combine 
	columns too. Keep each "section" (<%=...%>) intact
	
	Variables you can use (what they are is pretty obvious)
	
	Variable:							Notes:
	<%=flight.pilotid%>
	<%=flight.firstname%>
	<%=flight.lastname%>
	<%=flight.pilotname%>				First and last combined
	<%=flight.flightnum%>
	<%=flight.depapt%>					Gives the airport name
	<%=flight.depicao%>
	<%=flight.arrapt%>					Gives the airport name
	<%=flight.arricao%>
	<%=flight.phasedetail%>
	<%=flight.heading%>
	<%=flight.alt%>
	<%=flight.gs%>
	<%=flight.disremaining%>
	<%=flight.timeremaning%>
	<%=flight.aircraft%>				Gives the registration
	<%=flight.aircraftname%>			Gives the full name
	<%=flight.client%>					FSACARS/Xacars/FSFK, etc
	<%=flight.trclass%>					"even" or "odd"
	
	You can also use logic in the templating, if you so choose:
	http://ejohn.org/blog/javascript-micro-templating/
*/
?>
<script type="text/html" id="acars_map_row">
<tr class="<%=flight.trclass%>">
<td><a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotid%> - <%=flight.pilotname%></a></td>
<td><%=flight.flightnum%></td>
<td><%=flight.depicao%></td>
<td><%=flight.arricao%></td>
<td><%=flight.phasedetail%></td>
<td><%=flight.alt%></td>
<td><%=flight.gs%></td>
<td><%=flight.distremaining%> <?php echo Config::Get('UNITS');?> / <%=flight.timeremaining%></td>
</tr>
</script>

<?php
/*	This is the template for the little map bubble which pops up when you click on a flight
	Same principle as above, keep the <%=...%> tags intact. The same variables are available
	to use here as are available above.
*/
?>
<script type="text/html" id="acars_map_bubble">
<span style="font-size: 10px; text-align:left; width: 100%" align="left">
<a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotid%> - <%=flight.pilotname%></a><br />
<strong>Flight <%=flight.flightnum%></strong> (<%=flight.depicao%> to <%=flight.arricao%>)<br />
<strong>Status: </strong><%=flight.phasedetail%><br />
<strong>Dist/Time Remain: </strong><%=flight.distremaining%> <?php echo Config::Get('UNITS');?> / <%=flight.timeremaining%><br />
</span>
</script>

<?php
/*	This is a small template for information about a navpoint popup 
	
	Variables available:
	
	<%=nav.title%>
	<%=nav.name%>
	<%=nav.freq%>
	<%=nav.lat%>
	<%=nav.lng%>
	<%=nav.type%>	2=NDB 3=VOR 4=DME 5=FIX 6=TRACK
 */
?>
<script type="text/html" id="navpoint_bubble">
<span style="font-size: 10px; text-align:left; width: 100%" align="left">
<strong>Name: </strong><%=nav.title%> (<%=nav.name%>)<br />
<strong>Type: </strong>
<?php	/* Show the type of point */ ?>
<% if(nav.type == 2) { %> NDB <% } %>
<% if(nav.type == 3) { %> VOR <% } %>
<% if(nav.type == 4) { %> DME <% } %>
<% if(nav.type == 5) { %> FIX <% } %>
<% if(nav.type == 6) { %> TRACK <% } %>
<br />
<?php	/* Only show frequency if it's not a 0*/ ?>
<% if(nav.freq != 0) { %>
<strong>Frequency: </strong><%=nav.freq%>
<% } %>
</span>
</script>
<script type="text/javascript">
<?php 
/* These are the settings for the Google map. You can see the
	Google API reference if you want to add more options.
	
	There's two options I've added:
	
	autozoom: This will automatically center in on/zoom 
	  so all your current flights are visible. If false,
	  then the zoom and center you specify will be used instead
	  
	refreshTime: Time, in seconds * 1000 to refresh the map.
	  The default is 10000 (10 seconds)
*/
?>
const opts = {
	render_elem: 'acarsmap',
	provider: '<?php echo Config::Get("MAP_TYPE"); ?>',
	autozoom: true,
	zoom: <?php echo Config::Get('MAP_ZOOM_LEVEL'); ?>,
    center: L.latLng("<?php echo Config::Get('MAP_CENTER_LAT'); ?>", "<?php echo Config::Get('MAP_CENTER_LNG'); ?>"),
    refreshTime: 10000
};

renderAcarsMap(opts);
</script>

 

Link to comment
Share on other sites

On 26/7/2021 at 15:21, Strider said:

Puede usar un iframe, o deberá vincular la página externa al archivo local.config o similar para que funcione sin un iframe.

How do I get that? precisely that is another problem. I don't know what encoding to use or where to put it correctly.

 

Thank you Strider!

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