出自百度地图API
| 核心类 | 基础类 | 控件类 | 覆盖物类 | 地图类型类 | 地图图层类 | 服务类 |
| Overlay | Marker | MarkerOptions | Icon |
| Polyline | PolylineOptions | InfoWindow |
构造函数
| 构造函数 | 描述 |
|---|---|
| Polyline(points:Array<Point>[, opts:PolylineOptions]) | 创建折线覆盖物对象 |
方法
| 方法 | 返回值 | 描述 |
|---|---|---|
| setPath(path:Array<Point>) | none | 设置折线的点数组 |
| getPath() | Array<Point> | 返回折线的点数组 |
| setStrokeColor(color:String) | none | 设置折线的颜色。 |
| getStrokeColor() | String | 返回折线的颜色。 |
| setStrokeOpacity(opacity:Number) | none | 设置透明度,取值范围0 - 1。 |
| getStrokeOpacity() | Number | 返回透明度。 |
| setStrokeWeight(weight:Number) | none | 设置线的宽度,范围为大于等于1的整数。 |
| getStrokeWeight() | Number | 返回线的宽度。 |
| setStrokeStyle(style:String) | none | 设置是为实线或虚线,solid或dashed。 |
| getStrokeStyle() | String | 返回当前线样式状态,实线或者虚线。 |
| getBounds() | Bounds | 返回覆盖物的地理区域范围。 |
| addEventListener(event:String, handler:Function) | none | 添加事件监听函数 |
| removeEventListener(event:String, handler:Function) | none | 移除事件监听函数 |
事件
| 事件 | 参数 | 描述 |
|---|---|---|
| click | event{type, target, point, pixel} | 点击折线后会触发此事件。 |
| dblclick | event{type, target, point, pixel} | 双击折线后会触发此事件。 |
| lineupdate | event{type, target} | 覆盖物的属性发生变化时触发。 |