Skip to content

Commit ae18b01

Browse files
author
caoxinke
committed
根据jsdoc尝试完善部分注释 commit by tangqin review by caoxinke
1 parent a05a72c commit ae18b01

File tree

121 files changed

+4112
-3108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+4112
-3108
lines changed

src/common/control/TimeControlBase.js

Lines changed: 115 additions & 139 deletions
Large diffs are not rendered by default.

src/common/control/TimeFlowControl.js

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,41 @@
1-
/**
2-
* Class: SuperMap.TimeControl
3-
* 时间管理类。
4-
*
5-
* 此类只负责时间上的控制,具体执行的操作需要用户在初始化时的回调函数内部进行实现。
6-
*
7-
* 如设置起始时间为1000,结束时间是2000,步长设置为1,
8-
* 那么表示按照每次1年(可以通过setSpeed进行修改)的变化从公元1000年开始到公元2000年为止,默认每1秒会1次(通过setFrequency修改)
9-
*/
101
require('./TimeControlBase');
112
var SuperMap = require('../SuperMap');
3+
4+
/**
5+
* @class SuperMap.TimeControl
6+
* @description 时间管理类。<br>
7+
* 此类只负责时间上的控制,具体执行的操作需要用户在初始化时的回调函数内部进行实现。<br>
8+
* 如设置起始时间为1000,结束时间是2000,步长设置为1,
9+
* 那么表示按照每次1年(可以通过setSpeed进行修改)的变化从公元1000年开始到公元2000年为止,默认每1秒会1次(通过setFrequency修改)
10+
* @augments SuperMap.TimeControlBase
11+
* @param callback - {Function} 每次刷新回调函数,必设属性。具体的效果需要用户在此回调函数里面实现。
12+
* @param options - {Object} 该类开放的可选属性。如:<br>
13+
* speed - {Number} 步长(单位ms)。不能小于0,默认为1(表示每次刷新的数据之间的间隔为1ms)。<br>
14+
* frequency - {Number} 刷新频率(单位ms),默认为1000ms。<br>
15+
* startTime - {Number} 起始时间,必须为数字,且小于等于endTime。如果不设置,初始化时为0,建议设置。<br>
16+
* endTime - {Number} 结束时间,必须为数字,且大于等于startTime。如果不设置,初始化时以当前时间进行设置,建议设置。<br>
17+
* repeat - {Boolean} 是否重复循环。默认为true。<br>
18+
* reverse - {Boolean} 是否反向。默认为false。
19+
*/
1220
SuperMap.TimeFlowControl = SuperMap.Class(SuperMap.TimeControlBase, {
21+
1322
/**
14-
* Property: callback
15-
* {Function} 每次刷新执行的回调函数
23+
* @member callback -{Function}
24+
* @description 每次刷新执行的回调函数
1625
*/
1726
callback: null,
1827

19-
/**
20-
* Parameters:
21-
* callback - {Function} 每次刷新回调函数,必设属性。具体的效果需要用户在此回调函数里面实现。
22-
* options - {Object} 该类开放的可选属性。
23-
*
24-
* Allowed options properties:
25-
* speed - {Number} 步长(单位ms)。不能小于0,默认为1(表示每次刷新的数据之间的间隔为1ms)
26-
* frequency - {Number} 刷新频率(单位ms),默认为1000ms。
27-
* startTime - {Number} 起始时间,必须为数字,且小于等于endTime。如果不设置,初始化时为0,建议设置。
28-
* endTime - {Number} 结束时间,必须为数字,且大于等于startTime。如果不设置,初始化时以当前时间进行设置,建议设置。
29-
* repeat - {Boolean} 是否重复循环。默认为true。
30-
* reverse - {Boolean} 是否反向。默认为false。
28+
/*
29+
* @function SuperMap.TimeControl.prototype.initialize
30+
* @description 时间管理类的构造函数。
31+
* @param callback - {Function} 每次刷新回调函数,必设属性。具体的效果需要用户在此回调函数里面实现。
32+
* @param options - {Object} 该类开放的可选属性。如:<br>
33+
* speed - {Number} 步长(单位ms)。不能小于0,默认为1(表示每次刷新的数据之间的间隔为1ms)。<br>
34+
* frequency - {Number} 刷新频率(单位ms),默认为1000ms。<br>
35+
* startTime - {Number} 起始时间,必须为数字,且小于等于endTime。如果不设置,初始化时为0,建议设置。<br>
36+
* endTime - {Number} 结束时间,必须为数字,且大于等于startTime。如果不设置,初始化时以当前时间进行设置,建议设置。<br>
37+
* repeat - {Boolean} 是否重复循环。默认为true。<br>
38+
* reverse - {Boolean} 是否反向。默认为false。
3139
*/
3240
initialize: function (callback, options) {
3341
var me = this;
@@ -63,14 +71,16 @@ SuperMap.TimeFlowControl = SuperMap.Class(SuperMap.TimeControlBase, {
6371
me.callback = callback;
6472
},
6573

74+
/**
75+
* @inheritDoc
76+
*/
6677
updateOptions: function (options) {
6778
options = options || {};
6879
SuperMap.TimeControlBase.prototype.updateOptions.call(this, options);
6980
},
7081

7182
/**
72-
* APIMethod: start
73-
* 开始
83+
* @inheritDoc
7484
*/
7585
start: function () {
7686
var me = this;
@@ -93,8 +103,7 @@ SuperMap.TimeFlowControl = SuperMap.Class(SuperMap.TimeControlBase, {
93103
},
94104

95105
/**
96-
* APIMethod: stop
97-
* 停止,停止后返回起始状态
106+
* @inheritDoc
98107
*/
99108
stop: function () {
100109
SuperMap.TimeControlBase.prototype.stop.call(this);
@@ -109,8 +118,7 @@ SuperMap.TimeFlowControl = SuperMap.Class(SuperMap.TimeControlBase, {
109118
},
110119

111120
/**
112-
* APIMethod: destroy
113-
* 销毁TimeControl对象,释放资源。
121+
* @inheritDoc
114122
*/
115123
destroy: function () {
116124
SuperMap.TimeControlBase.prototype.destroy.call(this);
@@ -121,8 +129,8 @@ SuperMap.TimeFlowControl = SuperMap.Class(SuperMap.TimeControlBase, {
121129

122130

123131
/**
124-
* Method: tick
125-
* 定时刷新
132+
* @function SuperMap.TimeControl.prototype.tick
133+
* @description 定时刷新
126134
*/
127135
tick: function () {
128136
var me = this;
@@ -132,7 +140,7 @@ SuperMap.TimeFlowControl = SuperMap.Class(SuperMap.TimeControlBase, {
132140
},
133141

134142
/**
135-
*执行回调,更新时间戳
143+
* @inheritDoc
136144
*/
137145
update: function () {
138146
var me = this;

src/common/format/Format.js

Lines changed: 45 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,89 @@
1-
/*
2-
* Class: SuperMap.Format
3-
* 读写各种格式的格式类基类。其子类应该包含并实现read和write方法。
4-
*/
51
var SuperMap = require('../SuperMap');
2+
3+
/**
4+
* @class SuperMap.Format
5+
* @description 读写各种格式的格式类基类。其子类应该包含并实现read和write方法。
6+
* @param options - {Object} 选项对象,其属性会被直接设置到format实例。如:<br>
7+
* keepData - {Boolean} 如果设置为true, <data> 属性会指向被解析的对象(例如json或xml数据对象)。
8+
* @return {SuperMap.Format} 实例。
9+
*/
610
SuperMap.Format = SuperMap.Class({
7-
/**
8-
* @class SuperMap.Format
9-
* @constructs SuperMap.SuperMap.Format
10-
* @classdesc
11-
* 读写各种格式的格式类基类。其子类应该包含并实现read和write方法。
12-
* @extends {SuperMap}
13-
* @api
14-
*/
1511

1612
/**
17-
* Property: options
18-
* {Object} A reference to options passed to the constructor.
13+
* @member SuperMap.Format.prototype.options -{Object}
14+
* @description A reference to options passed to the constructor.
1915
*/
2016
options: null,
2117

2218
/**
23-
* APIProperty: externalProjection
24-
* {<SuperMap.Projection>} 当设置了externalProjection和internalProjection参数,
25-
* format类会重新对其读到的或写出的几何图形进行投影。externalProjection
26-
* 是read操作读到或write操作写出的投影内容。为了能够重新投影,针对某
27-
* 一个投影的transformation方法必须是有效的。同时,我们可以使用proj4js
28-
* 或自定义的transformation方法来进行支持。查看{<SuperMap.Projection.addTransform>}
29-
* 以获取更多的信息。
19+
* @member SuperMap.Format.prototype.externalProjection -{SuperMap.Projection}
20+
* @description 当设置了externalProjection和internalProjection参数,
21+
* format类会重新对其读到的或写出的几何图形进行投影。externalProjection
22+
* 是read操作读到或write操作写出的投影内容。为了能够重新投影,针对某
23+
* 一个投影的transformation方法必须是有效的。同时,我们可以使用proj4js
24+
* 或自定义的transformation方法来进行支持。查看{SuperMap.Projection.addTransform}
25+
* 以获取更多的信息。
3026
*/
3127
externalProjection: null,
3228

3329
/**
34-
* APIProperty: internalProjection
35-
* {<SuperMap.Projection>} 当设置了externalProjection和internalProjection参数,
36-
* format类会重新对其读到的或写出的几何图形进行投影。internalProjection
37-
* 是read操作返回或传给write操作的投影内容。为了能够重新投影,针对某
38-
* 一个投影的transformation方法必须是有效的。同时,我们可以使用proj4js
39-
* 或自定义的transformation方法来进行支持。查看{<SuperMap.Projection.addTransform>}
40-
* 以获取更多的信息。
30+
* @member SuperMap.Format.prototype.internalProjection -{SuperMap.Projection}
31+
* @description 当设置了externalProjection和internalProjection参数,
32+
* format类会重新对其读到的或写出的几何图形进行投影。internalProjection
33+
* 是read操作返回或传给write操作的投影内容。为了能够重新投影,针对某
34+
* 一个投影的transformation方法必须是有效的。同时,我们可以使用proj4js
35+
* 或自定义的transformation方法来进行支持。查看{SuperMap.Projection.addTransform}
36+
* 以获取更多的信息。
4137
*/
4238
internalProjection: null,
4339

4440
/**
45-
* APIProperty: data
46-
* {Object} 当 <keepData> 属性设置为true,这是传递给<read>操作的要被
47-
* 解析的字符串。
41+
* @member SuperMap.Format.prototype.data -{Object}
42+
* @description 当 <keepData> 属性设置为true,这是传递给<read>操作的要被解析的字符串。
4843
*/
4944
data: null,
5045

5146
/**
5247
* APIProperty: keepData
53-
* {Object} 保持最近读到的数据的引用(通过 <data> 属性)。默认值是false。
48+
* @member SuperMap.Format.prototype.keepData -{Object}
49+
* @description 保持最近读到的数据的引用(通过 <data> 属性)。默认值是false。
5450
*/
5551
keepData: false,
5652

5753
/**
58-
* Constructor: SuperMap.Format
59-
* 直接实例化这个类没有实际作用,可以通过实例化其子类来进行操作。
60-
*
61-
* Parameters:
62-
* options - {Object} 选项对象,其属性会被直接设置到format实例。
63-
*
64-
* Valid options:
65-
* keepData - {Boolean} 如果设置为true, <data> 属性会指向被解析的对象。
66-
* (例如json或xml数据对象)。
67-
*
68-
* Returns:
69-
* 返回 <SuperMap.Format> 实例。
70-
*/
71-
72-
/**
73-
* @method SuperMap.Format.initialize
74-
* @param options - {Object} 选项对象,其属性会被直接设置到format实例。
75-
* Allowed options properties:</br>
76-
* datasetNames - {Array(String)} 数据集集合中的数据集名称列表。</br>
77-
* returnContent - {<SuperMap.FilterParameter>} 是否直接返回查询结果。</br>
78-
* fromIndex - {Integer} 查询结果的最小索引号。</br>
79-
* toIndex - {Integer} 查询结果的最大索引号。</br>
54+
* @function SuperMap.Format.prototype.initialize
55+
* @description 直接实例化这个类没有实际作用,可以通过实例化其子类来进行操作。
56+
* @param options - {Object} 选项对象,其属性会被直接设置到format实例。如:<br>
57+
* keepData - {Boolean} 如果设置为true, <data> 属性会指向被解析的对象(例如json或xml数据对象)。
58+
* @return {SuperMap.Format} 实例。
8059
*/
8160
initialize: function (options) {
8261
SuperMap.Util.extend(this, options);
8362
this.options = options;
8463
},
8564

86-
/*
87-
* APIMethod: destroy
88-
* 销毁该格式类,释放相关资源。
65+
/**
66+
* @function destroy
67+
* @description 销毁该格式类,释放相关资源。
8968
*/
9069
destroy: function () {
9170
//用来销毁该格式类,释放相关资源
9271
},
9372

94-
/*
95-
* Method: read
96-
* Read data from a string, and return an object whose type depends on the
97-
* subclass.
98-
*
99-
* Parameters:
100-
* data - {string} Data to read/parse.
101-
*
102-
* Returns:
103-
* Depends on the subclass
73+
/**
74+
* @function SuperMap.Format.prototype.read
75+
* @description Read data from a string, and return an object whose type depends on the subclass.
76+
* @param data - {string} Data to read/parse.
10477
*/
10578
read: function (data) {
10679
//用来从字符串中读取数据
10780
},
10881

109-
/*
110-
* Method: write
111-
* Accept an object, and return a string.
112-
*
113-
* Parameters:
114-
* object - {Object} Object to be serialized
115-
*
116-
* Returns:
117-
* {String} A string representation of the object.
82+
/**
83+
* @function SuperMap.Format.prototype.write
84+
* @description Accept an object, and return a string.
85+
* @param object - {Object} Object to be serialized
86+
* @return {String} A string representation of the object.
11887
*/
11988
write: function (object) {
12089
//用来写字符串

0 commit comments

Comments
 (0)