Jump to content

Map zoom not working


CFVA

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

Link to comment
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>

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