tôi nhận được một giải pháp tốt hơn:
Tạo tệp html và chèn mã bên dưới.
<!DOCTYPE html>
<html>
<head>
<title>Mapa GMR Norte</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
function initMap() {
var customMapType = new google.maps.StyledMapType([
{
elementType: 'labels',
stylers: [{visibility: 'off'}]
}
], {
name: 'Custom Style'
});
var customMapTypeId = 'custom_style';
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 13,
center: {lat: 41.4416459, lng: -8.2911885}, // Brooklyn.
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP, customMapTypeId]
}
});
map.mapTypes.set(customMapTypeId, customMapType);
map.setMapTypeId(customMapTypeId);
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?signed_in=true&callback=initMap"
async defer></script>
</body>
</html>
Hy vọng điều đó sẽ hữu ích! :)
Nguồn
2015-08-26 17:10:03
Các giải pháp này hoạt động cho 'lộ trình' và cho 'vệ tinh'. Tôi đang cố gắng để có được một StreetView mà không có tên đường phố. Tôi đã đọc tài liệu API nhưng không thể tìm thấy cách xóa nhãn trên chế độ xem phố. Bất kì manh mối nào? –