There is an option on Google Maps disableDefaultUI set to false before loading google Maps.
function initMap(){
var mapVar = new google.maps.Map(document.getElementById('map'), {
zoom: 4,
center: {lat: -33, lng: 151},
disableDefaultUI: true
});
}
Is there any way to hide all the controls using my mapVar variable once the map is rendered?
Removing all controls from a google map - This question is about hiding the map on load.
There is a method to hide controls dynamically.
mapVar.setOptions({disableDefaultUI:true});
In case if we want to hide a single option mapVar.setOptions({zoomControl:false});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With