此类表示地图上的一点,单位为像素。像素坐标的坐标原点为地图区域的左上角。

构造函数

  • 创建像素点对象实例

    参数类型说明
    xnumber水平像素坐标
    ynumber竖直像素坐标

    返回值 Pixel

    示例代码1

    const pixel = new BMap.Pixel(100, 200);
    

属性

x 坐标

y 坐标

方法

  • 判断坐标点是否相等,当且仅当两点的 x 坐标和 y 坐标均相等时返回 true

    参数类型说明
    otherPixel待比较的像素点

    返回值 boolean

    示例代码1

    const pixel = new BMap.Pixel(100, 200);
    const other = new BMap.Pixel(100, 200);
    const isEqual = pixel.equals(other); // true