我想删除蓝色道路标签。
Api v3怎么可能?

我用这个:

    var mapDiv = document.getElementById('map_canvas');
    var myOptions = {
        zoom: 11,
        center: new google.maps.LatLng(42.705,13.25),
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        mapTypeControl: true,
        zoomControl: true
    };
    map = new google.maps.Map(mapDiv, myOptions);


javascript - 如何在Google Maps Api v3中删除道路标签?-LMLPHP

最佳答案

通过执行以下代码,您应该能够在Google地图上禁用道路标签:

map.setOptions({
        styles: [
                {"featureType": "road.highway",elementType: "labels",stylers:[{visibility: "off"}]}, //turns off highway labels
                {"featureType": "road.arterial",elementType: "labels",stylers: [{visibility: "off"}]}, //turns off arterial roads labels
                {"featureType": "road.local",elementType: "labels",stylers: [{visibility: "off"}]}  //turns off local roads labels
         ]
});


有关详细信息,请参见Google Maps Styles Reference。另外,在使用地图样式时,此wizard可能会有所帮助,因为您只需将生成的JSON复制到代码中即可。

09-11 07:03