我想删除蓝色道路标签.... 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);
答案 0 :(得分:2)
您应该可以通过执行以下代码来停用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复制到代码中即可。