Skip to content

Commit caf843b

Browse files
committed
leaflet & openlayers api 可选参数优化 review by songym
1 parent 3fb1c48 commit caf843b

24 files changed

+41
-39
lines changed

src/leaflet/core/Transform.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import {CommonUtil} from '@supermap/iclient-common';
44
/**
55
* @function L.Util.transform
66
* @description 将要素转换为指定坐标。
7-
* @param {(L.marker|L.circleMarker|L.polyline|L.polygon|L.rectangle|L.latLngBounds|L.bounds|Object)} feature - 待转要素包括 Leaflet Vector Layers
8-
* 的 L.marker|L.circleMarker|L.polyline|L.polygon|L.rectangle|L.latLngBounds|L.bounds 类型和 GeoJOSN 规范数据类型
9-
* @param {L.Proj.CRS} [sourceCRS=L.CRS.EPSG4326] - 要素转换目标坐标系,默认为 L.CRS.EPSG4326
10-
* @param {L.Proj.CRS} targetCRS - 要素转换目标坐标系
11-
* @return {Object} 返回GeoJOSN 规范数据类型
7+
* @param {(L.Marker|L.CircleMarker|L.Polyline|L.Polygon|L.Rectangle|L.LatLngBounds|L.Bounds|Object)} feature - 待转要素包括 Leaflet Vector Layers
8+
* 的 {@link L.Marker}|{@link L.CircleMarker}|{@link L.Polyline}|{@link L.Polygon}|{@link L.Rectangle}|{@link L.LatLngBounds}|{@link L.Bounds} 类型和 GeoJOSN 规范数据类型
9+
* @param {L.Proj.CRS} [sourceCRS=L.CRS.EPSG4326] - 要素转换源坐标系。
10+
* @param {L.Proj.CRS} targetCRS - 要素转换目标坐标系
11+
* @return {Object} 返回 GeoJOSN 规范数据类型
1212
*/
1313
export var transform = function (feature, sourceCRS = L.CRS.EPSG4326, targetCRS) {
1414
let selfFeatures = null;

src/leaflet/mapping/TileLayer.WMTS.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import "../core/Base";
1313
* @param {string} [options.tileProxy] - 启用托管地址。
1414
* @param {Object} [options.style] - 图层样式。
1515
* @param {string} [options.format='image/png'] - wmts 图像格式('image/png'用于具有透明度的图层)。
16-
* @param {string} [options.tileSize='256'] - 瓦片大小。
16+
* @param {(number|L.Point)} [options.tileSize='256'] - 瓦片大小。
1717
* @param {string} [options.requestEncoding='KVP'] - KVP 或者 REST 的请求方式。
1818
* @param {Object} [options.tilematrixSet] - 瓦片矩阵集。
1919
* @param {string} [options.attribution] - 版权信息。

src/leaflet/mapping/TiledMapLayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import Attributions from '../core/Attributions'
3535
* @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权信息。
3636
* @param {string} [options.tileProxy] - 启用托管地址。
3737
* @param {string} [options.format='png'] - 瓦片表述类型,支持 "png" 、"bmp" 、"jpg" 和 "gif" 四种表述类型。
38-
* @param {string} [options.tileSize] - 瓦片大小。
38+
* @param {(number|L.Point)} [options.tileSize=256] - 瓦片大小。
3939
*/
4040
export var TiledMapLayer = L.TileLayer.extend({
4141

src/leaflet/mapping/WebMap.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,8 @@ export var WebMap = L.LayerGroup.extend({
437437
* @function L.supermap.webmap.prototype.createWmsLayer
438438
* @description 创建 Wms 图层。
439439
* @param {Object} layerInfo - 图层信息。
440+
* @returns {L.Layer} 返回 Wms 图层对象。
441+
440442
*/
441443
createWmsLayer: function (layerInfo) {
442444
var url = layerInfo.url,

src/leaflet/overlay/DataFlowLayer.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import {
1212

1313
/**
1414
* @class L.supermap.dataFlowLayer
15-
* @classdesc 实时数据图层源
15+
* @classdesc 数据流图层源
1616
* @category iServer DataFlow
1717
* @extends {L.LayerGroup}
18-
* @param {string} url - 实时数据图层服务地址
18+
* @param {string} url - 数据流图层服务地址
1919
* @param {Object} options - 设置图层参数。
2020
* @param {Object} [options.render='normal'] - 绘制方式。可选值为'normal','mapv'。</br>
2121
'normal' 表示以 {( {@link L.LatLng}|{@link L.Polyline}|{@link L.Polygon}|{@link L.Marker} )} 方式绘制实时数据。'mapv' 表示以 {@link L.supermap.mapVLayer} 方式绘制实时数据。
@@ -71,16 +71,16 @@ export var DataFlowLayer = L.LayerGroup.extend({
7171
excludeField: this.options.excludeField
7272
}).initSubscribe();
7373
/**
74-
* @description 初始化成功后触发。
7574
* @event L.supermap.dataFlowLayer#subscribesuccessed
75+
* @description 初始化成功后触发。
7676
* @property {Object} e - 事件对象。
7777
*
7878
*/
7979
this.dataService.on('subscribeSocketConnected', (e) => this.fire("subscribesuccessed", e));
8080
this.dataService.on('messageSuccessed', (msg) => this._onMessageSuccessed(msg));
8181
/**
82-
* @description 过滤参数设置成功后触发。
8382
* @event L.supermap.dataFlowLayer#setfilterparamsuccessed
83+
* @description 过滤参数设置成功后触发。
8484
* @property {Object} e - 事件对象。
8585
*/
8686
this.dataService.on('setFilterParamSuccessed', (msg) => this.fire("setfilterparamsuccessed", msg));
@@ -115,7 +115,7 @@ export var DataFlowLayer = L.LayerGroup.extend({
115115
/**
116116
* @function L.supermap.dataFlowLayer.prototype.setGeometry
117117
* @description 设置集合要素。
118-
* @param {Object} geometry - 待设置的GeoJSON几何要素对象
118+
* @param {Object} geometry - 待设置的 GeoJSON 几何要素对象
119119
*/
120120
setGeometry: function (geometry) {
121121
this.dataService.setGeometry(geometry);

src/leaflet/overlay/GraphicLayer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const CSS_TRANSFORM = (function () {
4646
* @extends {L.Path}
4747
* @param {Array.<L.supermap.graphic>} graphics - 要素对象。
4848
* @param {Object} options - 图层参数。
49-
* @param {string} [options.render='canvas'] - 指定使用的渲染器。可选值:"webgl","canvas"(webgl渲染目前只支持散点)
49+
* @param {string} [options.render='canvas'] - 指定使用的渲染器。可选值:"webgl","canvas"webgl渲染目前只支持散点
5050
* @param {Array.<number>} [options.color=[0, 0, 0, 255]] - 要素颜色。
5151
* @param {Array.<number>} [options.highlightColor] - webgl 渲染时要素高亮颜色。
5252
* @param {number} [options.opacity=0.8] - 要素透明度。
@@ -143,7 +143,7 @@ export var GraphicLayer = L.Path.extend({
143143
* @param {Array.<number>} [styleOptions.color=[0, 0, 0, 255]] - 点颜色。
144144
* @param {number} [styleOptions.radius=10] - 点半径。
145145
* @param {number} [styleOptions.opacity=0.8] - 不透明度。
146-
* @param {Array} [styleOptions.highlightColor] - 高亮颜色,目前只支持rgba数组
146+
* @param {Array} [styleOptions.highlightColor] - 高亮颜色,目前只支持 rgba 数组
147147
* @param {number} [styleOptions.radiusScale=1] - 点放大倍数。
148148
* @param {number} [styleOptions.radiusMinPixels=0] - 半径最小值(像素)。
149149
* @param {number} [styleOptions.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。

src/leaflet/overlay/HeatMapLayer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Attributions from '../core/Attributions'
1717
* @category Visualization HeatMap
1818
* @param {string} name - 图层名称。
1919
* @param {boolean} [loadWhileAnimating=true] - 是否实时重绘。(当绘制大数据量要素的情况下会出现卡顿,建议把该参数设为 false)。
20-
* @param {Array.<string>} [colors=['blue', 'cyan', 'lime', 'yellow', 'red']] - 颜色线性渐变数组,颜色值必须为 canvas 所支持的。
20+
* @param {Array.<string>} [colors=['blue', 'cyan', 'lime', 'yellow', 'red']] - 颜色线性渐变数组颜色值必须为 canvas 所支持的。
2121
* @param {Object} options - 构造参数。
2222
* @param {L.Map} options.map - leaflet 的 map 对象。
2323
* @param {string} [options.id] - 专题图层 ID,默认使用 CommonUtil.createUniqueID("heatMapLayer_") 创建专题图层 ID。
@@ -121,7 +121,7 @@ export var HeatMapLayer = L.Layer.extend({
121121
/**
122122
* @function L.supermap.heatMapLayer.prototype.addFeatures
123123
* @description 添加热点信息。
124-
* @param {(Object|HeatMapFeature)} features - 待添加的要素数组,支持 GeoJOSN 规范数据类型和 HeatMapFeature 格式。
124+
* @param {(Object|HeatMapFeature)} features - 待添加的要素数组支持 GeoJOSN 规范数据类型和 HeatMapFeature 格式。
125125
*
126126
* @example
127127
* var geojson = {

src/leaflet/overlay/LabelThemeLayer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ export var LabelThemeLayer = GeoFeatureThemeLayer.extend({
679679
* @function L.supermap.LabelThemeLayer.prototype.rotationBounds
680680
* @description 旋转 bounds。
681681
*
682-
* @param {SuperMap.Bounds} bounds - 要旋转的bounds
682+
* @param {SuperMap.Bounds} bounds - 要旋转的 bounds
683683
* @param {Object} rotationCenterPoi - 旋转中心点对象,此对象含有属性x(横坐标),属性y(纵坐标)。
684684
* @param {number} angle - 旋转角度(顺时针)。
685685
*
@@ -717,7 +717,7 @@ export var LabelThemeLayer = GeoFeatureThemeLayer.extend({
717717
* @param {number} ry - 旋转中心点纵坐标。
718718
* @param {number} angle - 旋转角度。
719719
*
720-
* @return {Object} 旋转后的坐标位置对象,该对象含有属性x(横坐标),属性y(纵坐标)
720+
* @return {Object} 旋转后的坐标位置对象,该对象含有属性 x(横坐标),属性 y(纵坐标
721721
*/
722722
getRotatedLocation: function (x, y, rx, ry, angle) {
723723
var loc = {}, x0, y0;
@@ -882,7 +882,7 @@ export var LabelThemeLayer = GeoFeatureThemeLayer.extend({
882882
* @function L.supermap.LabelThemeLayer.prototype.isPointInPoly
883883
* @description 判断一个点是否在多边形里面。(射线法)。
884884
*
885-
* @param {Object} pt - 需要判定的点对象,该对象含有属性x(横坐标),属性y(纵坐标)
885+
* @param {Object} pt - 需要判定的点对象,该对象含有属性 x(横坐标),属性 y(纵坐标
886886
* @param {Array.<Object>} poly - 多边形节点数组。例如一个四边形:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
887887
* @return {boolean} 点是否在多边形内。
888888
*/

src/leaflet/overlay/RankSymbolThemeLayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export var RankSymbolThemeLayer = GraphThemeLayer.extend({
3333
* @property {number} [minR] - 圆形的最小半径。
3434
* @property {String} [fillColor] - 圆形的填充色,如:fillColor: "#FFB980"。
3535
* @property {Object} [circleStyle] - 圆形的基础 style,此参数控制圆形基础样式,优先级低于 circleStyleByFields 和 circleStyleByCodomain。
36-
* @property {number} [odecimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
36+
* @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
3737
* @property {Object} [circleHoverStyle] - 圆形 hover 状态时的样式,circleHoverAble 为 true 时有效。
3838
* @property {boolean} [circleHoverAble=true] - 是否允许圆形使用 hover 状态。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
3939
* @property {boolean} [circleClickAble=true] - 是否允许圆形被点击。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。

src/leaflet/overlay/TileVectorLayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import Attributions from '../core/Attributions'
3333
* @param {boolean} [option.returnAttributes=false] - 是否返回 attributes。
3434
* @param {string} [option.expands] - expands。
3535
* @param {boolean} [options.cacheEnabled=true] - 是否使用服务器缓存出图。
36-
* @param {Object} [options.tileTemplate] - /瓦片模板,如果设置了此参数,则按此模板出图,URL 无效(对接第三方瓦片)。
36+
* @param {Object} [options.tileTemplate] - 瓦片模板,如果设置了此参数,则按此模板出图,URL 无效(对接第三方瓦片)。
3737
* @param {string} [options.subdomains] - 子域名。
3838
* @param {num} [options.timeout=10000] - timeout。
3939
* @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>`] - 版权信息。

0 commit comments

Comments
 (0)