Jump to content
CFVA

Map zoom not working

Recommended Posts

you can change even the minimum .. ex. 2,3,4,5,6, etc. etc.

 

<script type="text/javascript">
var options = {

	mapTypeId: google.maps.MapTypeId.SATELLITE
}

var map = new google.maps.Map(document.getElementById("currentlocation"), options);
var flightMarkers = [];
map.setOptions({ minZoom: 4, maxZoom: 17 });
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[i].position);
		map.fitBounds(bounds); 
	}
}

</script>

 file view.php

Share this post


Link to post
Share on other sites

<script type="text/javascript">
var options = {
    disableDefaultUI :true,

    mapTypeId: google.maps.MapTypeId.SATELLITE
}

var map = new google.maps.Map(document.getElementById("currentlocation"), options);
var flightMarkers = [];
map.setOptions({ minZoom: 4, maxZoom: 15 });
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>

Share this post


Link to post
Share on other sites

However the map, without this last code (eliminates the zoon buttons+/-) was set to the desired max zoom

 

 

P.S. I see that you still have the old codes, both the map in the home and the live do not work ...

Edited by gio1961

Share this post


Link to post
Share on other sites

I'm now totally confused with all this. The frontpage map and the live acars map DO work!

 

I think I will leave it as it is, it's not a big problem

 

Thanks for the help

 

Share this post


Link to post
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...