Skip to content

YY. Polyline

覆盖物线,用来表示地图上的线,道路等 基于 YY. Overlay

creation

  • constructor(lnglats, [style].[pro], [conf])
    • lnglats {Array[Array||YY. LngLat]}经纬度数组
    • style {YY. Style} 样式
    • pro {Object} 附加属性值
    • conf {Object} 基本配置

events

example

demo

js
var polyline = new YY.Polyline([
    [120, 31],
    [120, 32],
    [120, 33],
]);

vectorLayer.addOverlay(polyline);

var polyline1 = new YY.Polyline(
    lnglats,
    YY.Style.formatLine({
        lineColor: "red"
    }), {
        // altitude : 400
    }
);
vectorLayer.addOverlay(polyline1);

method

getLngLats()

setLngLats(lnglats)

  • 设置经纬度
  • 参数
  • 返回值: this

animateShow(options, step)

  • 动态显示线
  • 参数
    • {Object} options: 动画配置
    • {function} step: 回调函数
  • 返回值: this

其他方法参考

YY. Overlay

This document is generated by vitepress and Edit by deyihu