Skip to content

Commit cc51d93

Browse files
【API】leaflet下的jsdoc优化。review by chenmy
1 parent 6e267ac commit cc51d93

Some content is hidden

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

47 files changed

+603
-603
lines changed

build/jsdocs/template/typeLinkExt.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ var typeLinks = {
1717
"L.Polyline": lfapi + "#polyline",
1818
"L.Point": lfapi + "#point",
1919
"L.LatLng": lfapi + "#latlng",
20-
"L.GeoJSON": lfapi + "#geojson"
20+
"L.GeoJSON": lfapi + "#geojson",
21+
"L.Control": lfapi + "#control",
22+
"L.Class": lfapi + "#class",
23+
"L.GridLayer": lfapi + '#gridlayer',
24+
"L.Path": lfapi + '#path',
25+
"L.SVG": lfapi + '#svg',
26+
"L.Canvas": lfapi + '#canvas',
27+
"L.Layer": lfapi + '#layer',
28+
"L.LayerGroup": lfapi + '#layergroup',
29+
"L.TileLayer": lfapi + '#tilelayer',
30+
"L.CircleMarker": lfapi + '#circlemarker'
2131
}
2232
exports.typeLinks = typeLinks;

src/leaflet/control/ChangeTileVersion.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ import {MapService} from "../services/MapService";
66
* @class L.supermap.control.changeTileVersion
77
* @classdesc 版本切换控件,支持IE10及以上
88
* @category Control
9-
* @extends L.Control{@linkdoc-leaflet/#control}
9+
* @extends {L.Control}
1010
* @example
1111
* L.supermap.control.changeTileVersion({
1212
* layer: baseLayer,
1313
* position: "topleft",
1414
* orientation: "horizontal"
1515
* }).addTo(map);
16-
* @param options -{Object} logo控件配置项</br>
17-
* layer - {[L.Layer]{@linkdoc-leaflet/#layer}} 绑定的底图图层</br>
18-
* position - {string} 控件位置 继承自leaflet control</br>
19-
* title - {string} 鼠标滑过时提示</br>
20-
* tooltip - {string} tooltip提示显示位置 top | right | bottom | left</br>
21-
* collapsed - {boolean} 是否折叠。<br>
22-
* nextText - {string} 下一个版本的按钮布局</br>
23-
* lastText - {string} 上一个版本的按钮布局</br>
24-
* ico - {string} 控件显示的logo</br>
25-
* orientation - {string} 方向horizontal|vertical</br>
26-
* switch - {boolean} 是否显示上/下一个版本切换控件
16+
* @param {Object} options - logo控件配置项
17+
* @param {L.Layer} options.layer - 绑定的底图图层
18+
* @param {string} [options.position='topleft'] - 控件位置 继承自leaflet control
19+
* @param {string} options.title - 鼠标滑过时提示
20+
* @param {string} options.tooltip - tooltip提示显示位置 top | right | bottom | left
21+
* @param {boolean} options.collapsed - 是否折叠。
22+
* @param {string} options.nextText - 下一个版本的按钮布局
23+
* @param {string} options.lastText - 上一个版本的按钮布局
24+
* @param {string} options.ico - 控件显示的logo
25+
* @param {string} options.orientation - 方向horizontal|vertical
26+
* @param {boolean} options.switch - 是否显示上/下一个版本切换控件
2727
*/
2828
export var ChangeTileVersion = L.Control.extend({
2929

@@ -69,7 +69,7 @@ export var ChangeTileVersion = L.Control.extend({
6969
/**
7070
* @function L.supermap.control.changeTileVersion.prototype.setContent
7171
* @description 设置版本相关信息
72-
* @param version - {Object} 版本信息
72+
* @param {Object} version - 版本信息
7373
*/
7474
setContent: function (version) {
7575
var content = L.Util.extend({}, version);
@@ -79,7 +79,7 @@ export var ChangeTileVersion = L.Control.extend({
7979
/**
8080
* @function L.supermap.control.changeTileVersion.prototype.setVersionName
8181
* @description 设置版本号
82-
* @param content - {string} 版本信息
82+
* @param {string} content - 版本信息
8383
* @return {this} this
8484
*/
8585
setVersionName: function (content) {
@@ -94,7 +94,7 @@ export var ChangeTileVersion = L.Control.extend({
9494
/**
9595
* @function L.supermap.control.changeTileVersion.prototype.setToolTip
9696
* @description 设置提示信息
97-
* @param tooltip - {HTMLElement|String} 要需要设置的提示信息
97+
* @param {(HTMLElement|String)} tooltip - 要需要设置的提示信息
9898
* @return {this} this
9999
*/
100100
setToolTip: function (tooltip) {
@@ -105,7 +105,7 @@ export var ChangeTileVersion = L.Control.extend({
105105
/**
106106
* @function L.supermap.control.changeTileVersion.prototype.updateLength
107107
* @description 更新进度条长度
108-
* @param length - {number}进度长度参数
108+
* @param {number} length - 进度长度参数
109109
*/
110110
updateLength: function (length) {
111111
if (length > 0) {
@@ -118,7 +118,7 @@ export var ChangeTileVersion = L.Control.extend({
118118
/**
119119
* @function L.supermap.control.changeTileVersion.prototype.setLayer
120120
* @description 绑定图层
121-
* @param layer - {L.supermap.tiledMapLayer} 绑定的图层
121+
* @param {L.supermap.tiledMapLayer} layer - 绑定的图层
122122
*/
123123
setLayer: function (layer) {
124124
if (layer) {
@@ -140,7 +140,7 @@ export var ChangeTileVersion = L.Control.extend({
140140
/**
141141
* @function L.supermap.control.changeTileVersion.prototype.update
142142
* @description 更新缓存切片集及进度条长度
143-
* @param tileVersions - {number}待更新的切片版本号
143+
* @param {number} tileVersions - 待更新的切片版本号
144144
*/
145145
update: function (tileVersions) {
146146
this.tileVersions = tileVersions;
@@ -203,7 +203,7 @@ export var ChangeTileVersion = L.Control.extend({
203203
/**
204204
* @function L.supermap.control.changeTileVersion.prototype.tilesVersion
205205
* @description 根据指定版本号请求版本
206-
* @param version - {string} 版本号参数
206+
* @param {string} version - 版本号参数
207207
*/
208208
tilesVersion: function (version) {
209209
var layer = this.options.layer,

src/leaflet/control/Logo.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ import {
99
* @classdesc Logo控件。
1010
* @category Control
1111
* @description map初始化的配置项为logoControl,如果为true,则显示控件;否则不显示该控件。目前默认显示。
12-
* @extends L.Control{@linkdoc-leaflet/#control}
12+
* @extends {L.Control}
1313
* @example
1414
* L.supermap.control.Logo({
1515
* imageUrl: xxx,//非必填项
1616
* }).addTo(map);
17-
* @param options -{Object} logo控件配置项</br>
18-
* imageUrl - {string} logo图片地址</br>
19-
* width - {string} logo图片宽</br>
20-
* height - {string} logo图片高</br>
21-
* link - {string} 跳转链接</br>
22-
* alt - {string} logo图片失效时显示文本
17+
* @param {Object} options - logo控件配置项
18+
* @param {string} options.position - 控件位置 继承自leaflet control
19+
* @param {string} options.imageUrl - logo图片地址
20+
* @param {string} options.width - logo图片宽
21+
* @param {string} options.height - logo图片高
22+
* @param {string} options.link - 跳转链接
23+
* @param {string} options.alt - logo图片失效时显示文本
2324
*/
2425
export var Logo = L.Control.extend({
2526

src/leaflet/core/CommontypesConversion.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class CommontypesConversion {
1010
/**
1111
* @function L.supermap.CommontypesConversion.toSuperMapBounds
1212
* @description 将Leaflet对象得bounds转成SuperMap 的bounds对象
13-
* @param bounds - {L.Bounds|L.LatLngBounds} 图层显示范围
13+
* @param {(L.Bounds|L.LatLngBounds)} bounds - 图层显示范围
1414
* @return {SuperMap.Bounds} SuperMap的bounds对象
1515
*/
1616
static toSuperMapBounds(bounds) {
@@ -44,7 +44,7 @@ export class CommontypesConversion {
4444
/**
4545
* @function L.supermap.Util.isArray
4646
* @description 判断是否为数组格式
47-
* @param obj - {Object} 待判断对象
47+
* @param {Object} obj - 待判断对象
4848
* @return {boolean} 是否是数组
4949
*/
5050
static isArray(obj) {
@@ -54,7 +54,7 @@ export class CommontypesConversion {
5454
/**
5555
* @function L.supermap.CommontypesConversion.toProcessingParam
5656
* @description 将Region节点数组转为Processing服务需要的分析参数
57-
* @param points - Region各个节点数组
57+
* @param {Array} points - Region各个节点数组
5858
* @return processing服务裁剪、查询分析的分析参数
5959
*/
6060
static toProcessingParam(points) {

src/leaflet/core/NonEarthCRS.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ L.Projection = {};
77
* @class L.Projection.NonProjection
88
* @classdesc 平面无投影对象
99
* @category BaseTypes Projection
10-
* @extends L.Class{@linkdoc-leaflet/#class}
11-
* @param bounds - {L.bounds} 坐标范围
10+
* @extends {L.Class}
11+
* @param {L.bounds} bounds - 坐标范围
1212
*/
1313
export var NonProjection = L.Class.extend({
1414

@@ -33,11 +33,11 @@ export var nonProjection = function (bounds) {
3333
* @class L.CRS.NonEarthCRS
3434
* @classdesc 平面无投影坐标类
3535
* @category BaseTypes Projection
36-
* @extends L.Class{@linkdoc-leaflet/#class}
37-
* @param options - {Object} 构建平面无投影坐标对象参数<br>
38-
* origin - {Object} 原点<br>
39-
* bounds - {[L.bounds]{@linkdoc-leaflet/#bounds}|Array<number>} 范围<br>
40-
* resolutions - {Array<number>} 分辨率
36+
* @extends {L.Class}
37+
* @param {Object} options - 构建平面无投影坐标对象参数
38+
* @param {Object} options.origin - 原点
39+
* @param {L.bounds} options.bounds - 范围
40+
* @param {Array.<number>} options.resolutions - 分辨率
4141
*/
4242
export var NonEarthCRS = L.Class.extend({
4343

@@ -62,7 +62,7 @@ export var NonEarthCRS = L.Class.extend({
6262
/**
6363
* @function L.CRS.NonEarthCRS.prototype.scale
6464
* @description 通过缩放级别计算比例尺
65-
* @param zoom - {number}缩放级别
65+
* @param {number} zoom - 缩放级别
6666
* @return {number} 得到的比例尺
6767
*/
6868
scale: function (zoom) {
@@ -77,7 +77,7 @@ export var NonEarthCRS = L.Class.extend({
7777
/**
7878
* @function L.CRS.NonEarthCRS.prototype.zoom
7979
* @description 通过比例尺计算范围
80-
* @param scale - {number}比例尺
80+
* @param {number} scale - 比例尺
8181
* @return {number} 返回空间范围值
8282
*/
8383
zoom: function (scale) {
@@ -97,8 +97,8 @@ export var NonEarthCRS = L.Class.extend({
9797
/**
9898
* @function L.CRS.NonEarthCRS.prototype.distance
9999
* @description 通过两个坐标点计算之间的距离
100-
* @param latlng1 - {L.latLng} 坐标点1
101-
* @param latlng2 - {L.latLng} 坐标点2
100+
* @param {L.latLng} latlng1 - 坐标点1
101+
* @param {L.latLng} latlng2 - 坐标点2
102102
* @return {number} 返回距离长度
103103
*/
104104
distance: function (latlng1, latlng2) {

src/leaflet/core/Proj4Leaflet.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ L.Proj.Projection = L.Class.extend({
9292
* @category BaseTypes Projection
9393
* @extends {L.Class}
9494
* @param {string} srsCode - proj srsCode。
95-
* @param {Object} options - options。可选参数:
96-
* @param {string} options.def - 投影的proj4定义。{@link [详细]{http://iclient.supermap.io/web/introduction/leafletDevelop.html#projection}}
97-
* @param {Array.<number>|L.Point} [options.origin=] - 原点。
98-
* @param {Array.<number>} [options.scales=] - 比例尺数组。
99-
* @param {Array.<number>} [options.scaleDenominators=] - 比例尺分母数组。
100-
* @param {Array.<number>} [options.resolutions=] - 分辨率数组。
101-
* @param {Array.<number>|L.Bounds} [options.bounds=] - 范围。
95+
* @param {Object} options - 参数。
96+
* @param {string} options.def - 投影的proj4定义。[详细]{@link http://iclient.supermap.io/web/introduction/leafletDevelop.html#projection}
97+
* @param {(Array.<number>|L.Point)} options.origin - 原点。
98+
* @param {Array.<number>} options.scales - 比例尺数组。
99+
* @param {Array.<number>} options.scaleDenominators - 比例尺分母数组。
100+
* @param {Array.<number>} options.resolutions - 分辨率数组。
101+
* @param {(Array.<number>|L.Bounds)} options.bounds - 范围。
102102
* @param {number} [options.dpi=96] - dpi。
103103
* @example
104104
* var crs =L.Proj.CRS("EPSG:4326",{
@@ -192,7 +192,7 @@ export var CRS = L.Class.extend({
192192
/**
193193
* @function L.Proj.CRS.prototype.scale
194194
* @description 通过缩放级别获取比例尺值
195-
* @param zoom - {number}缩放级别
195+
* @param {number} zoom - 缩放级别
196196
* @return 比例尺值
197197
*/
198198
scale: function (zoom) {
@@ -216,7 +216,7 @@ export var CRS = L.Class.extend({
216216
/**
217217
* @function L.Proj.CRS.prototype.zoom
218218
* @description 根据比例尺返回缩放级别
219-
* @param scale - {number}比例尺
219+
* @param {number} scale - 比例尺
220220
* @return {number} 缩放级别
221221
*/
222222
zoom: function (scale) {

src/leaflet/mapping/BaiduTileLayer.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import L from "leaflet";
55
* @class L.supermap.baiduTileLayer
66
* @classdesc 百度地图图层。
77
* @category ThirdPartyMap
8-
* @extends L.TileLayer{@linkdoc-leaflet/#tilelayer}
9-
* @param url -{string} 切片地址
10-
* @param options -{Object} 切片参数。如:<br>
11-
* minZoom - {number} 最小缩放级别 <br>
12-
* maxZoom - {number} 最大缩放级别 <br>
13-
* bounds - {[L.LatLngBounds]{@linkdoc-leaflet/#latlngbounds}} 显示范围 <br>
14-
* retina - {[L.Browser]{@linkdoc-leaflet/#browser}} 浏览器显示分辨率 <br>
15-
* attribution - {string} 版权信息 <br>
16-
* tileProxy - {string} 启用托管地址
8+
* @extends {L.TileLayer}
9+
* @param {string} url - 切片地址
10+
* @param {Object} options - 切片参数。
11+
* @param {number} options.minZoom - 最小缩放级别
12+
* @param {number} options.maxZoom - 最大缩放级别
13+
* @param {L.LatLngBounds} options.bounds - 显示范围。
14+
* @param {L.Browser} options.retina - 浏览器显示分辨率。
15+
* @param {string} options.attribution - 版权信息
16+
* @param {string} options.tileProxy - 启用托管地址
1717
*/
1818
export var BaiduTileLayer = L.TileLayer.extend({
1919

@@ -45,7 +45,7 @@ export var BaiduTileLayer = L.TileLayer.extend({
4545
/**
4646
* @function L.supermap.baiduTileLayer.prototype.getTileUrl
4747
* @description 获取切片地址
48-
* @param coords - {Object} 行列号
48+
* @param {Object} coords - 行列号
4949
* @return {string} 切片地址
5050
*/
5151
getTileUrl: function (coords) {

src/leaflet/mapping/CloudTileLayer.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,37 @@ import "../core/Base";
55
* @class L.supermap.cloudTileLayer
66
* @classdesc 超图云服务图层。
77
* @category ThirdPartyMap
8-
* @extends L.TileLayer{@linkdoc-leaflet/#tilelayer}
9-
* @param url -{string} 服务地址,默认为 http://t2.supermapcloud.com/FileService/image?map={mapName}&type={type}&x={x}&y={y}&z={z}
10-
* @param options -{Object} 图层可选参数。如:<br>
11-
* layersID - {number}图层ID,如果有layersID,则是在使用专题图。<br>
12-
* redirect - {boolean} 是否从定向,如果为 true,则将请求重定向到图片的真实地址;如果为 false,则响应体中是图片的字节流。<br>
13-
* transparent - {boolean}是否背景透明。<br>
14-
* cacheEnabled - {boolean} 启用缓存。<br>
15-
* clipRegionEnabled - {boolean} 是否启用地图裁剪。<br>
16-
* prjCoordSys - {Object} 请求的地图的坐标参考系统。 如:prjCoordSys={"epsgCode":3857}。<br>
17-
* overlapDisplayed - {boolean} 地图对象在同一范围内时,是否重叠显示。<br>
18-
* overlapDisplayedOptions - {string} 避免地图对象压盖显示的过滤选项。<br>
19-
* tileversion - {string} 切片版本名称,cacheEnabled 为 true 时有效。<br>
20-
* crs - {{@link L.Proj.CRS}} 坐标系统类。<br>
21-
* serverType - {{@link SuperMap.ServerType}} 服务来源 iServer|iPortal|online。<br>
22-
* attribution - {string} 版权信息。<br>
23-
* minZoom - {number} 最小缩放级别。<br>
24-
* maxZoom - {number} 最大缩放级别。<br>
25-
* mapName - {string} 地图名称。
8+
* @extends {L.TileLayer}
9+
* @param {string} [url='http://t2.supermapcloud.com/FileService/image?map={mapName}&type={type}&x={x}&y={y}&z={z}'] - 服务地址。
10+
* @param {Object} options - 图层可选参数。
11+
* @param {number} options.layersID - 图层ID,如果有layersID,则是在使用专题图。
12+
* @param {boolean} options.redirect - 是否从定向,如果为 true,则将请求重定向到图片的真实地址;如果为 false,则响应体中是图片的字节流。
13+
* @param {boolean} options.transparent - 是否背景透明。
14+
* @param {boolean} options.cacheEnabled - 启用缓存。
15+
* @param {boolean} options.clipRegionEnabled - 是否启用地图裁剪。
16+
* @param {Object} options.prjCoordSys - 请求的地图的坐标参考系统。 如:prjCoordSys={"epsgCode":3857}。
17+
* @param {boolean} options.overlapDisplayed - 地图对象在同一范围内时,是否重叠显示。
18+
* @param {string} options.overlapDisplayedOptions - 避免地图对象压盖显示的过滤选项。
19+
* @param {string} options.tileversion - 切片版本名称,cacheEnabled 为 true 时有效。
20+
* @param {L.Proj.CRS} options.crs - 坐标系统类。
21+
* @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 iServer|iPortal|online。
22+
* @param {string} options.attribution - 版权信息。
23+
* @param {number} options.minZoom - 最小缩放级别。
24+
* @param {number} options.maxZoom - 最大缩放级别。
25+
* @param {string} options.mapName - 地图名称。
2626
*/
2727
export var CloudTileLayer = L.TileLayer.extend({
2828

2929
defaultURL: 'http://t2.supermapcloud.com/FileService/image',
3030

3131
options: {
3232
/**
33-
* @member L.supermap.cloudTileLayer.prototype.options -{String}
33+
* @member {String} L.supermap.cloudTileLayer.prototype.options
3434
* @description 地图名称,默认为 quanguo。
3535
*/
3636
mapName: "quanguo",
3737
/**
38-
* @member L.supermap.cloudTileLayer.prototype.type -{{String} }
38+
* @member {String} L.supermap.cloudTileLayer.prototype.type
3939
* @description 地图投影。
4040
*/
4141
type: "web",
@@ -55,7 +55,7 @@ export var CloudTileLayer = L.TileLayer.extend({
5555
/**
5656
* @function L.supermap.cloudTileLayer.prototype.getTileUrl
5757
* @description 获取切片地址
58-
* @param coords - {Object} 行列号
58+
* @param {Object} coords - 行列号
5959
* @return {string} 切片地址
6060
*/
6161
getTileUrl: function (coords) {

0 commit comments

Comments
 (0)