Jump to content

vFleetTracker map problem


CFVA

Recommended Posts

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>
 

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