There is a "person" icon which allows user to view "Street View". I don't want this functionality on my map, is there a way to remove it or disable it?
The answer is actually in the 2nd paragraph you linked to, but your code should look something like this:
var mapOptions = {
center: mapCenter,
zoom: 10,
streetViewControl: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
-
just noticed that disabling this control "after the fact" when the it's already been added to the map via
map.setOptions({streetViewControl: false});
removes the pegman control box in the upper left, but still ends up leaving the pegman on the map. – johntrepreneur May 3 '13 at 20:42 -
5If you want to HIDE the Street View control you need to place
streetViewControl
option beforemapTypeId
. Otherwise, you end up with the Street View control showing disabled. – kzfabi Jun 18 '13 at 12:54 -
2This URL contains all the properties you can modify here: developers.google.com/maps/documentation/javascript/… – Alexander Forbes-Reed May 11 '17 at 13:28
I'd like to add to the chosen answer and say that if you want to remove the zoom controls (plus-minus buttons) too, then change
streetViewControl: false,
with
disableDefaultUI: true,
It was more useful for a mobile touchscreen, since you can zoom in with two fingers.
-
streetViewControl: false -> It removes only street view and it works but for removing the zoom controls (plus-minus buttons) too, you answer not work by replacing streetViewControl: false, with disableDefaultUI: true, – VIKAS KOHLI Apr 2 '18 at 6:15
-
disableDefaultUI: true
is not necessary in order to remove only the street view button. – Eido95 Jun 4 '18 at 13:10 -
Yes it disables the whole ui aka streetview button+ zoom buttons etc. I'm using it on my app and it still works. I added this comment to give an extra info because when i searched for disabling the whole interface this page came up first. – perfectminimalist Jun 5 '18 at 14:09