Skip to content

Commit 484b285

Browse files
committed
优化API
1 parent 183460d commit 484b285

File tree

29 files changed

+57
-44
lines changed

29 files changed

+57
-44
lines changed

build/jsdocs/template/config.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,18 @@
338338
"name": "互联网地图",
339339
"name_en": "ThirdPartyMap"
340340
},
341-
342341
"BaseTypes": {
343342
"name": "基础类",
344343
"name_en": "BaseTypes",
345344
"content": {
345+
"Namespace": {
346+
"name": "命名空间",
347+
"name_en": "Namespace"
348+
},
349+
"Util": {
350+
"name": "工具",
351+
"name_en": "Util"
352+
},
346353
"Geometry": {
347354
"name": "几何要素",
348355
"name_en": "Geometry"

build/jsdocs/template/tmpl/navigation.tmpl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ function buildLi(obj){
7272
<li class="item" data-name="<?js= obj.longname ?>">
7373
<span class="title">
7474
<?js= self.linkto(obj.longname, obj.longname) ?>
75-
<?js if (obj.type === 'namespace') { ?>
76-
<span class="static">s</span>
77-
<?js } ?>
7875
</span>
7976
<ul class="members itemMembers">
8077
<?js

examples/js/common.js

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@
1212
onLoadCallBack(); //设置标题栏当前语言
1313
callback && callback();
1414
});
15-
bindEvents();
15+
$('.icl-header').on('click', '.lang-option', function () {
16+
var value = $(this).data('lang');
17+
utils.setLanguage(value);
18+
$('#lang').html($(this).html());
19+
i18next.changeLanguage(value);
20+
if (window.isSite) {
21+
localize();
22+
return;
23+
}
24+
window.location.reload();
25+
});
1626
}
1727

1828
function onLoadCallBack() {
@@ -60,21 +70,6 @@
6070
});
6171
}
6272

63-
64-
function bindEvents() {
65-
$('.icl-header').on('click', '.lang-option', function () {
66-
var value = $(this).data('lang');
67-
utils.setLanguage(value);
68-
$('#lang').html($(this).html());
69-
i18next.changeLanguage(value);
70-
if (window.isSite) {
71-
localize();
72-
return;
73-
}
74-
window.location.reload();
75-
});
76-
}
77-
7873
function localize() {
7974
var lang = utils.getLanguage();
8075
var pathname = window.location.pathname.replace("/en/", "/");

src/common/commontypes/BaseTypes.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {SuperMap} from '../SuperMap';
22
/**
33
*@namespace SuperMap
4+
*@category BaseTypes Namespace
45
*/
56

67
/**
@@ -73,8 +74,9 @@ SuperMap.mixin = function (...mixins) {
7374

7475
/**
7576
* @name String
76-
* @memberOf SuperMap
7777
* @namespace
78+
* @memberOf SuperMap
79+
* @category BaseTypes Util
7880
* @description 字符串操作的一系列常用扩展函数。
7981
*/
8082
export var StringExt = SuperMap.String = {
@@ -255,6 +257,7 @@ export var StringExt = SuperMap.String = {
255257
* @name Number
256258
* @memberOf SuperMap
257259
* @namespace
260+
* @category BaseTypes Util
258261
* @description 数值操作的一系列常用扩展函数。
259262
*/
260263
export var NumberExt = SuperMap.Number = {
@@ -353,6 +356,7 @@ if (!Number.prototype.limitSigDigs) {
353356
* @name Function
354357
* @memberOf SuperMap
355358
* @namespace
359+
* @category BaseTypes Util
356360
* @description 函数操作的一系列常用扩展函数。
357361
*/
358362
export var FunctionExt = SuperMap.Function = {
@@ -425,6 +429,7 @@ export var FunctionExt = SuperMap.Function = {
425429
* @name Array
426430
* @memberOf SuperMap
427431
* @namespace
432+
* @category BaseTypes Util
428433
* @description 数组操作的一系列常用扩展函数。
429434
*/
430435
export var ArrayExt = SuperMap.Array = {

src/common/commontypes/Bounds.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {Util} from './Util';
66

77
/**
88
* @class SuperMap.Bounds
9+
* @category BaseTypes Geometry
910
* @classdesc 表示边界类实例。使用 bounds 之前需要设置 left,bottom,right,top 四个属性,这些属性的初始值为 null。
1011
* @param {number} [left] - 左边界,注意考虑宽度,理论上小于 right 值。
1112
* @param {number} [bottom] - 下边界。考虑高度,理论上小于 top 值。

src/common/commontypes/Credential.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
/**
44
* @class SuperMap.Credential
5+
* @category Security
56
* @classdesc SuperMap 的安全证书类,其中包括 token 等安全验证信息。</br>
67
* 需要使用用户名和密码在:"http://localhost:8090/iserver/services/security/tokens" 下申请 value。</br>
78
* 获得形如:"2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ.." 的 value。</br>

src/common/commontypes/Date.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @name Date
55
* @memberOf SuperMap
66
* @namespace
7+
* @category BaseTypes Util
78
* @description 包含 parse、toISOString 方法的实现,两个方法用来解析 RFC 3339 日期,遵循 ECMAScript 5 规范。
89
*/
910
export var DateExt = SuperMap.Date = {

src/common/commontypes/Feature.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {Util} from './Util';
33

44
/**
55
* @class SuperMap.Feature
6+
* @category BaseTypes Geometry
67
* @classdesc 要素类组合了地理和属性,Feature 类同时具有 marker 和 lonlat 属性。
78
* @param {SuperMap.Layer} layer - 图层。
89
* @param {SuperMap.LonLat} lonlat - 经纬度。

src/common/commontypes/Geometry.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {Util} from './Util';
55

66
/**
77
* @class SuperMap.Geometry
8+
* @category BaseTypes Geometry
89
* @classdesc 几何对象类,描述地理对象的几何图形。
910
*/
1011
export class Geometry {

src/common/commontypes/LonLat.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
/**
44
* @class SuperMap.LonLat
5+
* @category BaseTypes Geometry
56
* @classdesc 这个类用来表示经度和纬度对。
67
* @param {number} [lon=0.0] - 地图单位上的 X 轴坐标,如果地图是地理投影,则此值是经度,否则,此值是地图地理位置的 x 坐标。
78
* @param {number} [lat=0.0] - 地图单位上的 Y 轴坐标,如果地图是地理投影,则此值是纬度,否则,此值是地图地理位置的 y 坐标。

0 commit comments

Comments
 (0)