Jump to content

997R8V10

Members
  • Posts

    2
  • Joined

  • Last visited

Profile Information

  • Gender
    Male

997R8V10's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. I figured it out guys. How to make routes appear and all!!! Here's the code: In Destinations.tpl: function addMarker(lat, lng, icontype, info){ if(icontype == "default"){ var image = "<?php echo fileurl('lib/images/mapassets/airport_icon.png'); ?>"; }else if(icontype == "hub"){ var image = "<?php echo fileurl('lib/images/mapassets/hub_icon.png'); ?>"; } var marker = new google.maps.Marker({ position: CreateLatLngObject(lat, lng), map: map, icon: image }); // Add this code [b]google.maps.event.addListener(marker, 'click', function() { for (i=0; i<lines.length; i++) { lines[i].setMap(null); //or line[i].setVisible(false); } $.getJSON("<?php echo actionurl("Destinations/getAirportsByArpt"); ?>/" + info.icao, function (data) { $.each( data, function( key, val ) { var line = new google.maps.Polyline({ path: [CreateLatLngObject(lat, lng), new google.maps.LatLng(val.lat, val.lng)], strokeColor: "#FF0000", strokeOpacity: 1.0, strokeWeight: 2, geodesic: true }); line.setMap(map); lines.push(line); }); }); });[/b] [b]// END NEW CODE[/b] google.maps.event.addListener(marker, 'mouseover', function() { $("#info_icao").html(info.icao); $("#info_name").html(info.name); $("#info_country").html(info.country); }); myMarkers.push(marker); } Now in Destinations.php, you have to add this method: public function getAirportsByArpt($icao){ $sql = "SELECT b.* FROM phpvms_schedules as a LEFT JOIN phpvms_airports as b on b.icao=a.arricao WHERE a.depicao = '$icao' GROUP BY a.arricao"; echo json_encode(DB::get_results($sql)); } Note: you may have to replace phpvms with ur prefix for tables... Also: If you want to only show the airports that have routes connecting to them, modify the getAirports() method as follows: public function getAirports(){ $airports = DB::get_results("SELECT b.* FROM phpvms_schedules as a LEFT JOIN phpvms_airports as b on b.icao=a.depicao GROUP BY a.depicao"); echo json_encode($airports); } Have fun!
  2. Virtual Delta Aviation Group is an Airline Group looking at simulating real world SkyTeam operations. We use a custom type rating and booking system that makes sure that pilots know how to fly the aircraft. Our ranks aren't based on hours as we think that hours don't show a pilot's skill. We have over 30 different airlines with 5000+ aircraft. With 40000 routes to choose from, you'll never run out! The airline uses a SmartCars system to record flights. We also provide our users with Xacars for Xplane support. All users will start at the CRJ program and work their way up to 747s and A380s. If you love realism, this VA is for you. Have any questions? Contact staff@virtualda.org and our excellent staff will respond within 24 hours. We are also accepting staff positions .If you are interested in becoming a staff member, after signing up, proceed to the staff page and submit your application! We look forward to seeing you in the skies. Thanks for considering Virtual Delta Aviation Group Sign up at: www.virtualda.org
×
×
  • Create New...