Skip to content

Commit 9472ed9

Browse files
【API】Openlayers的jsdoc优化。
1 parent cc51d93 commit 9472ed9

36 files changed

+639
-662
lines changed

build/jsdocs/template/typeLinkExt.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@ var typeLinks = {
1010
"ol.geom.LineString": olapi + "ol.geom.LineString.html",
1111
"ol.geom.Point": olapi + "ol.geom.Point.html",
1212
"ol.format.GeoJSON": olapi + "ol.format.GeoJSON.html",
13+
"ol.proj.Projection": olapi + "ol.proj.Projection",
14+
"ol.Observable": olapi + "ol.Observable",
15+
"ol.style.Image": olapi + "ol.style.Image",
16+
"ol.style.Fill": olapi + "ol.style.Fill",
17+
"ol.style.Stroke": olapi + "ol.style.Stroke",
18+
"ol.Object": olapi + "ol.Object",
19+
"ol.source.ImageCanvas": olapi + "ol.source.ImageCanvas",
20+
"ol.source.TileImage": olapi + "ol.source.TileImage",
21+
"ol.source.WMTS": olapi + "ol.source.WMTS",
22+
"ol.source.XYZ": olapi + "ol.source.XYZ",
23+
"ol.source.Vector": olapi + "ol.source.Vector",
24+
"ol.source.VectorTile": olapi + "ol.source.VectorTile",
25+
"ol.Pixel": olapi + "ol.html#.Pixel",
26+
"ol.source.State": olapi + "ol.source.html#.State",
1327

1428
//leaflet
1529
"L.Bounds": lfapi + "#bounds",

src/openlayers/control/ChangeTileVersion.js

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ ol.supermap.control = ol.supermap.control || {};
88
* @class ol.supermap.control.ChangeTileVersion
99
* @category Control
1010
* @classdesc 版本切换控件(目前仅支持IE10及以上)暂时不支持自定义位置
11-
* @extends ol.control.Control{@linkdoc-openlayers/ol.control.Control}
12-
* @param options -{options} 可选参数。如:<br>
13-
* title - {string} 提示信息。<br>
14-
* tooltip - {string} 提示显示位置 top | right | bottom | left。<br>
15-
* collapsed - {boolean} 是否折叠。<br>
16-
* lastText - {string} 上一个版本的按钮布局。<br>
17-
* nextText - {string} 下一个版本的按钮布局。<br>
18-
* ico - {string} 控件显示的logo。<br>
19-
* orientation - {string} 方向horizontal|vertical。<br>
20-
* switch - {boolean} 是否显示上/下一个版本切换控件
11+
* @extends {ol.control.Control}
12+
* @param {options} options -参数。<br>
13+
* @param {string} options.title - 提示信息。<br>
14+
* @param {string} options.tooltip - 提示显示位置 top | right | bottom | left。<br>
15+
* @param {boolean} options.collapsed - 是否折叠。<br>
16+
* @param {string} options.lastText - 上一个版本的按钮布局。<br>
17+
* @param {string} options.nextText - 下一个版本的按钮布局。<br>
18+
* @param {string} options.ico - 控件显示的logo。<br>
19+
* @param {string} options.orientation - 方向horizontal|vertical。<br>
20+
* @param {boolean} options.switch - 是否显示上/下一个版本切换控件
2121
* @example
2222
* var control = new ol.supermap.control.ChangeTileVersion({
2323
* layer: baseLayer,
@@ -69,7 +69,7 @@ export class ChangeTileVersion extends ol.control.Control {
6969
this.setLayer(options.layer);
7070
}
7171

72-
/*
72+
/**
7373
* @function ol.supermap.control.ChangeTileVersion.prototype.initLayout
7474
* @description 初始化
7575
*/
@@ -143,7 +143,7 @@ export class ChangeTileVersion extends ol.control.Control {
143143
this._sliderContainer.style.width = 150 + 'px';
144144
}
145145

146-
/*
146+
/**
147147
* @function ol.supermap.control.ChangeTileVersion.prototype.addDomEvent
148148
* @description 为元素添加事件
149149
*/
@@ -167,13 +167,13 @@ export class ChangeTileVersion extends ol.control.Control {
167167
return this._container;
168168
}
169169

170-
/*
170+
/**
171171
* @function ol.supermap.control.ChangeTileVersion.prototype.createElement
172172
* @description 新建元素
173-
* @param tagName -{string} 标签名
174-
* @param className -{string} 类名
175-
* @param container -{Object} 容器
176-
* @return {object|Element} 元素
173+
* @param {string} tagName - 标签名
174+
* @param {string} className - 类名
175+
* @param {Object} container - 容器
176+
* @returns {object|Element} 元素
177177
*/
178178
function createElement(tagName, className, container) {
179179
var el = document.createElement(tagName);
@@ -185,14 +185,14 @@ export class ChangeTileVersion extends ol.control.Control {
185185
return el;
186186
}
187187

188-
/*
188+
/**
189189
* @function ol.supermap.control.ChangeTileVersion.prototype.addDomEvent
190190
* @description 为元素添加事件
191-
* @param obj -{Object} 事件对象集
192-
* @param type -{string} 事件类型
193-
* @param fn -{Object} 容器
194-
* @param context -{Object} 当前环境
195-
* @return {addDomEvent} 添加的事件
191+
* @param {Object} obj - 事件对象集
192+
* @param {string} type - 事件类型
193+
* @param {Object} fn -容器
194+
* @param {Object} context -当前环境
195+
* @returns {addDomEvent} 添加的事件
196196
*/
197197
function addDomEvent(obj, type, fn, context) {
198198
var handler = function (e) {
@@ -257,7 +257,7 @@ export class ChangeTileVersion extends ol.control.Control {
257257
/**
258258
* @function ol.supermap.control.ChangeTileVersion.prototype.setContent
259259
* @description 设置版本相关信息
260-
* @param version -{Object} 版本信息
260+
* @param {Object} version - 版本信息
261261
*/
262262
setContent(version) {
263263
var content = version || {};
@@ -267,7 +267,7 @@ export class ChangeTileVersion extends ol.control.Control {
267267
/**
268268
* @function ol.supermap.control.ChangeTileVersion.prototype.setVersionName
269269
* @description 设置版本号
270-
* @param content -{string} 版本内容
270+
* @param {string} content -版本内容
271271
*/
272272
setVersionName(content) {
273273
var value = content;
@@ -281,8 +281,8 @@ export class ChangeTileVersion extends ol.control.Control {
281281
/**
282282
* @function ol.supermap.control.ChangeTileVersion.prototype.setToolTip
283283
* @description 设置提示信息
284-
* @param tooltip -{string} 工具提示
285-
* @return {this} this
284+
* @param {string} tooltip - 工具提示
285+
* @returns {this} this
286286
*/
287287
setToolTip(tooltip) {
288288
this.tooltip.innerHTML = tooltip;
@@ -292,7 +292,7 @@ export class ChangeTileVersion extends ol.control.Control {
292292
/**
293293
* @function ol.supermap.control.ChangeTileVersion.prototype.updateLength
294294
* @description 更新进度条长度
295-
* @param length -{number} 进度条长度
295+
* @param {number} length - 进度条长度
296296
*/
297297
updateLength(length) {
298298
if (length > 0) {
@@ -305,7 +305,7 @@ export class ChangeTileVersion extends ol.control.Control {
305305
/**
306306
* @function ol.supermap.control.ChangeTileVersion.prototype.setLayer
307307
* @description 绑定图层
308-
* @param layer -{Object} 图层
308+
* @param {Object} layer - 图层
309309
*/
310310
setLayer(layer) {
311311
if (layer) {
@@ -327,7 +327,7 @@ export class ChangeTileVersion extends ol.control.Control {
327327
/**
328328
* @function ol.supermap.control.ChangeTileVersion.prototype.update
329329
* @description 更新缓存切片集及进度条长度
330-
* @param tileVersions -{Object} 待更新的切片版本
330+
* @param {Object} tileVersions - 待更新的切片版本
331331
*/
332332
update(tileVersions) {
333333
this.tileVersions = tileVersions;
@@ -358,7 +358,7 @@ export class ChangeTileVersion extends ol.control.Control {
358358
/**
359359
* @function ol.supermap.control.ChangeTileVersion.prototype.nextTilesVersion
360360
* @description 下一个版本,第一次不进行加减,是无版本的状态
361-
* @return {this} this
361+
* @returns {this} this
362362
*/
363363
nextTilesVersion() {
364364
if (this.firstLoad) {
@@ -377,7 +377,7 @@ export class ChangeTileVersion extends ol.control.Control {
377377
/**
378378
* @function ol.supermap.control.ChangeTileVersion.prototype.lastTilesVersion
379379
* @description 获取上一个版本信息
380-
* @return {this} this
380+
* @returns {this} this
381381
*/
382382
lastTilesVersion() {
383383
if (parseInt(this.slider.value) < this.min + 1) {
@@ -391,7 +391,7 @@ export class ChangeTileVersion extends ol.control.Control {
391391
/**
392392
* @function ol.supermap.control.ChangeTileVersion.prototype.tilesVersion
393393
* @description 根据指定版本号请求版本
394-
* @param version -{Object} 版本信息
394+
* @param {Object} version - 版本信息
395395
*/
396396
tilesVersion(version) {
397397
var layer = this.options.layer,

src/openlayers/control/Logo.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ ol.supermap.control = ol.supermap.control || {};
88
* @class ol.supermap.control.Logo
99
* @category Control
1010
* @classdesc Logo控件。默认不显示,需手动添加控件。
11-
* @extends ol.control.Control{@linkdoc-openlayers/ol.control.Control}
11+
* @extends {ol.control.Control}
1212
* @example
1313
* var control = new ol.supermap.control.Logo();
1414
* map.addControl(control);
15-
* @param options - {Object} logo控件配置项。配置项有如下:</br>
16-
* imageUrl - {string} logo图片地址。</br>
17-
* width - {number} logo图片宽。</br>
18-
* height - {number} logo图片高。</br>
19-
* link - {string} 跳转链接。</br>
20-
* alt - {string} logo图片失效时显示文本。
15+
* @param {Object} options - logo控件配置项。</br>
16+
* @param {string} options.imageUrl - logo图片地址。</br>
17+
* @param {number} options.width - logo图片宽。</br>
18+
* @param {number} options.height - logo图片高。</br>
19+
* @param {string} options.link - 跳转链接。</br>
20+
* @param {string} options.alt - logo图片失效时显示文本。
2121
*/
2222
export class Logo extends ol.control.Control {
2323

@@ -32,7 +32,7 @@ export class Logo extends ol.control.Control {
3232
this.options = options;
3333
this.element = options.element = initLayerout.call(this);
3434

35-
/*
35+
/**
3636
* @function ol.supermap.control.Logo.prototype.initLayerout
3737
* @description 初始化图层信息
3838
*/
@@ -68,7 +68,7 @@ export class Logo extends ol.control.Control {
6868
return div;
6969
}
7070

71-
/*
71+
/**
7272
* @function ol.supermap.control.Logo.prototype.setDivStyle
7373
* @div 获取div对象
7474
* @description 设置对象style

src/openlayers/core/StyleUtils.js

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ export class StyleUtils {
1515
/**
1616
* @function ol.supermap.StyleUtils.getValidStyleFromLayerInfo
1717
* @description 通过图层信息获取有效的样式
18-
* @param layerInfo - {Object} 图层信息
19-
* @param feature - [{ol.Feature}]{@linkdoc-openlayers/ol.Feature} 要素
20-
* @param url - {string} 图层数据地址
21-
* @return {ol.style.Style} 返回图层样式
18+
* @param {Object} layerInfo - 图层信息
19+
* @param {ol.Feature} feature - 要素
20+
* @param {string} url - 图层数据地址
21+
* @returns {ol.style.Style} 返回图层样式
2222
*/
2323
static getValidStyleFromLayerInfo(layerInfo, feature, url) {
2424
var type = feature.getGeometry().getType().toUpperCase(),
@@ -230,12 +230,12 @@ export class StyleUtils {
230230
/**
231231
* @function ol.supermap.StyleUtils.getStyleFromCarto
232232
* @description 从Carto中获取有效的样式
233-
* @param zoom -{number} 缩放级别
234-
* @param scale - {number} 比例尺
235-
* @param shader -{Array} 渲染器对象数组
236-
* @param feature -{Object} 要素
237-
* @param fromServer -{string} 服务源
238-
* @param url -{string} 地址
233+
* @param {number} zoom -缩放级别
234+
* @param {number} scale - 比例尺
235+
* @param {Array} shader - 渲染器对象数组
236+
* @param {Object} feature - 要素
237+
* @param {string} fromServer - 服务源
238+
* @param {string} url - 地址
239239
*/
240240
static getStyleFromCarto(zoom, scale, shader, feature, fromServer, url) {
241241
var type = feature.getGeometry().getType().toUpperCase(),
@@ -310,8 +310,8 @@ export class StyleUtils {
310310
/**
311311
* @function ol.supermap.StyleUtils.toOLPointStyle
312312
* @description 点样式
313-
* @param style -{Object} 样式参数
314-
* @return {ol.style.Style} 获取点样式
313+
* @param {Object} style - 样式参数
314+
* @returns {ol.style.Style} 获取点样式
315315
*/
316316
static toOLPointStyle(style) {
317317
if (style.pointFile !== '') {
@@ -338,8 +338,8 @@ export class StyleUtils {
338338
/**
339339
* @function ol.supermap.StyleUtils.toOLLineStyle
340340
* @description 线样式
341-
* @param style -{Object} 样式参数
342-
* @return {ol.style.Style} 获取线的样式
341+
* @param {Object} style - 样式参数
342+
* @returns {ol.style.Style} 获取线的样式
343343
*/
344344
static toOLLineStyle(style) {
345345
return new ol.style.Style({
@@ -358,8 +358,8 @@ export class StyleUtils {
358358
/**
359359
* @function ol.supermap.StyleUtils.toOLPolygonStyle
360360
* @description 面样式
361-
* @param style -{Object} 样式参数
362-
* @return {ol.style.Style} 获取面的样式
361+
* @param {Object} style -样式参数
362+
* @returns {ol.style.Style} 获取面的样式
363363
*/
364364
static toOLPolygonStyle(style) {
365365
var fill = new ol.style.Fill({
@@ -383,9 +383,9 @@ export class StyleUtils {
383383
/**
384384
* @function ol.supermap.StyleUtils.toOLTextStyle
385385
* @description 文本样式
386-
* @param style -{Object} 样式对象
387-
* @param text -{string} 文本参数
388-
* @return {ol.style.Style} 获取的文本样式
386+
* @param {Object} style -样式对象
387+
* @param {string} text -文本参数
388+
* @returns {ol.style.Style} 获取的文本样式
389389
*/
390390
static toOLTextStyle(style, text) {
391391
return new ol.style.Style({
@@ -409,8 +409,8 @@ export class StyleUtils {
409409
/**
410410
* @function ol.supermap.StyleUtils.dashStyle
411411
* @description 符号样式
412-
* @param style -{Object} 样式参数
413-
* @param widthFactor -{number} 宽度系数
412+
* @param {Object} style - 样式参数
413+
* @param {number} widthFactor - 宽度系数
414414
*/
415415
static dashStyle(style, widthFactor) {
416416
if (!style) {
@@ -446,7 +446,7 @@ export class StyleUtils {
446446
/**
447447
* @function ol.supermap.StyleUtils.getStyleFromiPortalMarker
448448
* @description 从iPortal标记获取样式
449-
* @param icon -{Object} 图标参数
449+
* @param {Object} icon - 图标参数
450450
*/
451451
static getStyleFromiPortalMarker(icon) {
452452
if (icon.indexOf("./") == 0) {
@@ -469,9 +469,9 @@ export class StyleUtils {
469469
/**
470470
* @function ol.supermap.StyleUtils.getStyleFromiPortalStyle
471471
* @description 从iPortal标记获取样式
472-
* @param iPortalStyle -{Object} iportal样式
473-
* @param type - {string} 样式类型
474-
* @param fStyle -{Object} 要素样式
472+
* @param {Object} iPortalStyle - iportal样式
473+
* @param {string} type - 样式类型
474+
* @param {Object} fStyle - 要素样式
475475
*/
476476
static getStyleFromiPortalStyle(iPortalStyle, type, fStyle) {
477477
var featureStyle = fStyle ? JSON.parse(fStyle) : null;
@@ -540,9 +540,9 @@ export class StyleUtils {
540540
/**
541541
* @function ol.supermap.StyleUtils.hexToRgba
542542
* @description 十六进制转RGBA格式
543-
* @param hex -{Object} 十六进制格式参数
544-
* @param opacity -{number} Alpha参数
545-
* @return {string} 生成的RGBA格式
543+
* @param {Object} hex - 十六进制格式参数
544+
* @param {number} opacity -Alpha参数
545+
* @returns {string} 生成的RGBA格式
546546
*/
547547
static hexToRgba(hex, opacity) {
548548
var color = [], rgba = [];
@@ -565,7 +565,7 @@ export class StyleUtils {
565565
/**
566566
* @function ol.supermap.StyleUtils.getDefaultStyle
567567
* @description 获取默认风格
568-
* @param type -{string} 类型参数
568+
* @param {string} type - 类型参数
569569
570570
*/
571571
static getDefaultStyle(type) {

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