125

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?

Street View

evilReiko
  • 19,501
  • 24
  • 86
  • 102

2 Answers2

283

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
   };
  • 1
    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 03 '13 at 20:42
  • 6
    If you want to HIDE the Street View control you need to place `streetViewControl` option before `mapTypeId`. Otherwise, you end up with the Street View control showing disabled. – kzfabi Jun 18 '13 at 12:54
  • 4
    This URL contains all the properties you can modify here: https://developers.google.com/maps/documentation/javascript/controls#Adding_Controls_to_the_Map – Alexander Forbes-Reed May 11 '17 at 13:28
11

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 02 '18 at 06:15
  • `disableDefaultUI: true` is not necessary in order to remove only the street view button. – Eido95 Jun 04 '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 05 '18 at 14:09
  • in React Google Maps: https://stackoverflow.com/a/54786236/2223106 add `streetViewControl: false` to the `options` param of the ` – MikeiLL Aug 31 '23 at 20:55