Disable map controls in Google Maps

Can I turn off map controls by adding some variables to the Google Maps embed code?

+6
source share
4 answers

no, you cannot , 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, }); 
+7
source

This can be done in one step in V3: Add this to your map. Options:

disableDefaultUI: true

+6
source

So that 8 stepts 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 are 8 steps

+4
source

I don’t think you can turn off the map controls with the built-in code in its purest form.
You can make them disappear through css if you find a class or identifier if controls.
This is not a good solution, because the code may break in the function.

The best solution is to create a custom map using javascript api v3 .

-3
source

Source: https://habr.com/ru/post/899747/


All Articles