From 7d06246d15ada376b3de6354eed51222bfc2e19b Mon Sep 17 00:00:00 2001 From: sakitam-fdd Date: Fri, 5 Jan 2018 18:42:34 +0800 Subject: [PATCH] # update --- src/geometry/Polygon/RectAngle.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/geometry/Polygon/RectAngle.js b/src/geometry/Polygon/RectAngle.js index f6f8faf..fe1cc3e 100644 --- a/src/geometry/Polygon/RectAngle.js +++ b/src/geometry/Polygon/RectAngle.js @@ -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 {