Is it possible to disable map controls by adding some variables to the Google Maps embed code?
-
Its in the documentation for the latest version https://developers.google.com/maps/documentation/javascript/controls#DisablingDefaults the first answer did not work for me with this version – Sep 01 '12 at 22:39
5 Answers
no you can't, but if you use the javascript api you can do this:
map = new google.maps.Map(document.getElementById("map_canvas"), {
panControl: false,
zoomControl: false,
scaleControl: false,
});
-
7It doesn't answer the question though. Although the simple answer to the question is basically *no*. If this answer was rephrased a bit to say 'no you can't, but if you use the javascript api you can do this' then it would be an acceptable answer. – Sam Murray-Sutton Nov 09 '12 at 13:39
-
1This answer is no longer relevant. As google implemented a new pricing model, embed and dynamic maps are more of a choice of business model than before, as embed map has unlimited uses while dynamic maps don't – Roberto Maldonado Aug 06 '18 at 02:09
This can be done in one step in V3: Add this to your mapOptions:
disableDefaultUI: true

- 7,003
- 15
- 60
- 97
That's the 8 stepts to can create a static map like this map of Berlin without controls: http://maps.googleapis.com/maps/api/staticmap?center=52.569916,13.408571&zoom=8&format=png&sensor=false&size=300x200&maptype=roadmap
Here the 8 steps
- Go to http://gmaps-samples-v3.googlecode.com/svn-history/r328/trunk/styledmaps/wizard/index.html
- Type in your address in the top right corner
- Now you can still style and zoom a bit
- Click on the "Static Map"
- Copy the Link,
- Paste it in the address bar
- Play around with the parameters (e.g. size)
- Instert the ready image on your page

- 565
- 5
- 4
It would seem that google has implemented a tiered pricing model for the maps that are using the api, embed maps have unlimited uses while dynamic maps don't. The selected accepted answer, while still accurate, is only valid if you are willing to setup a paid account. For map implementation with more control that won't cost as much (if anything) I recommend map-box.

- 51
- 2
I don't think you can disable map controls using the embedded code in a clean way.
You could make them disappear via css if you find the class or id if the controls.
This is not a good solution because in the feature the code might break.
The best solution is to make a custom map using the javascript api v3.

- 9,436
- 11
- 61
- 79