getBounds() 获取可视区域边界 文档链接
let northwest = this.map.getBounds().getNorthWest() // 西北坐标
let eastsouth = this.map.getBounds().getSouthEast() // 东南坐标
let southWest = new AMap.LngLat(northwest.lng, northwest.lat)
let northEast = new AMap.LngLat(eastsouth.lng, eastsouth.lat)
// 创建Bounds获取围栏
let bounds = new AMap.Bounds(southWest, northEast)
// 创建围栏
let polygon = new AMap.Rectangle({
bounds: bounds
})
// 判断坐标是否在矩形上 polygon.contains() 返回true或false
polygon.contains(new AMap.LngLat(lng, lat)
备注
// 使用moveend事件刷新可视边界坐标
map.on('moveend', this.mapMoveend)