CFVA Posted February 23, 2020 Report Share Posted February 23, 2020 Hi All I'm trying to get the map zoom in the view.php template to be a wider zoom! I've tried many setting for zoom under the Current Aircraft Location (this is the map for the individual aircraft, not the fleet, thats changes when zoom level is changed in map.php) Current code is: <h3>Current Aircraft Location</h3> <?php $location = vFleetTrackData::getLastFlightAircraft($aircraft->id); if($location) { $airport = OperationsData::getAirportInfo($location->arricao); ?> <div class="mapcenter" align="center"> <div id="currentlocation" style="width: 960px; height: 520px;"></div> </div> <script type="text/javascript"> var options = { autozoom: false, zoom: 5, mapTypeId: google.maps.MapTypeId.HYBRID } var map = new google.maps.Map(document.getElementById("currentlocation"), options); var flightMarkers = []; current_location = new google.maps.LatLng(<?php echo $airport->lat?>, <?php echo $airport->lng?>); flightMarkers[flightMarkers.length] = new google.maps.Marker({ position: current_location, map: map, title: "<?php echo "$airport->name ($airport->icao)";?>" }); if(flightMarkers.length > 0) { var bounds = new google.maps.LatLngBounds(); for(var i = 0; i < flightMarkers.length; i++) { bounds.extend(flightMarkers.position); } } map.fitBounds(bounds); </script> 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.