Here is the snippet I am using to display Google map on my app using their V3 Javascript API.
var myOptions = { zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
But the map shows terrain, hybrid and satellite which I don't want. How do I remove those controls from the map.
You can delete the markers by removing them from the map and then setting the array's length to 0 , which removes all references to the markers.
You can remove all the default UI
var mapOptions = { zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI: true }; var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
And then you can add your own controls
Or you can just add mapTypeControl: false
The Google Maps v3 API doc is great.
In it, you'll find that MapOptions have a property, "mapTypeControl", which is a boolean. Set it to false
to disable it for your map.
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