mirror of
https://github.com/sakitam-fdd/maptalks.plot.git
synced 2025-12-08 20:35:49 +00:00
# update
This commit is contained in:
parent
7d06246d15
commit
f6cb994d56
@ -11,6 +11,7 @@ class PlotPolygon extends maptalks.Polygon {
|
||||
super(options)
|
||||
this.type = 'PlotPolygon'
|
||||
this._coordinates = []
|
||||
this._points = []
|
||||
if (coordinates) {
|
||||
this.setPoints(coordinates)
|
||||
}
|
||||
@ -29,7 +30,7 @@ class PlotPolygon extends maptalks.Polygon {
|
||||
* @private
|
||||
*/
|
||||
_generate () {
|
||||
this.setCoordinates(this._coordinates)
|
||||
this.setCoordinates(this._points)
|
||||
}
|
||||
|
||||
getCoordinates () {
|
||||
@ -37,12 +38,20 @@ class PlotPolygon 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