Skip to content

Commit 6540368

Browse files
committed
fix一些文档错误。
1 parent 9e6908b commit 6540368

Some content is hidden

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

44 files changed

+2408
-1871
lines changed

dist/iclient9-leaflet.js

Lines changed: 1430 additions & 1355 deletions
Large diffs are not rendered by default.

dist/iclient9-leaflet.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iclient9-openlayers.js

Lines changed: 487 additions & 256 deletions
Large diffs are not rendered by default.

src/openlayers/control/ChangeTileVersion.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,14 @@ ol.supermap.control = ol.supermap.control || {};
1818
* orientation - {string} 方向horizontal|vertical。<br>
1919
* switch - {boolean} 是否显示上/下一个版本切换控件
2020
* @example
21-
* 用法: var control = new ol.supermap.control.ChangeTileVersion({
21+
* var control = new ol.supermap.control.ChangeTileVersion({
2222
* layer: baseLayer,
2323
* orientation: "horizontal"
2424
* });
2525
* map.addControl(control)
2626
*/
2727
export default class ChangeTileVersion extends ol.control.Control {
2828

29-
/*
30-
* @function ol.supermap.control.ChangeTileVersion.prototype.constructor
31-
* @param options -{options} 参数
32-
*/
3329
constructor(options) {
3430
options = options || {};
3531
//鼠标滑过时提示
@@ -146,7 +142,8 @@ export default class ChangeTileVersion extends ol.control.Control {
146142
else {
147143
this._sliderContainer.style.width = 150 + 'px';
148144
}
149-
/**
145+
146+
/*
150147
* @function ol.supermap.control.ChangeTileVersion.prototype.addDomEvent
151148
* @description 为元素添加事件
152149
*/
@@ -178,7 +175,6 @@ export default class ChangeTileVersion extends ol.control.Control {
178175
* @param container -{Object} 容器
179176
* @return {object|Element} 元素
180177
*/
181-
182178
function createElement(tagName, className, container) {
183179
var el = document.createElement(tagName);
184180
el.className = className || '';
@@ -198,7 +194,6 @@ export default class ChangeTileVersion extends ol.control.Control {
198194
* @param context -{Object} 当前环境
199195
* @return {addDomEvent} 添加的事件
200196
*/
201-
202197
function addDomEvent(obj, type, fn, context) {
203198
var handler = function (e) {
204199
if (fn) {
@@ -280,6 +275,7 @@ export default class ChangeTileVersion extends ol.control.Control {
280275
this._sliderValue.innerHTML = value;
281276
return this;
282277
}
278+
283279
/**
284280
* @function ol.supermap.control.ChangeTileVersion.prototype.setToolTip
285281
* @description 设置提示信息
@@ -290,6 +286,7 @@ export default class ChangeTileVersion extends ol.control.Control {
290286
this.tooltip.innerHTML = tooltip;
291287
return this;
292288
}
289+
293290
/**
294291
* @function ol.supermap.control.ChangeTileVersion.prototype.updateLength
295292
* @description 更新进度条长度
@@ -302,6 +299,7 @@ export default class ChangeTileVersion extends ol.control.Control {
302299
}
303300
return this;
304301
}
302+
305303
/**
306304
* @function ol.supermap.control.ChangeTileVersion.prototype.setLayer
307305
* @description 绑定图层
@@ -324,6 +322,7 @@ export default class ChangeTileVersion extends ol.control.Control {
324322
me.getTileSetsInfo();
325323
return this;
326324
}
325+
327326
/**
328327
* @function ol.supermap.control.ChangeTileVersion.prototype.update
329328
* @description 更新缓存切片集及进度条长度
@@ -349,6 +348,7 @@ export default class ChangeTileVersion extends ol.control.Control {
349348
}
350349
return this;
351350
}
351+
352352
/**
353353
* @function ol.supermap.control.ChangeTileVersion.prototype.removeLayer
354354
* @description 移除绑定的地图图层
@@ -375,7 +375,7 @@ export default class ChangeTileVersion extends ol.control.Control {
375375

376376
/**
377377
* @function ol.supermap.control.ChangeTileVersion.prototype.lastTilesVersion
378-
* @description 上一个版本
378+
* @description 获取上一个版本信息
379379
*/
380380
lastTilesVersion() {
381381
this.slider.value = this.slider.value - 1;
@@ -400,13 +400,15 @@ export default class ChangeTileVersion extends ol.control.Control {
400400
}
401401
}
402402
}
403+
403404
/**
404405
* @function ol.supermap.control.ChangeTileVersion.prototype.getValue
405406
* @description 获取进度条的值。注:(进度条的值并不是版本号)
406407
*/
407408
getValue() {
408409
return this.slider.value;
409410
}
411+
410412
/**
411413
* @function ol.supermap.control.ChangeTileVersion.prototype.getVersion
412414
* @description 获取当前进度条值对应的版本号

src/openlayers/control/Logo.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,20 @@ import logoSrc from '../../common/control/img/iClient.png'
33

44
ol.supermap = ol.supermap || {};
55
ol.supermap.control = ol.supermap.control || {};
6+
67
/**
78
* @class ol.supermap.control.Logo
89
* @classdesc Logo控件。默认不显示,需手动添加控件。
910
* @extends ol.control.Control{@linkdoc-openlayers/ol.control.Control}
1011
* @example
11-
* (start code)
1212
* var control = new ol.supermap.control.Logo();
1313
* map.addControl(control);
14-
* (end)
15-
* @param options -{Object} logo控件配置项</br>
16-
* imageUrl - {string} logo图片地址</br>
17-
* width - {string} logo图片宽</br>
18-
* height - {string} logo图片高</br>
19-
* link - {string} 跳转链接</br>
20-
* alt - {string} logo图片失效时显示文本
14+
* @param options - {Object} logo控件配置项。配置项有如下:</br>
15+
* imageUrl - {string} logo图片地址。</br>
16+
* width - {number} logo图片宽。</br>
17+
* height - {number} logo图片高。</br>
18+
* link - {string} 跳转链接。</br>
19+
* alt - {string} logo图片失效时显示文本。
2120
*/
2221
export default class Logo extends ol.control.Control {
2322

src/openlayers/core/StyleUtils.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@ import {DeafultCanvasStyle} from '../overlay/vectortile/DeafultCanvasStyle';
66
ol.supermap = ol.supermap || {};
77
/**
88
* @class ol.supermap.StyleUtils
9-
* @classdesc 风格工具
9+
* @classdesc 样式工具类
1010
* @private
11-
* @param map - {Object} 地图
12-
* @param layerInfo - {Object} 图层信息
13-
* @param feature - {Object} 特征
14-
* @param url - {string} 地址
1511
*/
1612
export default class StyleUtils {
1713

14+
/**
15+
* @function ol.supermap.StyleUtils.getValidStyleFromLayerInfo
16+
* @description 通过图层信息获取有效的样式
17+
* @param layerInfo - {Object} 图层信息
18+
* @param feature - {ol.Feature}{@linkdoc-openlayers/ol.Feature} 要素
19+
* @param url - {string} 图层数据地址
20+
* @return {ol.style.Style}
21+
*/
1822
static getValidStyleFromLayerInfo(layerInfo, feature, url) {
1923
var type = feature.getGeometry().getType().toUpperCase(),
2024
shader = layerInfo.layerStyle,
@@ -228,7 +232,6 @@ export default class StyleUtils {
228232
* @param feature -{Object} 要素
229233
* @param fromServer -{string} 服务源
230234
* @param url -{string} 地址
231-
*
232235
*/
233236
static getStyleFromCarto(zoom, scale, shader, feature, fromServer, url) {
234237
var type = feature.getGeometry().getType().toUpperCase(),
@@ -455,7 +458,7 @@ export default class StyleUtils {
455458
* @description 从iPortal标记获取样式
456459
* @param iPortalStyle -{Object} iportal样式
457460
* @param type - {string} 样式类型
458-
* @param fStyle -{Object} 特征样式
461+
* @param fStyle -{Object} 要素样式
459462
*/
460463
static getStyleFromiPortalStyle(iPortalStyle, type, fStyle) {
461464
var featureStyle = fStyle ? JSON.parse(fStyle) : null;

src/openlayers/core/Util.js

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,34 @@ import ol from 'openlayers/dist/ol-debug';
22
import SuperMap from '../../common/SuperMap';
33
import GeoJSONFormat from '../../common/format/GeoJSON';
44
ol.supermap = ol.supermap || {};
5+
56
/**
67
* @class ol.supermap.Util
78
* @classdesc 工具类
8-
* @private
99
*/
1010
export default class Util {
1111

1212
constructor() {
1313

1414
}
1515

16+
/**
17+
* @function ol.supermap.Util.toGeoJSON
18+
* @description 将传入对象转为 GeoJSON 格式
19+
* @param smObj - {Object} 待转参数
20+
*/
1621
static toGeoJSON(smObj) {
1722
if (smObj) {
1823
var format = new GeoJSONFormat();
1924
return JSON.parse(format.write(smObj));
2025
}
2126
}
2227

28+
/**
29+
* @function ol.supermap.Util.toSuperMapGeometry
30+
* @description 将 geoJSON 对象转为SuperMap几何图形
31+
* @param geoJSON - {Object} geoJSON 对象
32+
*/
2333
static toSuperMapGeometry(geoJSON) {
2434
if (geoJSON && geoJSON.type) {
2535
var format = new GeoJSONFormat();
@@ -28,6 +38,14 @@ export default class Util {
2838
}
2939
}
3040

41+
/**
42+
* @function ol.supermap.Util.resolutionToScale
43+
* @description 通过分辨率计算比例尺
44+
* @param resolution - {number} 分辨率
45+
* @param dpi - {number} 屏幕分辨率
46+
* @param mapUnit - {string} 地图单位
47+
* @return {number} 比例尺
48+
*/
3149
static resolutionToScale(resolution, dpi, mapUnit) {
3250
var inchPerMeter = 1 / 0.0254;
3351
// 地球半径。
@@ -37,6 +55,12 @@ export default class Util {
3755
return scale;
3856
}
3957

58+
/**
59+
* @function ol.supermap.Util.toSuperMapBounds
60+
* @description 转为SuperMapBounds格式
61+
* @param bounds {Array<number>} bounds数组
62+
* @return {SuperMap.Bounds}
63+
*/
4064
static toSuperMapBounds(bounds) {
4165
return new SuperMap.Bounds(
4266
bounds[0],
@@ -46,6 +70,14 @@ export default class Util {
4670
);
4771
}
4872

73+
/**
74+
* @function ol.supermap.Util.scaleToResolution
75+
* @description 通过比例尺计算分辨率
76+
* @param scale - {number} 比例尺
77+
* @param dpi - {number} 屏幕分辨率
78+
* @param mapUnit - {string} 地图单位
79+
* @return {number} 分辨率
80+
*/
4981
static scaleToResolution(scale, dpi, mapUnit) {
5082
var inchPerMeter = 1 / 0.0254;
5183
var meterPerMapUnitValue = this.getMeterPerMapUnit(mapUnit);
@@ -54,6 +86,13 @@ export default class Util {
5486
return resolution;
5587
}
5688

89+
/**
90+
* @private
91+
* @function ol.supermap.Util.getMeterPerMapUnit
92+
* @description 获取每地图单位多少米
93+
* @param mapUnit mapUnit - {string} 地图单位
94+
* @return {number}
95+
*/
5796
static getMeterPerMapUnit(mapUnit) {
5897
var earchRadiusInMeters = 6378137;
5998
var meterPerMapUnit;
@@ -74,10 +113,22 @@ export default class Util {
74113
return meterPerMapUnit;
75114
}
76115

116+
/**
117+
* @function ol.supermap.Util.isArray
118+
* @description 判断是否为数组格式
119+
* @param obj - {Object} 待判断对象
120+
* @return {boolean}
121+
*/
77122
static isArray(obj) {
78123
return Object.prototype.toString.call(obj) == '[object Array]'
79124
}
80125

126+
/**
127+
* @function ol.supermap.Util.Csv2GeoJSON
128+
* @description 将 csv 格式转为 GeoJSON
129+
* @param csv - {Object} csv 对象
130+
* @param options - {Object} 转换参数
131+
*/
81132
static Csv2GeoJSON(csv, options) {
82133
var defaultOptions = {
83134
titles: ['lon', 'lat'],
@@ -151,6 +202,12 @@ export default class Util {
151202
}
152203
}
153204

205+
/**
206+
* @function ol.supermap.Util.createCanvasContext2D
207+
* @description 创建2D画布
208+
* @param opt_width - {number} 画布宽度
209+
* @param opt_height - {number} 画布高度
210+
*/
154211
static createCanvasContext2D(opt_width, opt_height) {
155212
var canvas = document.createElement('CANVAS');
156213
if (opt_width) {

src/openlayers/mapping/Baidu.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ import ol from 'openlayers/dist/ol-debug';
22
/**
33
* @class ol.source.Baidu
44
* @classdesc 百度地图
5-
* @param opt_options - {Object} 参数
5+
* @param opt_options - {Object} 创建地图参数可选参数:<br>
6+
* url - {string} 服务地址。<br>
7+
* attributions - {string} 版权描述信息。<br>
8+
* cacheSize - {number} 缓冲大小。<br>
9+
* tileLoadFunction - {function} 切片加载完成后执行函数。<br>
10+
* maxZoom - {Object} 最大缩放级别。<br>
11+
* opaque - {boolean} 是否透明。
612
* @extends ol.source.TileImage{@linkdoc-openlayers/ol.source.TileImage}
713
*/
814
export default class Baidu extends ol.source.TileImage {
@@ -49,9 +55,10 @@ export default class Baidu extends ol.source.TileImage {
4955
}
5056
});
5157
}
58+
5259
/**
5360
* @function ol.source.Baidu.defaultTileGrid
54-
* @description 自定义网格切片
61+
* @description 获取默认瓦片格网
5562
* @return {ol.tilegrid.TileGrid}
5663
*/
5764
static defaultTileGrid() {

src/openlayers/mapping/ImageSuperMapRest.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ import Util from '../core/Util';
55

66
/**
77
* @class ol.source.ImageSuperMapRest
8-
* @classdesc UGC 影像图层类。
9-
* @param options - {Object} 参数
8+
* @classdesc SuperMap UGC 对接iServer地图Image资源。
9+
* @param options - {Object} 服务参数:<br>
10+
* url - {string} 服务地址。<br>
11+
* attributions - {string} 版权描述信息。<br>
12+
* serverType {SuperMap.ServerType} 服务类型。
1013
* @extends ol.source.TileImage{@linkdoc-openlayers/ol.source.TileImage}
1114
*/
1215
export default class ImageSuperMapRest extends ol.source.TileImage {
@@ -23,7 +26,8 @@ export default class ImageSuperMapRest extends ol.source.TileImage {
2326
options.serverType = options.serverType || SuperMap.ServerType.ISERVER;
2427
//为url添加安全认证信息片段
2528
layerUrl = appendCredential(layerUrl, options.serverType);
26-
/**
29+
30+
/*
2731
* @function ol.source.ImageSuperMapRest.prototype.appendCredential
2832
* @description 添加凭据
2933
* @param url - {string} 地址
@@ -101,7 +105,7 @@ export default class ImageSuperMapRest extends ol.source.TileImage {
101105
if (options.cacheEnabled === true && options.tileversion) {
102106
layerUrl += "tileversion=" + options.tileversion;
103107
}
104-
/**
108+
/*
105109
* @function ol.source.ImageSuperMapRest.prototype.tileUrlFunction
106110
* @param tileCoord - {Object} 瓦片坐标系
107111
* @param pixelRatio - {Object} 像素密度
@@ -141,6 +145,7 @@ export default class ImageSuperMapRest extends ol.source.TileImage {
141145
layersID: options.layersID
142146
});
143147
}
148+
144149
/**
145150
* @function ol.source.ImageSuperMapRest.optionsFromMapJSON
146151
* @param url - {string} 地址

src/openlayers/mapping/SuperMapCloud.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ import ol from 'openlayers/dist/ol-debug';
22
/**
33
* @class ol.source.SuperMapCloud
44
* @classdesc 超图云
5-
* @param opt_options - {olx.source.XYZOptions} 参数
5+
* @param opt_options - {Object} 可选参数:如:<br>
6+
* url - {string} 服务地址。<br>
7+
* attributions - {string} 版权描述信息。<br>
8+
* cacheSize - {number} 缓冲大小。<br>
9+
* tileLoadFunction - {function} 切片加载完成后执行函数。<br>
10+
* maxZoom - {Object} 最大缩放级别。<br>
11+
* opaque - {boolean} 是否透明。
612
* @extends ol.source.XYZ{@linkdoc-openlayers/ol.source.XYZ}
713
*/
814
export default class SuperMapCloud extends ol.source.XYZ {

0 commit comments

Comments
 (0)