forked from SuperMap/iClient-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCircle.js
More file actions
63 lines (52 loc) · 2.02 KB
/
Copy pathCircle.js
File metadata and controls
63 lines (52 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
import {SuperMap} from '../../SuperMap';
import {ShapeParameters} from './ShapeParameters';
/**
* @class SuperMap.Feature.ShapeParameters.Circle
* @classdesc 圆形参数对象。
* @category Visualization Theme
* @extends {SuperMap.Feature.ShapeParameters}
*/
export class Circle extends ShapeParameters {
/**
* @function SuperMap.Feature.ShapeParameters.Circle.prototype.constructor
* @description 创建一个圆形参数对象。
* @param {number} x - 圆心 x 坐标,必设参数。
* @param {number} y - 圆心 y 坐标,必设参数。
* @param {number} r - 圆半径,必设参数。
* @returns {SuperMap.Feature.ShapeParameters.Circle} 圆形参数对象。
*/
constructor(x, y, r) {
super(x, y, r);
/**
* @member {number} SuperMap.Feature.ShapeParameters.Circle.prototype.x
* @description 圆心 x 坐标。
*/
this.x = !isNaN(x) ? x : 0;
/**
* @member {number} SuperMap.Feature.ShapeParameters.Circle.prototype.y
* @description 圆心 y 坐标。
*/
this.y = !isNaN(y) ? y : 0;
/**
* @member {number} SuperMap.Feature.ShapeParameters.Circle.prototype.r
* @description 圆半径。
*/
this.r = !isNaN(r) ? r : 0;
this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Circle";
}
/**
* @function SuperMap.Feature.ShapeParameters.Circle.prototype.destroy
* @description 销毁对象。
*/
destroy() {
this.x = null;
this.y = null;
this.r = null;
super.destroy();
}
}
SuperMap.Feature = SuperMap.Feature || {};
SuperMap.Feature.ShapeParameters.Circle = Circle;