smokey68 Posted November 26, 2017 Report Share Posted November 26, 2017 (edited) Anyone know how to place the hub markers in your airline on the acars map ? Edited November 26, 2017 by vbegin7 Quote Link to comment Share on other sites More sharing options...
smokey68 Posted November 28, 2017 Author Report Share Posted November 28, 2017 bump Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted November 29, 2017 Moderators Report Share Posted November 29, 2017 It can be done. You should edit the lib/js/acarsmap.js file of your phpVMS system. Also, a good start would be to use the OperationsData::getAllHubs() function. It already exists within your phpVMS system. Develop a php foreach using the data returned from that function and add the hub marker within the foreach. Use it as a start and let us know if you get stuck anywhere. Quote Link to comment Share on other sites More sharing options...
smokey68 Posted November 29, 2017 Author Report Share Posted November 29, 2017 thanks Quote Link to comment Share on other sites More sharing options...
smokey68 Posted November 29, 2017 Author Report Share Posted November 29, 2017 13 hours ago, servetas said: It can be done. You should edit the lib/js/acarsmap.js file of your phpVMS system. Also, a good start would be to use the OperationsData::getAllHubs() function. It already exists within your phpVMS system. Develop a php foreach using the data returned from that function and add the hub marker within the foreach. Use it as a start and let us know if you get stuck anywhere. <?php foreach $OperationsData::getAllHubs() { var myLatLng = {lat: $hub->deplat, lng: $hub->deplng }; var map = new google.maps.Map(document.getElementById('map'), { zoom: 4, center: myLatLng }); var marker = new google.maps.Marker({ position: myLatLng, map: map, title: 'Airport ID' }); }?> Does this look right ? Quote Link to comment Share on other sites More sharing options...
web541 Posted November 30, 2017 Report Share Posted November 30, 2017 Try this <script type="text/javascript"> <?php $allhubs = OperationsData::getAllHubs(); foreach($allhubs as $hub) { ?> var hubLatLng = {lat: <?php echo $hub->lat; ?>, lng: <?php echo $hub->lng; ?> }; var marker = new google.maps.Marker({ position: hubLatLng, map: map, title: "<?php echo $hub->icao; ?>" + " - " + "<?php echo $hub->name; ?>" }); <?php } ?> </script> Put it in acarsmap.php at the very end of the file. You can't mix javascript and PHP like you have done as it will fail to work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.