Skip to content

Commit 4eda031

Browse files
committed
【update】 文档优化; review by luox
1 parent 4b7cc44 commit 4eda031

40 files changed

+1836
-1828
lines changed

build/jsdocs/template/typeLinkExt.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var typeLinks = {
1919
"ol.geom.Point": olapi + "module-ol_geom_Point-Point.html",
2020
"ol.geom.Geometry":olapi + "module-ol_geom_Geometry-Geometry.html",
2121
"ol.format.GeoJSON": olapi + "module-ol_format_GeoJSON-GeoJSON.html",
22+
"ol.format.MVT": olapi + "module-ol_format_MVT-MVT.html",
2223
"ol.proj.Projection": olapi + "module-ol_proj_Projection-Projection.html",
2324
"ol.Observable": olapi + "module-ol_Observable-Observable.html",
2425
"ol.style.Image": olapi + "module-ol_style_Image-ImageStyle.html",
@@ -34,6 +35,7 @@ var typeLinks = {
3435
"ol.Pixel": olapi + "module-ol_pixel.html",
3536
"ol.source.State": olapi + "module-ol_source_State.html",
3637
"ol.layer.Layer": olapi + "module-ol_layer_Layer-Layer.html",
38+
"ol.layer.VectorTile": olapi + "module-ol_layer_VectorTile-VectorTileLayer.html",
3739
"ol.StyleFunction": olapi + "module-ol_style_Style.html#~StyleFunction",
3840
"ol.control.ScaleLine": olapi + "module-ol_control_ScaleLine-ScaleLine.html",
3941
"ol.control.ScaleLine.Units": olapi + "module-ol_control_ScaleLine.html",
@@ -86,7 +88,7 @@ var typeLinks = {
8688
"SuperMap.Bounds":classicapi + '/BaseTypes/Bounds-js.html',
8789
"SuperMap.LonLat":classicapi + '/BaseTypes/LonLat-js.html',
8890

89-
//GeoJSON
91+
// GeoJSON
9092
"GeoJSONObject": geojsonapi,
9193
"GeoJSONGeometry": geometryapi,
9294

src/common/commontypes/Credential.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export class Credential {
3737

3838
/**
3939
* @function Credential.prototype.getUrlParameters
40+
* @description 获取 name=value 的表达式。
4041
* @example
4142
* var credential = new Credential("valueString","token");
4243
* //这里 str = "token=valueString";

src/common/commontypes/Event.js

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
export var Event = {
1212

1313
/**
14-
* @description A hash table cache of the event observers. Keyed by element._eventCacheID
15-
* @type {boolean}
14+
* @description 事件观察者列表。
15+
* @type {Object}
1616
* @default false
1717
*/
1818
observers: false,
@@ -90,55 +90,55 @@
9090

9191
/**
9292
* @description Cross browser event element detection.
93-
* @param {Event} event - The event
94-
* @returns {HTMLElement} The element that caused the event
93+
* @param {Event} event - Event 对象。
94+
* @returns {HTMLElement} 触发事件的 DOM 元素。
9595
*/
9696
element: function (event) {
9797
return event.target || event.srcElement;
9898
},
9999

100100
/**
101-
* @description Determine whether event was caused by a single touch
102-
* @param {Event} event - The event
103-
* @returns {boolean}
101+
* @description 判断事件是否由单次触摸引起。
102+
* @param {Event} event - Event 对象。
103+
* @returns {boolean} 是否有且只有一个当前在与触摸表面接触的 Touch 对象。
104104
*/
105105
isSingleTouch: function (event) {
106106
return event.touches && event.touches.length === 1;
107107
},
108108

109109
/**
110-
* @description Determine whether event was caused by a multi touch
111-
* @param {Event} event - The event
112-
* @returns {boolean}
110+
* @description 判断事件是否由多点触控引起。
111+
* @param {Event} event - Event 对象。
112+
* @returns {boolean} 是否存在多个当前在与触摸表面接触的 Touch 对象。
113113
*/
114114
isMultiTouch: function (event) {
115115
return event.touches && event.touches.length > 1;
116116
},
117117

118118
/**
119-
* @description Determine whether event was caused by a left click.
120-
* @param {Event} event - The event
121-
* @returns {boolean}
119+
* @description 确定事件是否由左键单击引起。
120+
* @param {Event} event - Event 对象。
121+
* @returns {boolean} 是否点击鼠标左键。
122122
*/
123123
isLeftClick: function (event) {
124124
return (((event.which) && (event.which === 1)) ||
125125
((event.button) && (event.button === 1)));
126126
},
127127

128128
/**
129-
* @description Determine whether event was caused by a right mouse click.
130-
* @param {Event} event - The event
131-
* @returns {boolean}
129+
* @description 确定事件是否由鼠标右键单击引起。
130+
* @param {Event} event - Event 对象。
131+
* @returns {boolean} 是否点击鼠标右键。
132132
*/
133133
isRightClick: function (event) {
134134
return (((event.which) && (event.which === 3)) ||
135135
((event.button) && (event.button === 2)));
136136
},
137137

138138
/**
139-
* @description Stops an event from propagating.
140-
* @param {Event} event - The event
141-
* @param {boolean} allowDefault - If true, we stop the event chain but still allow the default browser behaviour (text selection, radio-button clicking, etc) Default false
139+
* @description 阻止事件冒泡。
140+
* @param {Event} event - Event 对象。
141+
* @param {boolean} allowDefault - 默认为 false,表示阻止事件的默认行为。
142142
*/
143143
stop: function (event, allowDefault) {
144144

@@ -158,9 +158,9 @@
158158
},
159159

160160
/**
161-
* @param {Event} event - The event
161+
* @param {Event} event - Event 对象
162162
* @param {string} tagName - html 标签名。
163-
* @returns {HTMLElement} The first node with the given tagName, starting from the node the event was triggered on and traversing the DOM upwards
163+
* @returns {HTMLElement} DOM 元素。
164164
*/
165165
findElement: function (event, tagName) {
166166
var element = Event.element(event);
@@ -231,23 +231,14 @@
231231
},
232232

233233
/**
234-
* @description Given the id of an element to stop observing, cycle through the
235-
* element's cached observers, calling stopObserving on each one,
236-
* skipping those entries which can no longer be removed.
237-
*
238-
* @param {(HTMLElement|string)} elementParam -
234+
* @description 移除给定 DOM 元素的监听事件。
235+
* @param {(HTMLElement|string)} elementParam - 待监听的 DOM 对象或者其 ID 标识。
239236
*/
240237
stopObservingElement: function (elementParam) {
241238
var element = Util.getElement(elementParam);
242239
var cacheID = element._eventCacheID;
243240
this._removeElementObservers(Event.observers[cacheID]);
244241
},
245-
246-
/**
247-
* @param {Array.<Object>} elementObservers - Array of (element, name,
248-
* observer, usecapture) objects,
249-
* taken directly from hashtable
250-
*/
251242
_removeElementObservers: function (elementObservers) {
252243
if (elementObservers) {
253244
for (var i = elementObservers.length - 1; i >= 0; i--) {
@@ -265,7 +256,7 @@
265256
* @param {string} name - 需要移除的被监听事件名称。
266257
* @param {function} observer - 需要移除的事件处理方法。
267258
* @param {boolean} [useCapture=false] - 是否捕获。
268-
* @returns {boolean} Whether or not the event observer was removed
259+
* @returns {boolean} 监听事件是否被移除。
269260
*/
270261
stopObserving: function (elementParam, name, observer, useCapture) {
271262
useCapture = useCapture || false;
@@ -317,8 +308,7 @@
317308
},
318309

319310
/**
320-
* @description Cycle through all the element entries in the events cache and call
321-
* stopObservingElement on each.
311+
* @description 移除缓存中的监听事件。
322312
*/
323313
unloadCache: function () {
324314
// check for Event before checking for observers, because

src/common/commontypes/Geometry.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,8 @@ export class Geometry {
9797

9898
/**
9999
* @function Geometry.prototype.extendBounds
100-
* @description Extend the existing bounds to include the new bounds.
101-
* If geometry's bounds is not yet set, then set a new Bounds.
102-
*
103-
* @param {Bounds} newBounds - 范围。
100+
* @description 扩展现有边界以包含新边界。如果尚未设置几何边界,则设置新边界。
101+
* @param {Bounds} newBounds - 几何对象的 bounds。
104102
*/
105103
extendBounds(newBounds) {
106104
var bounds = this.getBounds();
@@ -147,7 +145,7 @@ export class Geometry {
147145
/**
148146
* @function Geometry.prototype.getArea
149147
* @description 计算几何对象的面积 ,此方法需要在子类中定义。
150-
* @returns {number} The area of the collection by summing its parts
148+
* @returns {number} 计算后的对象面积。
151149
*/
152150
getArea() {
153151
//to be overridden by geometries that actually have an area

src/common/commontypes/Util.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,10 @@ const Util = {
326326

327327
/**
328328
* @memberOf CommonUtil
329-
* @description Takes an object and copies any properties that don't exist from
330-
* another properties, by analogy with CommonUtil.extend() from
331-
* Prototype.js.
332-
*
329+
* @description 比较两个对象并合并。
333330
* @param {Object} [to] - 目标对象。
334-
* @param {Object} from - 源对象。Any properties of this object that
335-
* are undefined in the to object will be set on the to object.
336-
*
337-
* @returns {Object} A reference to the to object. Note that the to argument is modified
338-
* in place and returned by this function.
331+
* @param {Object} from - 源对象。
332+
* @returns {Object} 返回合并后的对象。
339333
*/
340334
applyDefaults: function (to, from) {
341335
to = to || {};
@@ -552,6 +546,7 @@ const Util = {
552546

553547
/**
554548
* @memberOf CommonUtil
549+
* @description 判断并转化比例尺。
555550
* @param {number} scale - 比例尺。
556551
* @returns {number} 正常的 scale 值。
557552
*/

src/common/commontypes/Vector.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ export class Vector extends Feature {
6565

6666
/**
6767
* @member {Bounds} FeatureVector.prototype.bounds
68-
* @description The box bounding that feature's geometry, that
69-
* property can be set by an <Format> object when
70-
* deserializing the feature, so in most cases it represents an
71-
* information set by the server.
68+
* @description 限制要素几何的边界。
7269
*/
7370
this.bounds = null;
7471

src/common/commontypes/geometry/LineString.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export class LineString extends Curve {
4545

4646
/**
4747
* @function GeometryLineString.prototype.getSortedSegments
48+
* @description 获取升序排列的点坐标对象数组。
4849
* @returns {array} 升序排列的点坐标对象数组。
4950
*/
5051
getSortedSegments() {

src/common/components/templates/DropDownBox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import {TemplateBase} from './TemplateBase';
1313
* @param {string} options.id - 组件 dom 元素 id。
1414
* @param {string} options.title - 下拉框 title。
1515
* @param {string} options.remark - 下拉框解释标记文本。
16-
* @param {string} options.icon - 下拉框图标。
1716
* @param {string} [options.dataValue] - 下拉框 attribute 名为 data-value 的值 。
17+
* @param {string} [options.icon] - 下拉框图标。
1818
* @param {string} [options.icon.className] - 下拉框图标类名。
1919
* @param {string} [options.icon.background] - 下拉框图标背景 url。
2020
* @category Components Common

src/common/components/templates/IndexTabsPageContainer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {TemplateBase} from './TemplateBase';
77
* @class IndexTabsPageContainer
88
* @aliasclass Components.IndexTabsPageContainer
99
* @deprecatedclass SuperMap.Components.IndexTabsPageContainer
10-
* @description 标签索引组件。
10+
* @classdesc 标签索引组件。
1111
* @version 9.1.1
1212
* @param {Object} options - 组件配置参数。
1313
* @param {string} options.id - 组件 dom 元素 id。

src/common/components/templates/NavTabsPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {TemplateBase} from './TemplateBase';
1010
* @classdesc 标签页面组件。
1111
* @version 9.1.1
1212
* @param {Object} options - 组件配置参数。
13-
* @param {string} optionsArr.id - 组件 dom 元素 id。
13+
* @param {string} options.id - 组件 dom 元素 id。
1414
* @param {Array.<Object>} [options.tabs=[]] - 标签对象数组,形如:[{title: "",content: HTMLElement}],初始时,传入则创建页面。
1515
* @extends {TemplateBase}
1616
* @category Components Common

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy