Ionic 4 Google Map设置流量图层

时间:2019-05-25 15:25:20

标签: google-maps ionic-framework ionic4

我需要在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);

);

0 个答案:

没有答案