Skip to content

Commit 44c5ef4

Browse files
committed
【API】js-doc 优化(mapbox下) review by chenmy
1 parent e2ae3e1 commit 44c5ef4

40 files changed

+947
-954
lines changed

build/jsdocs/template/typeLinkExt.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var olapi = "https://openlayers.org/en/latest/apidoc/";
22
var lfapi = "http://leafletjs.com/reference-1.3.0.html";
3+
var mbglapi = "https://www.mapbox.com/mapbox-gl-js/api/";
34
var typeLinks = {
45
//openlayers
56
"ol.Map": olapi + "ol.Map.html",
@@ -41,6 +42,9 @@ var typeLinks = {
4142
"L.Layer": lfapi + '#layer',
4243
"L.LayerGroup": lfapi + '#layergroup',
4344
"L.TileLayer": lfapi + '#tilelayer',
44-
"L.CircleMarker": lfapi + '#circlemarker'
45+
"L.CircleMarker": lfapi + '#circlemarker',
46+
47+
//mapboxgl
48+
"mapboxgl.Evented": mbglapi + '#Evented'
4549
}
4650
exports.typeLinks = typeLinks;

src/mapboxgl/control/Logo.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@ import {LogoBase64} from '@supermap/iclient-common/control/img/Logo';
1111
* (start code)
1212
* map.addControl(new mapboxgl.supermap.LogoControl(),'bottom-right');
1313
* (end)
14-
* @param options -{Object} logo控件配置项</br>
15-
* imageUrl - {string} logo图片地址</br>
16-
* width - {string} logo图片宽</br>
17-
* height - {string} logo图片高</br>
18-
* link - {string} 跳转链接</br>
19-
* alt - {string} logo图片失效时显示文本
14+
* @param {Object} options - logo控件配置项</br>
15+
* @param {string} options.imageUrl - logo图片地址</br>
16+
* @param {string} options.width - logo图片宽</br>
17+
* @param {string} options.height - logo图片高</br>
18+
* @param {string} options.link - logo图片跳转链接</br>
19+
* @param {string} options.alt - logo图片失效时显示文本
2020
*/
2121
export class Logo {
22-
23-
24-
2522
constructor(options) {
2623
//logo图片地址
2724
this.imageUrl = null;
@@ -39,7 +36,7 @@ export class Logo {
3936
/**
4037
* @function mapboxgl.supermap.LogoControl.prototype.onAdd
4138
* @description 添加一个logo
42-
* @return {div} 返回创建的logo元素
39+
* @returns {div} 返回创建的logo元素
4340
*/
4441
onAdd(map) {
4542
this._map = map;

src/mapboxgl/core/MapExtend.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import '../core/Base';
33

44
/**
55
* @function mapboxgl.supermap.MapExtend
6-
* @description 扩展了mapboxgl.Map对图层相关的操作
6+
* @description 扩展了mapboxgl.Map对图层相关的操作
77
* @private
88
*/
99
export var MapExtend = function () {
@@ -54,7 +54,7 @@ export var MapExtend = function () {
5454
return this;
5555
};
5656

57-
//目前扩展的overlayer,只支持 显示或隐藏图层操作
57+
//目前扩展的overlayer,只支持显示或隐藏图层操作
5858
mapboxgl.Map.prototype.setLayoutProperty = function (layerID, name, value) {
5959
if (this.overlayLayersManager[layerID]) {
6060
if (name === "visibility") {
@@ -78,16 +78,16 @@ export var MapExtend = function () {
7878

7979
/**
8080
* @function mapboxgl.supermap.MapExtend.prototype.removeFromMap
81-
* @description 移除事件
81+
* @description 移除事件
8282
*/
8383
function removeLayer(layer) {
8484
layer.removeFromMap();
8585
}
8686

8787
/**
8888
* @function mapboxgl.supermap.MapExtend.prototype.setVisibility
89-
* @description 设置图层可见性,设置图层的隐藏,显示,重绘的相应的可见标记。
90-
* @param visibility - {string} 是否显示图层(当前地图的resolution在最大最小resolution之间)。
89+
* @description 设置图层可见性,设置图层的隐藏,显示,重绘的相应的可见标记。
90+
* @param {boolean} visibility - 是否显示图层(当前地图的resolution在最大最小resolution之间)。
9191
*/
9292
function setVisibility(layer, visibility) {
9393
layer.setVisibility(visibility);
@@ -96,8 +96,8 @@ export var MapExtend = function () {
9696
/**
9797
* @function mapboxgl.supermap.MapExtend.prototype.moveTo
9898
* @description 将图层移动到某个图层之前。
99-
* @param layerID - {string} 待插入的图层ID。
100-
* @param beforeLayerID - {boolean} 是否将本图层插入到图层id为layerID的图层之前(默认为true,如果为false则将本图层插入到图层id为layerID的图层之后)。
99+
* @param {string} layerID -待插入的图层ID。</br>
100+
* @param {boolean} beforeLayerID - 是否将本图层插入到图层id为layerID的图层之前(如果为false则将本图层插入到图层id为layerID的图层之后)。
101101
*/
102102
function moveLayer(layerID, beforeLayerID) {
103103
var layer = document.getElementById(layerID);

src/mapboxgl/core/Util.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class Util {
1111
/**
1212
* @function mapboxgl.supermap.Util.toSuperMapGeometry
1313
* @description 将 geoJSON 对象转为SuperMap几何图形
14-
* @param geoJSON - {Object} geoJSON 对象
14+
* @param {Object} geoJSON - geoJSON 对象
1515
*/
1616
static toSuperMapGeometry(geoJSON) {
1717
if (geoJSON && geoJSON.type) {
@@ -52,8 +52,8 @@ export class Util {
5252
/**
5353
* @function mapboxgl.supermap.Util.isArray
5454
* @description 判断是否为数组格式
55-
* @param obj - {Object} 待判断对象
56-
* @return {boolean} 是否是数组
55+
* @param {Object} obj - 待判断对象
56+
* @returns {boolean} 是否是数组
5757
*/
5858
static isArray(obj) {
5959
return Object.prototype.toString.call(obj) == '[object Array]'
@@ -63,7 +63,7 @@ export class Util {
6363
/**
6464
* @function mapboxgl.supermap.Util.toGeoJSON
6565
* @description 将传入对象转为 GeoJSON 格式
66-
* @param smObj - {Object} 待转参数
66+
* @param {Object} smObj - 待转参数
6767
*/
6868
static toGeoJSON(smObj) {
6969
if (smObj) {
@@ -75,8 +75,8 @@ export class Util {
7575
/**
7676
* @function mapboxgl.supermap.Util.toProcessingParam
7777
* @description 将Region节点数组转为Processing服务需要的分析参数
78-
* @param points - Region各个节点数组
79-
* @return processing服务裁剪、查询分析的分析参数
78+
* @param {Array} points - Region各个节点数组
79+
* @returns {Object} processing 服务裁剪、查询分析的分析参数
8080
*/
8181
static toProcessingParam(points) {
8282
var geometryParam = {};
@@ -99,9 +99,9 @@ export class Util {
9999
/**
100100
* @function mapboxgl.supermap.Util.extend
101101
* @description 对象拷贝赋值
102-
* @param dest - 目标对象
103-
* @param arguments - 待拷贝的对象
104-
* @return 赋值后的目标对象
102+
* @param {Object} dest - 目标对象
103+
* @param {Object} arguments - 待拷贝的对象
104+
* @returns {Object} 赋值后的目标对象
105105
*/
106106
static extend(dest) {
107107
for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {

src/mapboxgl/overlay/GraphThemeLayer.js

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@ import {Theme} from './theme/ThemeLayer';
1313
* @class mapboxgl.supermap.GraphThemeLayer
1414
* @category Visualization Theme
1515
* @classdesc 统计专题图层。
16-
* @param name - {string} 图层名。
17-
* @param chartsType -{string} 图表类别
18-
* @param opt_options - {Object} 参数。如:<br>
19-
* id - {string} 专题图层ID。</br>
20-
* loadWhileAnimating - {boolean} 是否实时重绘,默认为true。</br>
21-
* map - {mapboxgl.Map} 当前mapboxgl map对象。</br>
22-
* opacity - {number} 图层透明的。</br>
23-
* themeFields - {string} 指定创建专题图字段。 <br>
24-
* isOverLay - {boolean} 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表,默认值:true。<br>
25-
* chartsType - {string}图表类型。目前可用:"Bar", "Line", "Pie"。
26-
* symbolSetting - {Object} 符号 Circle 配置对象 symbolSetting(<SuperMap.Layer.RankSymbol::setting>) 可设属性如下:
27-
* * codomain - {Array{Number}} 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限,必设参数。
28-
* * maxR - {Number} 圆形的最大半径。
29-
* * minR - {Number} 圆形的最小半径。
30-
* * fillColor - {String} 圆形的填充色,如:fillColor: "#FFB980"。
31-
* * circleStyle - {Object} 圆形的基础 style,此参数控制圆形基础样式,优先级低于 circleStyleByFields 和 circleStyleByCodomain。
32-
* * decimalNumber - {Number} 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
33-
* * circleHoverStyle - {Object} 圆 形 hover 状态时的样式,circleHoverAble 为 true 时有效。
34-
* * circleHoverAble - {Object} 是否允许圆形使用 hover 状态,默认允许。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
35-
* * circleClickAble - {Object} 是否允许圆形被点击,默认允许。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
36-
* @extends mapboxgl.supermap.ThemeLayer
16+
* @param {string} name - 图层名。</br>
17+
* @param {string} chartsType - 图表类别</br>
18+
* @param {Object} opt_options - 参数。</br>
19+
* @param {string} opt_options.id - 专题图层ID。</br>
20+
* @param {boolean} [opt_options.loadWhileAnimating=true] - 是否实时重绘。</br>
21+
* @param {mapboxgl.Map} opt_options.map - 当前mapboxgl map对象。</br>
22+
* @param {number} opt_options.opacity - 图层透明度。</br>
23+
* @param {string} opt_options.themeFields - 指定创建专题图字段。 </br>
24+
* @param {boolean} [opt_options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表</br>
25+
* @param {string} opt_options.chartsType - 图表类型。目前可用:"Bar", "Line", "Pie"。</br>
26+
* @param {Object} opt_options.symbolSetting - 符号 Circle 配置对象</br>
27+
* @param {Array<number>} opt_options.symbolSetting.codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限,必设参数。</br>
28+
* @param {number} opt_options.symbolSetting.maxR - 圆形的最大半径。</br>
29+
* @param {number} opt_options.symbolSetting.minR - 圆形的最小半径。</br>
30+
* @param {String} opt_options.symbolSetting.fillColor - 圆形的填充色,如:fillColor: "#FFB980"。</br>
31+
* @param {Object} opt_options.symbolSetting.circleStyle - 圆形的基础 style,此参数控制圆形基础样式,优先级低于 circleStyleByFields 和 circleStyleByCodomain。</br>
32+
* @param {number} opt_options.symbolSetting.decimalNumber - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。</br>
33+
* @param {Object} opt_options.symbolSetting.circleHoverStyle - 圆形 hover 状态时的样式,circleHoverAble 为 true 时有效。</br>
34+
* @param {boolean} [opt_options.symbolSetting.circleHoverAble=true] - 是否允许圆形使用 hover 状态。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。</br>
35+
* @param {boolean} [opt_options.symbolSetting.circleClickAble=true] - 是否允许圆形被点击。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
36+
* @extends {mapboxgl.supermap.ThemeLayer}
3737
*/
3838
export class Graph extends Theme {
3939

@@ -51,7 +51,7 @@ export class Graph extends Theme {
5151
/**
5252
* @function mapboxgl.supermap.GraphThemeLayer.prototype.setChartsType
5353
* @description 设置图表类型,此函数可动态改变图表类型。在调用此函数前请通过 chartsSetting 为新类型的图表做相关配置。
54-
* @param chartsType - {string} 图表类型。目前可用:"Bar", "Line", "Pie"。
54+
* @param {string} chartsType - 图表类型。目前可用:"Bar", "Line", "Pie"。
5555
*/
5656
setChartsType(chartsType) {
5757
this.chartsType = chartsType;
@@ -61,7 +61,7 @@ export class Graph extends Theme {
6161
/**
6262
* @function mapboxgl.supermap.GraphThemeLayer.prototype.addFeatures
6363
* @description 向专题图图层中添加数据, 支持的feature类型为:iServer返回的feature json对象。
64-
* @param features - {Array<mapboxgl.supermap.ThemeFeature>} 待添加的要素
64+
* @param {Array<mapboxgl.supermap.ThemeFeature>} features - 待添加的要素
6565
*/
6666
addFeatures(features) {
6767
var ret = mapboxgl.Evented.prototype.fire('beforefeaturesadded', {features: features});
@@ -81,7 +81,7 @@ export class Graph extends Theme {
8181
* @description 重绘所有专题要素。
8282
* 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,抽稀,缓存等步骤。
8383
* 地图漫游时调用此方法进行图层刷新。
84-
* @param extent - {mapboxgl.LngLatBounds} 重绘的范围
84+
* @param {mapboxgl.LngLatBounds} extent - 重绘的范围
8585
*/
8686
redrawThematicFeatures(extent) { // eslint-disable-line no-unused-vars
8787
this.clearCache();
@@ -122,7 +122,7 @@ export class Graph extends Theme {
122122
/**
123123
* @function mapboxgl.supermap.GraphThemeLayer.prototype.createThematicFeature
124124
* @description 向专题图图层中添加数据, 支持的feature类型为:iServer返回的feature json对象
125-
* @param feature - {Object} 待填加得要素
125+
* @param {Object} feature - 待填加得要素
126126
*
127127
*/
128128
createThematicFeature(feature) {
@@ -240,7 +240,7 @@ export class Graph extends Theme {
240240
/**
241241
* @function mapboxgl.supermap.GraphThemeLayer.prototype.getShapesByFeatureID
242242
* @description 通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。
243-
* @param featureID - {number} 要素ID。
243+
* @param {number} featureID - 要素ID。
244244
*/
245245
getShapesByFeatureID(featureID) {
246246
var list = [];
@@ -260,8 +260,8 @@ export class Graph extends Theme {
260260
/**
261261
* @function mapboxgl.supermap.GraphThemeLayer.prototype.isQuadrilateralOverLap
262262
* @description 判断两个四边形是否有压盖。
263-
* @param quadrilateral - {Array<Object>} 四边形节点数组。
264-
* @param quadrilateral2 - {Array<Object>} 第二个四边形节点数组。
263+
* @param {Array<Object>} quadrilateral - 四边形节点数组。</br>
264+
* @param {Array<Object>} quadrilateral2 - 第二个四边形节点数组。
265265
*/
266266
isQuadrilateralOverLap(quadrilateral, quadrilateral2) {
267267
var quadLen = quadrilateral.length,
@@ -303,8 +303,8 @@ export class Graph extends Theme {
303303
/**
304304
* @function mapboxgl.supermap.GraphThemeLayer.prototype.isPointInPoly
305305
* @description 判断一个点是否在多边形里面。(射线法)
306-
* @param pt - {Object} 需要判定的点对象,该对象含有属性x(横坐标),属性y(纵坐标)。
307-
* @param poly - {Array<Object>} 多边形节点数组。
306+
* @param {Object} pt - 需要判定的点对象,该对象含有属性x(横坐标),属性y(纵坐标)。</br>
307+
* @param {Array<Object>} poly - 多边形节点数组。
308308
*/
309309
isPointInPoly(pt, poly) {
310310
for (var isIn = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
@@ -318,8 +318,8 @@ export class Graph extends Theme {
318318
/**
319319
* @function mapboxgl.supermap.GraphThemeLayer.prototype.isChartInMap
320320
* @description 判断图表是否在地图里。
321-
* @param mapPxBounds - {SuperMap.Bounds} 地图像素范围。
322-
* @param chartPxBounds - {Array<Object>} 图表范围的四边形节点数组。
321+
* @param {SuperMap.Bounds} mapPxBounds - 地图像素范围。</br>
322+
* @param {Array<Object>} chartPxBounds - 图表范围的四边形节点数组。
323323
*/
324324
isChartInMap(mapPxBounds, chartPxBounds) {
325325
var mb = mapPxBounds;
@@ -347,7 +347,7 @@ export class Graph extends Theme {
347347
/**
348348
* @function mapboxgl.supermap.GraphThemeLayer.prototype.removeFeatures
349349
* @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature
350-
* @param features - {Object} 要删除的要素
350+
* @param {Object} features - 要删除的要素
351351
*/
352352
removeFeatures(features) {
353353
this.clearCache();

0 commit comments

Comments
 (0)