Google Maps V3: How to disable “street view”?

前端 未结 2 1911
小鲜肉
小鲜肉 2020-12-12 23:19

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 V

相关标签:
2条回答
  • 2020-12-12 23:45

    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
       };
    
    0 讨论(0)
  • 2020-12-13 00:03

    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.

    0 讨论(0)
提交回复
热议问题