显示某个区域的拥堵情况,支持多个城市、多个区域 注意:数据接口需要联系我们申请

const traffic = new AMapTraffic({
viewer: viewer,
adCodes: ['110000'],
areas: [],
clientKey: 'your client key',
clientSecret: 'your client secret',
time: new Date().getTime(),
style: {
slightColor: '#ffff00',
slightWidth: 5,
severeWidth: 5,
severeColor: '#ff0000'
}
});

Hierarchy

  • Event
    • AMapTraffic

Constructors

Methods

  • 销毁实例

    Returns void

  • 获取拥堵图层中所有的线实例

    Returns {
        severe: undefined | GroundPrimitive;
        slight: undefined | GroundPrimitive;
    }

    • severe: undefined | GroundPrimitive
    • slight: undefined | GroundPrimitive
  • 隐藏拥堵图层

    Returns void

  • 显示拥堵图层

    Returns void

  • Returns void