Skip to content

Commit e48400b

Browse files
committed
openlayer & leaflet & common 下 api 参数优化 review by songym
1 parent 2f0f24a commit e48400b

File tree

111 files changed

+751
-739
lines changed

Some content is hidden

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

111 files changed

+751
-739
lines changed

build/jsdocs/template/typeLinkExt.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var typeLinks = {
1111
"ol.geom.Polygon": olapi + "ol.geom.Polygon.html",
1212
"ol.geom.LineString": olapi + "ol.geom.LineString.html",
1313
"ol.geom.Point": olapi + "ol.geom.Point.html",
14+
"ol.geom.Geometry":olapi + "ol.geom.Geometry.html",
1415
"ol.format.GeoJSON": olapi + "ol.format.GeoJSON.html",
1516
"ol.proj.Projection": olapi + "ol.proj.Projection",
1617
"ol.Observable": olapi + "ol.Observable",
@@ -27,6 +28,7 @@ var typeLinks = {
2728
"ol.Pixel": olapi + "ol.html#.Pixel",
2829
"ol.source.State": olapi + "ol.source.html#.State",
2930
"ol.layer.Layer": olapi + "ol.layer.Layer.html",
31+
"ol.FeatureStyleFunction": olapi + "ol.html#.FeatureStyleFunction",
3032

3133

3234
//leaflet
@@ -48,6 +50,7 @@ var typeLinks = {
4850
"L.TileLayer": lfapi + '#tilelayer',
4951
"L.CircleMarker": lfapi + '#circlemarker',
5052
"L.Path-option": lfapi + '#path-option',
53+
"L.Rectangle": lfapi + '#rectangle',
5154

5255
//mapboxgl
5356
"mapboxgl.Evented": mbglapi + '#Evented',

src/common/commontypes/Util.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export var Util = SuperMap.Util = SuperMap.Util || {};
1818
* SuperMap.Util.extend(obj, size);
1919
* @param {Object} [destination] - 目标对象。
2020
* @param {Object} source - 源对象,其属性将被设置到目标对象上。
21-
* @return {Object} 目标对象。
21+
* @returns {Object} 目标对象。
2222
*/
2323

2424
SuperMap.Util.extend = function (destination, source) {
@@ -97,7 +97,7 @@ SuperMap.Util.reset = function (obj) {
9797

9898
/**
9999
* @description 获取 HTML 元素数组。
100-
* @return {Array.<HTMLElement>} HTML 元素数组。
100+
* @returns {Array.<HTMLElement>} HTML 元素数组。
101101
*/
102102
SuperMap.Util.getElement = function () {
103103
var elements = [];
@@ -118,7 +118,7 @@ SuperMap.Util.getElement = function () {
118118
/**
119119
* @description instance of 的跨浏览器实现。
120120
* @param {Object} o - 对象。
121-
* @return {boolean} 是否是页面元素。
121+
* @returns {boolean} 是否是页面元素。
122122
*/
123123
SuperMap.Util.isElement = function (o) {
124124
return !!(o && o.nodeType === 1);
@@ -127,7 +127,7 @@ SuperMap.Util.isElement = function (o) {
127127
/**
128128
* @description 判断一个对象是否是数组。
129129
* @param {Object} a - 对象。
130-
* @return {boolean} 是否是数组。
130+
* @returns {boolean} 是否是数组。
131131
*/
132132
SuperMap.Util.isArray = function (a) {
133133
return (Object.prototype.toString.call(a) === '[object Array]');
@@ -138,7 +138,7 @@ SuperMap.Util.isArray = function (a) {
138138
* @description 从数组中删除某一项。
139139
* @param {Array} array - 数组。
140140
* @param {Object} item - 数组中要删除的一项。
141-
* @return {Array} 执行删除操作后的数组。
141+
* @returns {Array} 执行删除操作后的数组。
142142
*/
143143
SuperMap.Util.removeItem = function (array, item) {
144144
for (var i = array.length - 1; i >= 0; i--) {
@@ -154,7 +154,7 @@ SuperMap.Util.removeItem = function (array, item) {
154154
* @description 获取某对象再数组中的索引值。
155155
* @param {Array} array - 数组。
156156
* @param {Object} obj - 对象。
157-
* @return {number} 某对象再数组中的索引值。
157+
* @returns {number} 某对象再数组中的索引值。
158158
*/
159159
SuperMap.Util.indexOf = function (array, obj) {
160160
if (array == null) {
@@ -228,7 +228,7 @@ SuperMap.Util.modifyDOMElement = function (element, id, px, sz, position,
228228
* @param {Object} from - 源对象。Any properties of this object that
229229
* are undefined in the to object will be set on the to object.
230230
*
231-
* @return {Object} A reference to the to object. Note that the to argument is modified
231+
* @returns {Object} A reference to the to object. Note that the to argument is modified
232232
* in place and returned by this function.
233233
*/
234234
SuperMap.Util.applyDefaults = function (to, from) {
@@ -265,7 +265,7 @@ SuperMap.Util.applyDefaults = function (to, from) {
265265
/**
266266
* @description 将参数对象转换为 HTTP 的 GET 请求中的参数字符串。例如:"key1=value1&key2=value2&key3=value3"。
267267
* @param {Object} params - 参数对象。
268-
* @return {string} HTTP 的 GET 请求中的参数字符串。
268+
* @returns {string} HTTP 的 GET 请求中的参数字符串。
269269
*/
270270
SuperMap.Util.getParameterString = function (params) {
271271
var paramsArray = [];
@@ -300,7 +300,7 @@ SuperMap.Util.getParameterString = function (params) {
300300
* @description 给 URL 追加参数。
301301
* @param {string} url - 待追加参数的 URL 字符串。
302302
* @param {string} paramStr - 待追加的参数。
303-
* @return {string} 新的 URL。
303+
* @returns {string} 新的 URL。
304304
*/
305305
SuperMap.Util.urlAppend = function (url, paramStr) {
306306
var newUrl = url;
@@ -324,7 +324,7 @@ SuperMap.Util.DEFAULT_PRECISION = 14;
324324
* @description 将字符串以接近的精度转换为数字。
325325
* @param {string} number - 字符串。
326326
* @param {number} [precision=14] - 精度。
327-
* @return {number} 数字。
327+
* @returns {number} 数字。
328328
*/
329329
SuperMap.Util.toFloat = function (number, precision) {
330330
if (precision == null) {
@@ -340,7 +340,7 @@ SuperMap.Util.toFloat = function (number, precision) {
340340
/**
341341
* @description 角度转弧度。
342342
* @param {number} x - 角度。
343-
* @return {number} 弧度。
343+
* @returns {number} 弧度。
344344
*/
345345
SuperMap.Util.rad = function (x) {
346346
return x * Math.PI / 180;
@@ -349,7 +349,7 @@ SuperMap.Util.rad = function (x) {
349349
/**
350350
* @description 从URL字符串中解析出参数对象。
351351
* @param {string} url - URL。
352-
* @return {Object} 解析出的参数对象。
352+
* @returns {Object} 解析出的参数对象。
353353
*/
354354
SuperMap.Util.getParameters = function (url) {
355355
// if no url specified, take it from the location bar
@@ -410,7 +410,7 @@ SuperMap.Util.lastSeqID = 0;
410410
/**
411411
* @description 创建唯一 ID 值。
412412
* @param {string} [prefix] - 前缀。
413-
* @return {string} 唯一的 ID 值。
413+
* @returns {string} 唯一的 ID 值。
414414
*/
415415
SuperMap.Util.createUniqueID = function (prefix) {
416416
if (prefix == null) {
@@ -531,7 +531,7 @@ SuperMap.DOTS_PER_INCH = 96;
531531

532532
/**
533533
* @param {number} scale - 比例尺。
534-
* @return {number} 返回正常的 scale 值。
534+
* @returns {number} 返回正常的 scale 值。
535535
*/
536536
SuperMap.Util.normalizeScale = function (scale) {
537537
var normScale = (scale > 1.0) ? (1.0 / scale) : scale;
@@ -542,7 +542,7 @@ SuperMap.Util.normalizeScale = function (scale) {
542542
* @description 比例尺转分辨率。
543543
* @param {number} scale - 比例尺。
544544
* @param {string} [units='degrees'] - 比例尺单位。
545-
* @return {number} 分辨率。
545+
* @returns {number} 分辨率。
546546
*/
547547
SuperMap.Util.getResolutionFromScale = function (scale, units) {
548548
var resolution;
@@ -561,7 +561,7 @@ SuperMap.Util.getResolutionFromScale = function (scale, units) {
561561
* @description 分辨率转比例尺。
562562
* @param {number} resolution - 分辨率。
563563
* @param {string} [units='degrees'] - 分辨率单位。
564-
* @return {number} 比例尺。
564+
* @returns {number} 比例尺。
565565
*/
566566
SuperMap.Util.getScaleFromResolution = function (resolution, units) {
567567

@@ -628,15 +628,15 @@ SuperMap.Browser = (function () {
628628

629629
/**
630630
* @description 获取浏览器相关信息。支持的浏览器包括:Opera,Internet Explorer,Safari,Firefox。
631-
* @return {Object} 获取浏览器名称、版本、设备名称。对应的属性分别为 name, version, device。
631+
* @returns {Object} 获取浏览器名称、版本、设备名称。对应的属性分别为 name, version, device。
632632
*/
633633
SuperMap.Util.getBrowser = function () {
634634
return SuperMap.Browser;
635635
};
636636

637637
/**
638638
* @description 浏览器是否支持 Canvas。
639-
* @return {boolean} 获取当前浏览器是否支持 HTML5 Canvas。
639+
* @returns {boolean} 获取当前浏览器是否支持 HTML5 Canvas。
640640
*/
641641
SuperMap.Util.isSupportCanvas = (function () {
642642
var checkRes = true, broz = SuperMap.Util.getBrowser();
@@ -661,7 +661,7 @@ SuperMap.Util.isSupportCanvas = (function () {
661661

662662
/**
663663
* @description 判断;浏览器是否支持 Canvas。
664-
* @return {boolean} 获取当前浏览器是否支持 HTML5 Canvas 。
664+
* @returns {boolean} 获取当前浏览器是否支持 HTML5 Canvas 。
665665
*/
666666
SuperMap.Util.supportCanvas = function () {
667667
return SuperMap.Util.isSupportCanvas;
@@ -679,7 +679,7 @@ SuperMap.INCHES_PER_UNIT["yard"] = SuperMap.INCHES_PER_UNIT.yd;
679679
/**
680680
* @description 判断一个 URL 请求是否在当前域中。
681681
* @param {string} url - URL 请求字符串。
682-
* @return {boolean} URL 请求是否在当前域中。
682+
* @returns {boolean} URL 请求是否在当前域中。
683683
*/
684684
SuperMap.Util.isInTheSameDomain = function (url) {
685685
if (!url) {
@@ -734,7 +734,7 @@ SuperMap.Util.isInTheSameDomain = function (url) {
734734
* @param {number} scale - 地图初始化时默认的显示比例尺。
735735
* @param {string} [coordUnit='degrees'] - 投影坐标系统的地图单位。
736736
* @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的Options时,若未指定该参数的值,则系统默认为WGS84参考系的椭球体长半轴6378137。
737-
* @return {number} 返回图层显示分辨率。
737+
* @returns {number} 返回图层显示分辨率。
738738
*/
739739
SuperMap.Util.calculateDpi = function (viewBounds, viewer, scale, coordUnit, datumAxis) {
740740
//10000 是 0.1毫米与米的转换。DPI的计算公式:Viewer / DPI * 0.0254 * 10000 = ViewBounds * scale ,公式中的10000是为了提高计算结果的精度,以下出现的ratio皆为如此。
@@ -766,7 +766,7 @@ SuperMap.Util.calculateDpi = function (viewBounds, viewer, scale, coordUnit, dat
766766
/**
767767
* @description 将对象转换成 JSON 字符串。
768768
* @param {Object} obj - 要转换成 JSON 的 Object 对象。
769-
* @return {string} 返回转换后的 JSON 对象。
769+
* @returns {string} 返回转换后的 JSON 对象。
770770
*/
771771
SuperMap.Util.toJSON = function (obj) {
772772
var objInn = obj;
@@ -841,7 +841,7 @@ SuperMap.Util.toJSON = function (obj) {
841841
* @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
842842
* @param {string} [coordUnit] - 投影坐标系统的地图单位。
843843
* @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
844-
* @return {number} 返回当前比例尺下的屏幕分辨率。
844+
* @returns {number} 返回当前比例尺下的屏幕分辨率。
845845
*/
846846
SuperMap.Util.getResolutionFromScaleDpi = function (scale, dpi, coordUnit, datumAxis) {
847847
var resolution = null,
@@ -869,7 +869,7 @@ SuperMap.Util.getResolutionFromScaleDpi = function (scale, dpi, coordUnit, datum
869869
* @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
870870
* @param {string} [coordUnit] - 投影坐标系统的地图单位。
871871
* @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
872-
* @return {number} 返回当前屏幕分辨率下的比例尺。
872+
* @returns {number} 返回当前屏幕分辨率下的比例尺。
873873
*/
874874
SuperMap.Util.getScaleFromResolutionDpi = function (resolution, dpi, coordUnit, datumAxis) {
875875
var scale = null,
@@ -892,7 +892,7 @@ SuperMap.Util.getScaleFromResolutionDpi = function (resolution, dpi, coordUnit,
892892
/**
893893
* @description 转换查询结果。
894894
* @param {Object} result - 查询结果。
895-
* @return {Object} 转换后的查询结果。
895+
* @returns {Object} 转换后的查询结果。
896896
*/
897897
SuperMap.Util.transformResult = function (result) {
898898
if (result.responseText && typeof result.responseText === "string") {
@@ -957,7 +957,7 @@ SuperMap.Util.copyAttributesWithClip = function (destination, source, clip) {
957957
/**
958958
* @description 克隆一份Object对象
959959
* @param {Object} obj - 需要克隆的对象。
960-
* @return {Object} 返回对象的拷贝对象,注意是新的对象,不是指向。
960+
* @returns {Object} 返回对象的拷贝对象,注意是新的对象,不是指向。
961961
*/
962962
SuperMap.Util.cloneObject = function (obj) {
963963
// Handle the 3 simple types, and null or undefined
@@ -998,7 +998,7 @@ SuperMap.Util.cloneObject = function (obj) {
998998
* @param {SuperMap.Geometry.Point} a2 - 第一条线段的结束节点。
999999
* @param {SuperMap.Geometry.Point} b1 - 第二条线段的起始节点。
10001000
* @param {SuperMap.Geometry.Point} b2 - 第二条线段的结束节点。
1001-
* @return {Object} 如果相交返回交点,如果不相交返回两条线段的位置关系。
1001+
* @returns {Object} 如果相交返回交点,如果不相交返回两条线段的位置关系。
10021002
*/
10031003
SuperMap.Util.lineIntersection = function (a1, a2, b1, b2) {
10041004
var intersectValue = null;
@@ -1043,7 +1043,7 @@ SuperMap.Util.lineIntersection = function (a1, a2, b1, b2) {
10431043
* @param {SuperMap.Style} style - 文本样式。
10441044
* @param {string} text - 文本内容。
10451045
* @param {Object} element - DOM 元素。
1046-
* @return {Object} 返回裁剪后的宽度,高度信息。
1046+
* @returns {Object} 返回裁剪后的宽度,高度信息。
10471047
*/
10481048
SuperMap.Util.getTextBounds = function (style, text, element) {
10491049
document.body.appendChild(element);

src/common/control/TimeControlBase.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export class TimeControlBase {
208208
* @function SuperMap.TimeControlBase.prototype.setSpeed
209209
* @description 设置步长。
210210
* @param {number} [speed=1] - 步长,必须为非负数。
211-
* @return {boolean} true 代表设置成功,false 设置失败(speed 小于 0 时失败)。
211+
* @returns {boolean} true 代表设置成功,false 设置失败(speed 小于 0 时失败)。
212212
*/
213213
setSpeed(speed) {
214214
var me = this;
@@ -223,7 +223,7 @@ export class TimeControlBase {
223223
/**
224224
* @function SuperMap.TimeControlBase.prototype.getSpeed
225225
* @description 获取步长。
226-
* @return {number} 返回当前的步长
226+
* @returns {number} 返回当前的步长
227227
*/
228228
getSpeed() {
229229
return this.speed;
@@ -234,7 +234,7 @@ export class TimeControlBase {
234234
* @function SuperMap.TimeControlBase.prototype.setFrequency
235235
* @description 设置刷新频率。
236236
* @param {number} [frequency=1000] - 刷新频率,单位为 ms。
237-
* @return {boolean} true 代表设置成功,false 设置失败(frequency 小于 0 时失败)。
237+
* @returns {boolean} true 代表设置成功,false 设置失败(frequency 小于 0 时失败)。
238238
*/
239239
setFrequency(frequency) {
240240
var me = this;
@@ -249,7 +249,7 @@ export class TimeControlBase {
249249
/**
250250
* @function SuperMap.TimeControlBase.prototype.getFrequency
251251
* @description 获取刷新频率。
252-
* @return {number} 返回当前的刷新频率。
252+
* @returns {number} 返回当前的刷新频率。
253253
*/
254254
getFrequency() {
255255
return this.frequency;
@@ -260,7 +260,7 @@ export class TimeControlBase {
260260
* @function SuperMap.TimeControlBase.prototype.setStartTime
261261
* @description 设置起始时间,设置完成后如果当前时间小于起始时间,则从起始时间开始。
262262
* @param {number} startTime - 需要设置的起始时间。
263-
* @return {boolean} true 代表设置成功,false 设置失败(startTime 大于结束时间时失败)。
263+
* @returns {boolean} true 代表设置成功,false 设置失败(startTime 大于结束时间时失败)。
264264
*/
265265
setStartTime(startTime) {
266266
var me = this;
@@ -282,7 +282,7 @@ export class TimeControlBase {
282282
/**
283283
* @function SuperMap.TimeControlBase.prototype.getStartTime
284284
* @description 获取起始时间。
285-
* @return {number} 返回当前的起始时间。
285+
* @returns {number} 返回当前的起始时间。
286286
*/
287287
getStartTime() {
288288
return this.startTime;
@@ -293,7 +293,7 @@ export class TimeControlBase {
293293
* @function SuperMap.TimeControlBase.prototype.setEndTime
294294
* @description 设置结束时间,设置完成后如果当前时间大于结束,则从起始时间开始。
295295
* @param {number} endTime - 需要设置的结束时间。
296-
* @return {boolean} true 代表设置成功,false 设置失败(endTime 小于开始时间时失败)。
296+
* @returns {boolean} true 代表设置成功,false 设置失败(endTime 小于开始时间时失败)。
297297
*/
298298
setEndTime(endTime) {
299299
var me = this;
@@ -315,7 +315,7 @@ export class TimeControlBase {
315315
/**
316316
* @function SuperMap.TimeControlBase.prototype.getEndTime
317317
* @description 获取结束时间。
318-
* @return {number} 返回当前的结束时间。
318+
* @returns {number} 返回当前的结束时间。
319319
*/
320320
getEndTime() {
321321
return this.endTime;
@@ -326,7 +326,7 @@ export class TimeControlBase {
326326
* @function SuperMap.TimeControlBase.prototype.setCurrentTime
327327
* @description 设置当前时间。
328328
* @param {number} currentTime - 需要设置的当前时间。
329-
* @return {boolean} true 代表设置成功,false 设置失败。
329+
* @returns {boolean} true 代表设置成功,false 设置失败。
330330
*/
331331
setCurrentTime(currentTime) {
332332
var me = this;
@@ -345,7 +345,7 @@ export class TimeControlBase {
345345
/**
346346
* @function SuperMap.TimeControlBase.prototype.getCurrentTime
347347
* @description 获取当前时间。
348-
* @return {number} 返回当前时间。
348+
* @returns {number} 返回当前时间。
349349
*/
350350
getCurrentTime() {
351351
return this.currentTime;
@@ -365,7 +365,7 @@ export class TimeControlBase {
365365
/**
366366
* @function SuperMap.TimeControlBase.prototype.getRepeat
367367
* @description 获取是否重复循环,默认是 true。
368-
* @return {boolean} 返回是否重复循环。
368+
* @returns {boolean} 返回是否重复循环。
369369
*/
370370
getRepeat() {
371371
return this.repeat;
@@ -385,7 +385,7 @@ export class TimeControlBase {
385385
/**
386386
* @function SuperMap.TimeControlBase.prototype.getReverse
387387
* @description 获取是否反向,默认是false。
388-
* @return {boolean} 返回是否反向。
388+
* @returns {boolean} 返回是否反向。
389389
*/
390390
getReverse() {
391391
return this.reverse;
@@ -395,7 +395,7 @@ export class TimeControlBase {
395395
/**
396396
* @function SuperMap.TimeControlBase.prototype.getRunning
397397
* @description 获取运行状态。
398-
* @return {boolean} true 代表正在运行,false 发表没有运行。
398+
* @returns {boolean} true 代表正在运行,false 发表没有运行。
399399
*/
400400
getRunning() {
401401
return this.running;

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