如何在 Google Maps JS API 中隐藏街道名称?

How can I hide street names in Google Maps JS API?

我想使用 JS API.

删除 Google 地图中各个地方(例如博物馆、餐馆和其他地点)的所有街道名称和图钉

基本上,我只需要一张没有标签的地图。

我想这应该是可能的。我怎样才能实现它?

这是我要删除的图片,以便更好地说明。

是的,您可以隐藏不需要在地图中显示的标签

<html>
  <body>
    <div id="map"></div>
    <script>
      var map;
      function initMap() {
        map = new google.maps.Map(document.getElementById('map'), {
          center: {lat: -33.86, lng: 151.209},
          zoom: 13,
          mapTypeControl: false
        });
          map.setOptions({styles: styles['hide']});
      }

      var styles = {
        hide: [
          {
            featureType: 'poi.business',
            stylers: [{visibility: 'off'}]
          },
          {
            featureType: 'transit',
            elementType: 'labels.icon',
            stylers: [{visibility: 'off'}]
          }
        ]
      };

    </script>
    <script async defer
    src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">
    </script>
    </script>  
</body>
</html>

您仍然可以对标签类型进行粒度控制,要了解有关所有样式的更多信息,请阅读此处:https://mapstyle.withgoogle.com/