我需要在Google地图中添加“路况图层”。看来我无法获得流量层。请帮助,谢谢。
ngAfterContentInit(): void {
this.maps = new google.maps.Map (
this.mapElement.nativeElement,
{
center: { lat: 3.068352 , lng:101.602965 },
zoom: 14,
styles: [{
featureType: 'poi',
stylers: [{ visibility: 'on'}]
}, {
featureType: 'transit.station.bus',
stylers: [{ visibility: 'on'}]
}, {
featureType: 'transit.station.rail',
stylers: [{ visibility: 'on'}]
}],
}
this.maps.trafficLayer = new google.maps.trafficLayer(),
this.trafficLayer.setMap(this.maps);
);