mirror of
https://github.com/sakitam-fdd/maptalks.plot.git
synced 2026-01-18 16:03:28 +00:00
# update
This commit is contained in:
parent
dfb6671973
commit
7d06246d15
@ -11,6 +11,7 @@ class RectAngle extends maptalks.Polygon {
|
||||
super(options)
|
||||
this.type = 'RectAngle'
|
||||
this._coordinates = []
|
||||
this._points = [] // 控制点
|
||||
if (coordinates) {
|
||||
this.setPoints(coordinates)
|
||||
}
|
||||
@ -29,8 +30,8 @@ class RectAngle extends maptalks.Polygon {
|
||||
* @private
|
||||
*/
|
||||
_generate () {
|
||||
const count = this._coordinates.length
|
||||
let _points = Coordinate.toNumberArrays(this._coordinates)
|
||||
const count = this._points.length
|
||||
let _points = Coordinate.toNumberArrays(this._points)
|
||||
if (count < 2) return
|
||||
if (count === 2) {
|
||||
let start = _points[0]
|
||||
@ -45,12 +46,20 @@ class RectAngle extends maptalks.Polygon {
|
||||
}
|
||||
|
||||
setPoints (coordinates) {
|
||||
this._coordinates = !coordinates ? [] : coordinates
|
||||
if (this._coordinates.length >= 1) {
|
||||
this._points = !coordinates ? [] : coordinates
|
||||
if (this._points.length >= 1) {
|
||||
this._generate()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取控制点
|
||||
* @returns {Array|*}
|
||||
*/
|
||||
getPoints () {
|
||||
return this._points
|
||||
}
|
||||
|
||||
_exportGeoJSONGeometry () {
|
||||
const coordinates = Coordinate.toNumberArrays([this.getShell()])
|
||||
return {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user