Skip to content

Commit 411d683

Browse files
committed
mbgl service模块 api参数优化 review by songym
1 parent 6b18653 commit 411d683

17 files changed

+418
-387
lines changed

src/mapboxgl/services/AddressMatchService.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ import {AddressMatchService as CommonAddressMatchService} from '@supermap/iclien
66
/**
77
* @class mapboxgl.supermap.AddressMatchService
88
* @category iServer AddressMatch
9-
* @classdesc 地址匹配服务
9+
* @classdesc 地址匹配服务
1010
* @example
1111
* new mapboxgl.supermap.AddressMatchService(url,options)
1212
* .code(function(result){
1313
* //doSomething
1414
* })
15-
* @param {string} url - 与客户端交互的服务地址。</br>
15+
* @param {string} url - 与客户端交互的服务地址。
1616
* @param {Object} options - 交互时所需可选参数。
17+
* @param {string} [options.proxy] - 服务代理地址。
18+
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
19+
* @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 iServer|iPortal|online。
1720
* @extends {mapboxgl.supermap.ServiceBase}
1821
*/
1922
export class AddressMatchService extends ServiceBase {
@@ -24,7 +27,7 @@ export class AddressMatchService extends ServiceBase {
2427
/**
2528
* @function mapboxgl.supermap.AddressMatchService.prototype.code
2629
* @description 获取正向地址匹配结果。
27-
* @param {Object} params - 正向匹配参数。</br>
30+
* @param {Object} params - 正向匹配参数。
2831
* @param {RequestCallback} callback - 请求结果的回调函数。
2932
*/
3033
code(params, callback) {
@@ -45,7 +48,7 @@ export class AddressMatchService extends ServiceBase {
4548
/**
4649
* @function mapboxgl.supermap.AddressMatchService.prototype.decode
4750
* @description 获取反向地址匹配结果。
48-
* @param {Object} params -反向匹配参数。 </br>
51+
* @param {Object} params -反向匹配参数。
4952
* @param {RequestCallback} callback - 请求结果的回调函数。
5053
*/
5154
decode(params, callback) {

src/mapboxgl/services/ChartService.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ import {Bounds, DataFormat, ChartQueryService, ChartFeatureInfoSpecsService} fro
1111
* @extends {mapboxgl.supermap.ServiceBase}
1212
* @example
1313
* new mapboxgl.supermap.ChartService(url)
14-
* .queryChart(param,function(result){
14+
* .queryChart(param,function(result){
1515
* //doSomething
1616
* })
17-
* @param {string} url - 与客户端交互的海图服务地址。</br>
17+
* @param {string} url - 与客户端交互的海图服务地址。
1818
* @param {Object} options - 交互时所需可选参数。
19-
*
19+
* @param {string} [options.proxy] - 服务代理地址。
20+
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
21+
* @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 iServer|iPortal|online。
2022
*/
2123
export class ChartService extends ServiceBase {
2224
constructor(url, options) {
@@ -26,9 +28,9 @@ export class ChartService extends ServiceBase {
2628
/**
2729
* @function mapboxgl.supermap.ChartService.prototype.queryChart
2830
* @description 查询海图服务。
29-
* @param {SuperMap.ChartQueryParameters} params - 海图查询所需参数类。</br>
30-
* @param {RequestCallback} callback 回调函数。</br>
31-
* @param {SuperMap.DataFormat} resultFormat - 返回的结果格式类型。
31+
* @param {SuperMap.ChartQueryParameters} params - 海图查询所需参数类。
32+
* @param {RequestCallback} callback 回调函数。
33+
* @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果格式类型。
3234
*/
3335
queryChart(params, callback, resultFormat) {
3436
var me = this,
@@ -52,7 +54,7 @@ export class ChartService extends ServiceBase {
5254
/**
5355
* @function mapboxgl.supermap.ChartService.prototype.getChartFeatureInfo
5456
* @description 获取海图物标信息服务。
55-
* @param {RequestCallback} callback 回调函数
57+
* @param {RequestCallback} callback 回调函数
5658
*/
5759
getChartFeatureInfo(callback) {
5860
var me = this, url = me.url.concat();

src/mapboxgl/services/DataFlowService.js

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@ import {DataFlowService as DataFlow} from '@supermap/iclient-common';
66
/**
77
* @class mapboxgl.supermap.DataFlowService
88
* @category iServer DataFlow
9-
* @classdesc 实时数据服务
9+
* @classdesc 实时数据服务
1010
* @extends {mapboxgl.supermap.ServiceBase}
1111
* @example
1212
* new mapboxgl.supermap.DataFlowService(url)
13-
* .queryChart(param,function(result){
13+
* .queryChart(param,function(result){
1414
* //doSomething
1515
* })
1616
* @param {string} url - 与客户端交互的实时数据服务地址。
17-
* @param {Object} options - 加载实时数据可选参数。</br>
18-
* @param {function} options.style - 设置数据加载样式。</br>
19-
* @param {function} options.onEachFeature - 设置每个数据加载popup等。</br>
20-
* @param {Array.<Object>} options.geometry - 设置增添的几何要素对象数组。</br>
21-
* @param {Object} options.excludeField - 排除字段。
17+
* @param {Object} options - 加载实时数据可选参数。
18+
* @param {Array.<Object>} [options.geometry] - 设置增添的几何要素对象数组。
19+
* @param {Object} [options.excludeField] - 排除字段。
2220
*/
2321
export class DataFlowService extends ServiceBase {
2422

@@ -51,7 +49,7 @@ export class DataFlowService extends ServiceBase {
5149

5250
/**
5351
* @function mapboxgl.supermap.DataFlowService.prototype.initBroadcast
54-
* @description 初始化广播
52+
* @description 初始化广播
5553
* @returns {mapboxgl.supermap.DataFlowService}
5654
*/
5755
initBroadcast() {
@@ -61,16 +59,16 @@ export class DataFlowService extends ServiceBase {
6159

6260
/**
6361
* @function mapboxgl.supermap.DataFlowService.prototype.broadcast
64-
* @description 加载广播数据
65-
* @param {JSON} obj - json格式的要素数据
62+
* @description 加载广播数据
63+
* @param {JSON} obj - JSON 格式的要素数据。
6664
*/
6765
broadcast(obj) {
6866
this.dataFlow.broadcast(obj);
6967
}
7068

7169
/**
7270
* @function mapboxgl.supermap.DataFlowService.prototype.initSubscribe
73-
* @description 初始化订阅数据
71+
* @description 初始化订阅数据
7472
*/
7573
initSubscribe() {
7674
this.dataFlow.initSubscribe();
@@ -80,8 +78,8 @@ export class DataFlowService extends ServiceBase {
8078

8179
/**
8280
* @function mapboxgl.supermap.DataFlowService.prototype.setExcludeField
83-
* @description 设置排除字段
84-
* @param {Object} excludeField - 排除字段
81+
* @description 设置排除字段
82+
* @param {Object} excludeField - 排除字段
8583
*/
8684
setExcludeField(excludeField) {
8785
this.dataFlow.setExcludeField(excludeField);
@@ -91,7 +89,7 @@ export class DataFlowService extends ServiceBase {
9189

9290
/**
9391
* @function mapboxgl.supermap.DataFlowService.prototype.setGeometry
94-
* @description 设置添加的几何要素数据
92+
* @description 设置添加的几何要素数据
9593
* @param {Array.<Object>} geometry - 设置增添的几何要素对象数组。
9694
*/
9795
setGeometry(geometry) {
@@ -102,15 +100,15 @@ export class DataFlowService extends ServiceBase {
102100

103101
/**
104102
* @function mapboxgl.supermap.DataFlowService.prototype.unSubscribe
105-
* @description 结束订阅数据
103+
* @description 结束订阅数据
106104
*/
107105
unSubscribe() {
108106
this.dataFlow.unSubscribe();
109107
}
110108

111109
/**
112110
* @function mapboxgl.supermap.DataFlowService.prototype.unBroadcast
113-
* @description 结束加载广播
111+
* @description 结束加载广播
114112
*/
115113
unBroadcast() {
116114
this.dataFlow.unBroadcast();

src/mapboxgl/services/FeatureService.js

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ import {
1515
/**
1616
* @class mapboxgl.supermap.FeatureService
1717
* @category iServer Data Feature
18-
* @classdesc 要素数据集类。提供:ID查询,范围查询,SQL查询,几何查询,bounds查询,缓冲区查询,地物编辑
18+
* @classdesc 要素数据集类。提供:ID 查询,范围查询,SQL 查询,几何查询,bounds 查询,缓冲区查询,地物编辑
1919
* @example
2020
* new mapboxgl.supermap.FeatureService(url)
21-
* .getFeaturesByIDs(param,function(result){
21+
* .getFeaturesByIDs(param,function(result){
2222
* //doSomething
2323
* })
2424
* @extends {mapboxgl.supermap.ServiceBase}
25-
* @param {string} url - 要素数据集服务地址 </br>
26-
* @param {Object} options - 创建要素数据集服务类可选参数。</br>
27-
* @param {SuperMap.ServerType} options.serverType - 服务来源 iServer|iPortal|online
25+
* @param {string} url - 要素数据集服务地址。
26+
* @param {Object} options - 创建要素数据集服务类可选参数。
27+
* @param {string} [options.proxy] - 服务代理地址。
28+
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
29+
* @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 iServer|iPortal|online。
2830
*/
2931
export class FeatureService extends ServiceBase {
3032
constructor(url, options) {
@@ -33,10 +35,10 @@ export class FeatureService extends ServiceBase {
3335

3436
/**
3537
* @function mapboxgl.supermap.FeatureService.prototype.getFeaturesByIDs
36-
* @description 数据集ID查询服务
37-
* @param {SuperMap.GetFeaturesByIDsParameters} params - 查询所需参数类。</br>
38-
* @param {RequestCallback} callback - 回调函数</br>
39-
* @param {SuperMap.DataFormat} resultFormat - 返回的数据格式
38+
* @description 数据集 ID 查询服务。
39+
* @param {SuperMap.GetFeaturesByIDsParameters} params - 查询所需参数类。
40+
* @param {RequestCallback} callback - 回调函数
41+
* @param {SuperMap.DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式
4042
*/
4143
getFeaturesByIDs(params, callback, resultFormat) {
4244
var me = this;
@@ -55,10 +57,10 @@ export class FeatureService extends ServiceBase {
5557

5658
/**
5759
* @function mapboxgl.supermap.FeatureService.prototype.getFeaturesByBounds
58-
* @description 数据集Bounds查询服务
59-
* @param {SuperMap.GetFeaturesByBoundsParameters} params - 查询所需参数类。</br>
60-
* @param {RequestCallback} callback - 回调函数 </br>
61-
* @param {SuperMap.DataFormat} resultFormat - 返回的数据格式
60+
* @description 数据集 Bounds 查询服务。
61+
* @param {SuperMap.GetFeaturesByBoundsParameters} params - 查询所需参数类。
62+
* @param {RequestCallback} callback - 回调函数
63+
* @param {SuperMap.DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式
6264
*/
6365
getFeaturesByBounds(params, callback, resultFormat) {
6466
var me = this;
@@ -77,10 +79,10 @@ export class FeatureService extends ServiceBase {
7779

7880
/**
7981
* @function mapboxgl.supermap.FeatureService.prototype.getFeaturesByBuffer
80-
* @description 数据集Buffer查询服务
81-
* @param {SuperMap.GetFeaturesByBufferParameters} params - 查询所需参数类。</br>
82-
* @param {RequestCallback} callback 回调函数 </br>
83-
* @param {SuperMap.DataFormat} resultFormat - 返回的数据格式
82+
* @description 数据集 Buffer 查询服务。
83+
* @param {SuperMap.GetFeaturesByBufferParameters} params - 查询所需参数类。
84+
* @param {RequestCallback} callback 回调函数
85+
* @param {SuperMap.DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式
8486
*/
8587
getFeaturesByBuffer(params, callback, resultFormat) {
8688
var me = this;
@@ -99,10 +101,10 @@ export class FeatureService extends ServiceBase {
99101

100102
/**
101103
* @function mapboxgl.supermap.FeatureService.prototype.getFeaturesBySQL
102-
* @description 数据集SQL查询服务
103-
* @param {SuperMap.GetFeaturesBySQLParameters} params - 查询所需参数类。</br>
104-
* @param {RequestCallback} callback 回调函数 </br>
105-
* @param {SuperMap.DataFormat} resultFormat - 返回的数据格式
104+
* @description 数据集 SQL 查询服务。
105+
* @param {SuperMap.GetFeaturesBySQLParameters} params - 查询所需参数类。
106+
* @param {RequestCallback} callback 回调函数
107+
* @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的数据格式
106108
*/
107109
getFeaturesBySQL(params, callback, resultFormat) {
108110
var me = this;
@@ -122,10 +124,10 @@ export class FeatureService extends ServiceBase {
122124

123125
/**
124126
* @function mapboxgl.supermap.FeatureService.prototype.getFeaturesByGeometry
125-
* @description 数据集几何查询服务类
126-
* @param {SuperMap.GetFeaturesByGeometryParameters} params - 查询所需参数类。</br>
127-
* @param {RequestCallback} callback - 回调函数 </br>
128-
* @param {SuperMap.DataFormat} resultFormat - 返回的数据格式
127+
* @description 数据集几何查询服务类
128+
* @param {SuperMap.GetFeaturesByGeometryParameters} params - 查询所需参数类。
129+
* @param {RequestCallback} callback - 回调函数
130+
* @param {SuperMap.DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式
129131
*/
130132
getFeaturesByGeometry(params, callback, resultFormat) {
131133
var me = this;
@@ -144,9 +146,9 @@ export class FeatureService extends ServiceBase {
144146

145147
/**
146148
* @function mapboxgl.supermap.FeatureService.prototype.editFeatures
147-
* @description 地物编辑服务
148-
* @param {SuperMap.EditFeaturesParameters} params - 查询所需参数类。</br>
149-
* @param {RequestCallback} callback 回调函数
149+
* @description 地物编辑服务
150+
* @param {SuperMap.EditFeaturesParameters} params - 查询所需参数类。
151+
* @param {RequestCallback} callback 回调函数
150152
*/
151153
editFeatures(params, callback) {
152154
if (!params || !params.dataSourceName || !params.dataSetName) {
@@ -172,9 +174,9 @@ export class FeatureService extends ServiceBase {
172174

173175
/**
174176
* @private
175-
* @description 参数类型转换
176-
* @param {object} params - 由端传进的服务参数
177-
* @returns {object} params - 转换后的对接SuperMap 服务的参数
177+
* @description 参数类型转换
178+
* @param {object} params - 服务参数 。
179+
* @returns {object} params - 转换后的对接 SuperMap 服务的参数
178180
*/
179181
_processParams(params) {
180182
if (!params) {

src/mapboxgl/services/FieldService.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ import {GetFieldsService, FieldStatisticService} from '@supermap/iclient-common'
77
/**
88
* @class mapboxgl.supermap.FieldService
99
* @category iServer Data Field
10-
* @classdesc 字段服务类
10+
* @classdesc 字段服务类
1111
* @example
1212
* new mapboxgl.supermap.FieldService(url).getFields(function(result){
1313
* //doSomething
1414
* });
15-
* @param {string} url - 与客户端交互的服务地址。</br>
15+
* @param {string} url - 与客户端交互的服务地址。
1616
* @param {Object} options - 参数。
17+
* @param {string} [options.proxy] - 服务代理地址。
18+
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
19+
* @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 iServer|iPortal|online。
1720
* @extends {mapboxgl.supermap.ServiceBase}
1821
*/
1922
export class FieldService extends ServiceBase {
@@ -23,9 +26,9 @@ export class FieldService extends ServiceBase {
2326

2427
/**
2528
* @function mapboxgl.supermap.FieldService.prototype.getFields
26-
* @description 字段查询服务
27-
* @param {SuperMap.FieldParameters} params - 字段信息查询参数类 </br>
28-
* @param {RequestCallback} callback 回调函数
29+
* @description 字段查询服务
30+
* @param {SuperMap.FieldParameters} params - 字段信息查询参数类
31+
* @param {RequestCallback} callback 回调函数
2932
*/
3033
getFields(params, callback) {
3134
var me = this;
@@ -46,9 +49,9 @@ export class FieldService extends ServiceBase {
4649

4750
/**
4851
* @function mapboxgl.supermap.FieldService.prototype.getFieldStatisticsInfo
49-
* @description 字段统计服务
50-
* @param {SuperMap.FieldStatisticsParameters} params - 查询所需参数类。</br>
51-
* @param {RequestCallback} callback 回调函数
52+
* @description 字段统计服务
53+
* @param {SuperMap.FieldStatisticsParameters} params - 查询所需参数类。
54+
* @param {RequestCallback} callback 回调函数
5255
*/
5356
getFieldStatisticsInfo(params, callback) {
5457
var me = this,

src/mapboxgl/services/GridCellInfosService.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ import {GetGridCellInfosService} from '@supermap/iclient-common';
66
/**
77
* @class mapboxgl.supermap.GridCellInfosService
88
* @category iServer Data Grid
9-
* @classdesc 数据栅格查询服务
9+
* @classdesc 数据栅格查询服务
1010
* @extends {mapboxgl.supermap.ServiceBase}
1111
* @example
1212
* new mapboxgl.supermap.GridCellInfosService(url)
13-
* .getGridCellInfos(param,function(result){
13+
* .getGridCellInfos(param,function(result){
1414
* //doSomething
1515
* })
16-
* @param {string} url - 与客户端交互的地图服务地址。请求地图服务,URL 应为:</br>
17-
* http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World"
18-
* @param {Object} options - 服务所需可选参数。</br>
19-
* @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。</br>
20-
* @param {SuperMap.ServerType} options.serverType - 服务器类型,iServer|iPortal|Online。</br>
21-
* @param {SuperMap.DataFormat} options.format - 查询结果返回格式,目前支持iServerJSON和GeoJSON两种格式。参数格式为"ISERVER","GEOJSON"
16+
* @param {string} url - 与客户端交互的地图服务地址。请求地图服务URL 应为:</br>
17+
* http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World"
18+
* @param {Object} options - 服务所需可选参数。
19+
* @param {string} [options.proxy] - 服务代理地址。
20+
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
21+
* @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 iServer|iPortal|online
2222
*/
2323
export class GridCellInfosService extends ServiceBase {
2424

@@ -28,8 +28,8 @@ export class GridCellInfosService extends ServiceBase {
2828

2929
/**
3030
* @function mapboxgl.supermap.GridCellInfosService.prototype.getGridCellInfos
31-
* @param {SuperMap.GetGridCellInfosParameters} params - 查询所需参数类 </br>
32-
* @param {RequestCallback} callback 回调函数
31+
* @param {SuperMap.GetGridCellInfosParameters} params - 查询所需参数类
32+
* @param {RequestCallback} callback 回调函数
3333
*/
3434
getGridCellInfos(params, callback) {
3535
if (!params) {

0 commit comments

Comments
 (0)