Skip to content

YY. Point

点覆盖物,用来标注地图上的一个点, 一般用图标进行标注, 基于 YY. Overlay

creation

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

events

example

demo

js
var point = new YY.Point([120, 31]);

vectorLayer.addOverlay(point); //将点添加到图层上

var point1 = new YY.Point(
    lnglat,
    YY.Style.formatImage({
        markerFile: "../assets/icons/5.png",
    }), {
        // altitude : 400
    }, {
        draggable: false
    }
);
vectorLayer.addOverlay(point1);

method

getLngLat()

setLngLat(lnglat)

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

其他方法参考

YY. Overlay

This document is generated by vitepress and Edit by deyihu