Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing all controls from a google map

Tags:

I am trying to remove all the controls (zoom, map type drop down, and street view) from my map.

There's a method

map.removeControl(GControl) 

but I haven't been able to successfully remove any default ones that I hadn't added myself.

Any tips on remove/clearing all controls from the map?

like image 672
Atticus Avatar asked Jun 10 '11 06:06

Atticus


People also ask

How do I hide the controls on Google Maps?

Google Maps - Turn On All Controls Adding or removing controls from the map is specified in the Map options object. Set the control to true to make it visible - Set the control to false to hide it.

How do I remove all markers from maps?

You remove markers by using set_map(null) on the particular marker you want to clear, if you want to clear all then loop through using this function.

Can you remove all labels from Google Maps?

Hover your cursor over the box and wait until more options appear. Click “More” to open the Map Details menu. Under “Map Type,” you'll see a checked box next to “Labels.” Uncheck it to remove all labels.

How do I remove a GUI from Google Maps?

Disabling the UI Default Controls We can disable the default UI controls provided by Google Maps simply by making the disableDefaultUI value true in the map options.


1 Answers

Have you tried this:

http://code.google.com/apis/maps/documentation/javascript/controls.html#DisablingDefaults

function initialize() {   var myOptions = {     zoom: 4,     center: new google.maps.LatLng(-33, 151),     disableDefaultUI: true,     mapTypeId: google.maps.MapTypeId.ROADMAP     }   var map = new google.maps.Map(document.getElementById("map_canvas"),        myOptions); } 
like image 161
corroded Avatar answered Sep 29 '22 22:09

corroded