Skip to content

YY. Envelope ​

经纬度范围对象,用来表示经纬度的范围,一般有最小经纬度和最大经纬度组成

creation ​

  • constructor(xmin, ymin, xmax, ymax)
js
var envelope = new YY.Envelope(111, 21, 122, 31);

properties ​

  • {float} envelope.xmin
  • {float} envelope.ymin
  • {float} envelope.xmax
  • {float} envelope.ymax

method ​

clone() ​

getCenter() ​

contains(lnglat) ​

  • 是否包含所给的经纬度
  • 参数
  • 返回值: Boolean
js
   var bounds = new YY.Envelope(119.89, 30.75, 121.406, 32.08);
   var lnglat = new YY.LngLats(120.58145945513407, 30.982805902204685]);
   console.log(bounds.contains(lnglat));

multiplyBy(num=1) ​

  • 将范围扩大对应的倍数
  • 参数
    • {Number} num:
  • 返回值: YY. Envelope

divideBy(num=1) ​

  • 将范围缩小对应的倍数
  • 参数
    • {Number} num:
  • 返回值: YY. Envelope

getSouthWest() ​

getMin() ​

  • 获取最小点,等同于西南点的坐标
  • 返回值: YY. LngLat

getNorthEast() ​

getMax() ​

  • 获取最大点的坐标,等同于东北点的坐标
  • 返回值: YY. LngLat

getNorthWest() ​

getSouthEast() ​

toLine() ​

toPolygon() ​

toLngLats() ​

  • 将范围转为经纬度的坐标数组
  • 返回值: Array

toArray() ​

  • 将范围转为经纬度的坐标数组
  • 返回值: Array

toString() ​

  • 序列化字符串
  • 返回值: String

This document is generated by vitepress and Edit by deyihu