gio1961 Posted March 28, 2020 Report Posted March 28, 2020 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 Quote
CFVA Posted March 28, 2020 Author Report Posted March 28, 2020 I know the min & max can be set, but I want a fixed level, no zoom Quote
gio1961 Posted March 28, 2020 Report Posted March 28, 2020 <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> Quote
gio1961 Posted March 28, 2020 Report Posted March 28, 2020 (edited) 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 March 28, 2020 by gio1961 Quote
CFVA Posted March 28, 2020 Author Report Posted March 28, 2020 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 Quote
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.