@supermapgis/iclient-ol 11.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/control/ChangeTileVersion.js +438 -0
- package/control/Logo.js +99 -0
- package/control/ScaleLine.js +164 -0
- package/control/index.js +6 -0
- package/core/MapExtend.js +49 -0
- package/core/StyleUtils.js +1253 -0
- package/core/Util.js +478 -0
- package/core/index.js +6 -0
- package/css/ChangeTileVersion.css +347 -0
- package/css/index.js +5 -0
- package/dist/iclient-openlayers-es6.js +121806 -0
- package/dist/iclient-openlayers-es6.min.js +8 -0
- package/dist/iclient-openlayers.css +668 -0
- package/dist/iclient-openlayers.js +132335 -0
- package/dist/iclient-openlayers.min.css +8 -0
- package/dist/iclient-openlayers.min.js +8 -0
- package/index.js +9 -0
- package/mapping/BaiduMap.js +121 -0
- package/mapping/ImageSuperMapRest.js +252 -0
- package/mapping/ImageTileSuperMapRest.js +99 -0
- package/mapping/InitMap.js +125 -0
- package/mapping/SuperMapCloud.js +56 -0
- package/mapping/Tianditu.js +152 -0
- package/mapping/TileSuperMapRest.js +358 -0
- package/mapping/WebMap.js +5185 -0
- package/mapping/index.js +11 -0
- package/mapping/webmap/Util.js +176 -0
- package/mapping/webmap/config/MunicipalCenter.json +1 -0
- package/mapping/webmap/config/ProvinceCenter.json +1 -0
- package/mapping/webmap/config/SampleDataInfo.json +55 -0
- package/namespace.js +150 -0
- package/overlay/DataFlow.js +114 -0
- package/overlay/FGB.js +97 -0
- package/overlay/Graph.js +436 -0
- package/overlay/GraphMap.js +91 -0
- package/overlay/Graphic.js +587 -0
- package/overlay/HeatMap.js +444 -0
- package/overlay/Label.js +964 -0
- package/overlay/Mapv.js +146 -0
- package/overlay/Range.js +127 -0
- package/overlay/RankSymbol.js +94 -0
- package/overlay/Turf.js +298 -0
- package/overlay/Unique.js +123 -0
- package/overlay/VectorTileSuperMapRest.js +466 -0
- package/overlay/graphic/CanvasRenderer.js +177 -0
- package/overlay/graphic/CloverShape.js +133 -0
- package/overlay/graphic/Graphic.js +174 -0
- package/overlay/graphic/HitCloverShape.js +63 -0
- package/overlay/graphic/WebGLRenderer.js +356 -0
- package/overlay/graphic/index.js +9 -0
- package/overlay/index.js +21 -0
- package/overlay/mapv/MapvCanvasLayer.js +104 -0
- package/overlay/mapv/MapvLayer.js +410 -0
- package/overlay/mapv/index.js +5 -0
- package/overlay/theme/GeoFeature.js +275 -0
- package/overlay/theme/Theme.js +585 -0
- package/overlay/theme/ThemeFeature.js +46 -0
- package/overlay/theme/index.js +6 -0
- package/overlay/vectortile/DeafultCanvasStyle.js +125 -0
- package/overlay/vectortile/MapboxStyles.js +375 -0
- package/overlay/vectortile/StyleMap.js +252 -0
- package/overlay/vectortile/VectorTileStyles.js +554 -0
- package/overlay/vectortile/index.js +7 -0
- package/overlay/vectortile/olExtends.js +382 -0
- package/package.json +29 -0
- package/services/AddressMatchService.js +60 -0
- package/services/ChartService.js +74 -0
- package/services/DataFlowService.js +118 -0
- package/services/DatasetService.js +104 -0
- package/services/DatasourceService.js +76 -0
- package/services/FeatureService.js +196 -0
- package/services/FieldService.js +53 -0
- package/services/GeoprocessingService.js +156 -0
- package/services/GridCellInfosService.js +53 -0
- package/services/ImageCollectionService.js +92 -0
- package/services/ImageService.js +69 -0
- package/services/KnowledgeGraphService.js +82 -0
- package/services/LayerInfoService.js +85 -0
- package/services/MapService.js +85 -0
- package/services/MeasureService.js +77 -0
- package/services/NetworkAnalyst3DService.js +88 -0
- package/services/NetworkAnalystService.js +252 -0
- package/services/ProcessingService.js +478 -0
- package/services/QueryService.js +116 -0
- package/services/ServiceBase.js +26 -0
- package/services/SpatialAnalystService.js +432 -0
- package/services/ThemeService.js +50 -0
- package/services/TrafficTransferAnalystService.js +88 -0
- package/services/WebPrintingJobService.js +112 -0
- package/services/index.js +27 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
/* Copyright© 2000 - 2024 SuperMap Software Co.Ltd. All rights reserved.
|
|
2
|
+
* This program are made available under the terms of the Apache License, Version 2.0
|
|
3
|
+
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
|
|
4
|
+
import { DataFormat } from '@supermapgis/iclient-common/REST';
|
|
5
|
+
import { ProcessingService as CommonProcessingService } from '@supermapgis/iclient-common/iServer/ProcessingService';
|
|
6
|
+
import {Util} from '../core/Util';
|
|
7
|
+
import {ServiceBase} from './ServiceBase';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @class ProcessingService
|
|
11
|
+
* @category iServer ProcessingService
|
|
12
|
+
* @classdesc 分布式分析相关服务类。
|
|
13
|
+
* @extends {ServiceBase}
|
|
14
|
+
* @example
|
|
15
|
+
* new ProcessingService(url,options).getKernelDensityJobs(function(result){
|
|
16
|
+
* //doSomething
|
|
17
|
+
* })
|
|
18
|
+
* @param {string} url - 服务地址。
|
|
19
|
+
* @param {Object} options - 参数。
|
|
20
|
+
* @param {string} [options.proxy] - 服务代理地址。
|
|
21
|
+
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
|
|
22
|
+
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
|
|
23
|
+
* @param {Object} [options.headers] - 请求头。
|
|
24
|
+
* @usage
|
|
25
|
+
*/
|
|
26
|
+
export class ProcessingService extends ServiceBase {
|
|
27
|
+
|
|
28
|
+
constructor(url, options) {
|
|
29
|
+
super(url, options);
|
|
30
|
+
this._processingService = new CommonProcessingService(url, options);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @function ProcessingService.prototype.getKernelDensityJobs
|
|
35
|
+
* @description 获取密度分析的列表。
|
|
36
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
37
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
38
|
+
* @returns {Promise} Promise 对象。
|
|
39
|
+
*/
|
|
40
|
+
getKernelDensityJobs(callback, resultFormat) {
|
|
41
|
+
return this._processingService.getKernelDensityJobs(callback, resultFormat);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @function ProcessingService.prototype.getKernelDensityJob
|
|
46
|
+
* @description 获取密度分析。
|
|
47
|
+
* @param {string} id - 空间分析的 ID。
|
|
48
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
49
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
50
|
+
* @returns {Promise} Promise 对象。
|
|
51
|
+
*/
|
|
52
|
+
getKernelDensityJob(id, callback, resultFormat) {
|
|
53
|
+
return this._processingService.getKernelDensityJob(id, callback, resultFormat);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @function ProcessingService.prototype.addKernelDensityJob
|
|
58
|
+
* @description 密度分析。
|
|
59
|
+
* @param {KernelDensityJobParameter} params - 核密度分析服务参数类。
|
|
60
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
61
|
+
* @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
|
|
62
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
63
|
+
* @returns {Promise} Promise 对象。
|
|
64
|
+
*/
|
|
65
|
+
addKernelDensityJob(params, callback, seconds, resultFormat) {
|
|
66
|
+
params = this._processParams(params);
|
|
67
|
+
return this._processingService.addKernelDensityJob(params, callback, seconds, resultFormat);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @function ProcessingService.prototype.getKernelDensityJobState
|
|
72
|
+
* @description 获取密度分析的状态。
|
|
73
|
+
* @param {string} id - 密度分析的 ID。
|
|
74
|
+
* @returns {Object} 密度分析的状态
|
|
75
|
+
*/
|
|
76
|
+
getKernelDensityJobState(id) {
|
|
77
|
+
return this._processingService.getKernelDensityJobState(id)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @function ProcessingService.prototype.getSummaryMeshJobs
|
|
82
|
+
* @description 获取点聚合分析的列表。
|
|
83
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
84
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
85
|
+
* @returns {Promise} Promise 对象。
|
|
86
|
+
*/
|
|
87
|
+
getSummaryMeshJobs(callback, resultFormat) {
|
|
88
|
+
return this._processingService.getSummaryMeshJobs(callback, resultFormat);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @function ProcessingService.prototype.getSummaryMeshJob
|
|
93
|
+
* @description 获取点聚合分析。
|
|
94
|
+
* @param {string} id - 空间分析的 ID。
|
|
95
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
96
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
97
|
+
* @returns {Promise} Promise 对象。
|
|
98
|
+
*/
|
|
99
|
+
getSummaryMeshJob(id, callback, resultFormat) {
|
|
100
|
+
return this._processingService.getSummaryMeshJob(id, callback, resultFormat);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @function ProcessingService.prototype.addSummaryMeshJob
|
|
105
|
+
* @description 点聚合分析。
|
|
106
|
+
* @param {SummaryMeshJobParameter} params - 点聚合分析任务参数类。
|
|
107
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
108
|
+
* @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
|
|
109
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
110
|
+
* @returns {Promise} Promise 对象。
|
|
111
|
+
*/
|
|
112
|
+
addSummaryMeshJob(params, callback, seconds, resultFormat) {
|
|
113
|
+
params = this._processParams(params);
|
|
114
|
+
return this._processingService.addSummaryMeshJob(params, callback, seconds, resultFormat);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @function ProcessingService.prototype.getSummaryMeshJobState
|
|
119
|
+
* @description 获取点聚合分析的状态。
|
|
120
|
+
* @param {string} id - 点聚合分析的 ID。
|
|
121
|
+
* @returns {Object} 点聚合分析的状态。
|
|
122
|
+
*/
|
|
123
|
+
getSummaryMeshJobState(id) {
|
|
124
|
+
return this._processingService.getSummaryMeshJobState(id)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @function ProcessingService.prototype.getQueryJobs
|
|
129
|
+
* @description 获取单对象查询分析的列表。
|
|
130
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
131
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
132
|
+
* @returns {Promise} Promise 对象。
|
|
133
|
+
*/
|
|
134
|
+
getQueryJobs(callback, resultFormat) {
|
|
135
|
+
return this._processingService.getQueryJobs(callback, resultFormat);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @function ProcessingService.prototype.getQueryJob
|
|
140
|
+
* @description 获取单对象查询分析。
|
|
141
|
+
* @param {string} id - 空间分析的 ID。
|
|
142
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
143
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
144
|
+
* @returns {Promise} Promise 对象。
|
|
145
|
+
*/
|
|
146
|
+
getQueryJob(id, callback, resultFormat) {
|
|
147
|
+
return this._processingService.getQueryJob(id, callback, resultFormat);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @function ProcessingService.prototype.addQueryJob
|
|
152
|
+
* @description 单对象查询分析。
|
|
153
|
+
* @param {SingleObjectQueryJobsParameter} params - 单对象空间查询分析任务参数类。
|
|
154
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
155
|
+
* @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
|
|
156
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
157
|
+
* @returns {Promise} Promise 对象。
|
|
158
|
+
*/
|
|
159
|
+
addQueryJob(params, callback, seconds, resultFormat) {
|
|
160
|
+
params = this._processParams(params);
|
|
161
|
+
return this._processingService.addQueryJob(params, callback, seconds, resultFormat);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @function ProcessingService.prototype.getQueryJobState
|
|
166
|
+
* @description 获取单对象查询分析的状态。
|
|
167
|
+
* @param {string} id - 单对象查询分析的 ID。
|
|
168
|
+
* @returns {Object} 单对象查询分析的状态。
|
|
169
|
+
*/
|
|
170
|
+
getQueryJobState(id) {
|
|
171
|
+
return this._processingService.getQueryJobState(id)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @function ProcessingService.prototype.getSummaryRegionJobs
|
|
176
|
+
* @description 获取区域汇总分析的列表。
|
|
177
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
178
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
179
|
+
* @returns {Promise} Promise 对象。
|
|
180
|
+
*/
|
|
181
|
+
getSummaryRegionJobs(callback, resultFormat) {
|
|
182
|
+
return this._processingService.getSummaryRegionJobs(callback, resultFormat);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* @function ProcessingService.prototype.getSummaryRegionJob
|
|
187
|
+
* @description 获取区域汇总分析。
|
|
188
|
+
* @param {string} id - 区域汇总分析的 ID。
|
|
189
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
190
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
191
|
+
* @returns {Promise} Promise 对象。
|
|
192
|
+
*/
|
|
193
|
+
getSummaryRegionJob(id, callback, resultFormat) {
|
|
194
|
+
return this._processingService.getSummaryRegionJob(id, callback, resultFormat);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* @function ProcessingService.prototype.addSummaryRegionJob
|
|
199
|
+
* @description 区域汇总分析。
|
|
200
|
+
* @param {SummaryRegionJobParameter} params - 区域汇总分析任务参数类。
|
|
201
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
202
|
+
* @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
|
|
203
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
204
|
+
* @returns {Promise} Promise 对象。
|
|
205
|
+
*/
|
|
206
|
+
addSummaryRegionJob(params, callback, seconds, resultFormat) {
|
|
207
|
+
params = this._processParams(params);
|
|
208
|
+
return this._processingService.addSummaryRegionJob(params, callback, seconds, resultFormat);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @function ProcessingService.prototype.getSummaryRegionJobState
|
|
213
|
+
* @description 获取区域汇总分析的状态。
|
|
214
|
+
* @param {string} id - 生成区域汇总分析的 ID。
|
|
215
|
+
* @returns {Object} 区域汇总分析的状态。
|
|
216
|
+
*/
|
|
217
|
+
getSummaryRegionJobState(id) {
|
|
218
|
+
return this._processingService.getSummaryRegionJobState(id)
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @function ProcessingService.prototype.getVectorClipJobs
|
|
223
|
+
* @description 获取矢量裁剪分析的列表。
|
|
224
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
225
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
226
|
+
* @returns {Promise} Promise 对象。
|
|
227
|
+
*/
|
|
228
|
+
getVectorClipJobs(callback, resultFormat) {
|
|
229
|
+
return this._processingService.getVectorClipJobs(callback, resultFormat);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* @function ProcessingService.prototype.getVectorClipJob
|
|
234
|
+
* @description 获取矢量裁剪分析。
|
|
235
|
+
* @param {string} id - 空间分析的 ID。
|
|
236
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
237
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
238
|
+
* @returns {Promise} Promise 对象。
|
|
239
|
+
*/
|
|
240
|
+
getVectorClipJob(id, callback, resultFormat) {
|
|
241
|
+
return this._processingService.getVectorClipJob(id, callback, resultFormat);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* @function ProcessingService.prototype.addVectorClipJob
|
|
246
|
+
* @description 矢量裁剪分析。
|
|
247
|
+
* @param {VectorClipJobsParameter} params - 矢量裁剪分析任务参数类。
|
|
248
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
249
|
+
* @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
|
|
250
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
251
|
+
* @returns {Promise} Promise 对象。
|
|
252
|
+
*/
|
|
253
|
+
addVectorClipJob(params, callback, seconds, resultFormat) {
|
|
254
|
+
params = this._processParams(params);
|
|
255
|
+
return this._processingService.addVectorClipJob(params, callback, seconds, resultFormat);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @function ProcessingService.prototype.getVectorClipJobState
|
|
260
|
+
* @description 获取矢量裁剪分析的状态。
|
|
261
|
+
* @param {number} id - 矢量裁剪分析的 ID。
|
|
262
|
+
* @returns {Object} 矢量裁剪分析的状态。
|
|
263
|
+
*/
|
|
264
|
+
getVectorClipJobState(id) {
|
|
265
|
+
return this._processingService.getVectorClipJobState(id)
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* @function ProcessingService.prototype.getOverlayGeoJobs
|
|
270
|
+
* @description 获取叠加分析的列表。
|
|
271
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
272
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
273
|
+
* @returns {Promise} Promise 对象。
|
|
274
|
+
*/
|
|
275
|
+
getOverlayGeoJobs(callback, resultFormat) {
|
|
276
|
+
return this._processingService.getOverlayGeoJobs(callback, resultFormat);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* @function ProcessingService.prototype.getOverlayGeoJob
|
|
281
|
+
* @description 获取叠加分析。
|
|
282
|
+
* @param {string} id - 空间分析的 ID。
|
|
283
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
284
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
285
|
+
* @returns {Promise} Promise 对象。
|
|
286
|
+
*/
|
|
287
|
+
getOverlayGeoJob(id, callback, resultFormat) {
|
|
288
|
+
return this._processingService.getOverlayGeoJob(id, callback, resultFormat);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* @function ProcessingService.prototype.addOverlayGeoJob
|
|
293
|
+
* @description 叠加分析。
|
|
294
|
+
* @param {OverlayGeoJobParameter} params - 叠加分析任务参数类。
|
|
295
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
296
|
+
* @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
|
|
297
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
298
|
+
* @returns {Promise} Promise 对象。
|
|
299
|
+
*/
|
|
300
|
+
addOverlayGeoJob(params, callback, seconds, resultFormat) {
|
|
301
|
+
params = this._processParams(params);
|
|
302
|
+
return this._processingService.addOverlayGeoJob(params, callback, seconds, resultFormat);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* @function ProcessingService.prototype.getoverlayGeoJobState
|
|
307
|
+
* @description 获取叠加分析的状态。
|
|
308
|
+
* @param {string} id - 叠加分析的 ID。
|
|
309
|
+
* @returns {Object} 叠加分析的状态。
|
|
310
|
+
*/
|
|
311
|
+
getoverlayGeoJobState(id) {
|
|
312
|
+
return this._processingService.getoverlayGeoJobState(id);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* @function ProcessingService.prototype.getBuffersJobs
|
|
317
|
+
* @description 获取缓冲区分析的列表。
|
|
318
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
319
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
320
|
+
* @returns {Promise} Promise 对象。
|
|
321
|
+
*/
|
|
322
|
+
getBuffersJobs(callback, resultFormat) {
|
|
323
|
+
return this._processingService.getBuffersJobs(callback, resultFormat);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* @function ProcessingService.prototype.getBuffersJob
|
|
328
|
+
* @description 获取缓冲区分析。
|
|
329
|
+
* @param {string} id - 空间分析的 ID。
|
|
330
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
331
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
332
|
+
* @returns {Promise} Promise 对象。
|
|
333
|
+
*/
|
|
334
|
+
getBuffersJob(id, callback, resultFormat) {
|
|
335
|
+
return this._processingService.getBuffersJob(id, callback, resultFormat);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* @function ProcessingService.prototype.addBuffersJob
|
|
340
|
+
* @description 缓冲区分析。
|
|
341
|
+
* @param {BuffersAnalystJobsParameter} params - 缓冲区分析任务参数类。
|
|
342
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
343
|
+
* @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
|
|
344
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
345
|
+
* @returns {Promise} Promise 对象。
|
|
346
|
+
*/
|
|
347
|
+
addBuffersJob(params, callback, seconds, resultFormat) {
|
|
348
|
+
params = this._processParams(params);
|
|
349
|
+
return this._processingService.addBuffersJob(params, callback, seconds, resultFormat);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* @function ProcessingService.prototype.getBuffersJobState
|
|
354
|
+
* @description 获取缓冲区分析的状态。
|
|
355
|
+
* @param {string} id - 缓冲区分析的 ID。
|
|
356
|
+
* @returns {Object} 缓冲区分析的状态。
|
|
357
|
+
*/
|
|
358
|
+
getBuffersJobState(id) {
|
|
359
|
+
return this._processingService.getBuffersJobState(id)
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* @function ProcessingService.prototype.getTopologyValidatorJobs
|
|
364
|
+
* @description 获取拓扑检查分析的列表。
|
|
365
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
366
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
367
|
+
* @returns {Promise} Promise 对象。
|
|
368
|
+
*/
|
|
369
|
+
getTopologyValidatorJobs(callback, resultFormat) {
|
|
370
|
+
return this._processingService.getTopologyValidatorJobs(callback, resultFormat);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* @function ProcessingService.prototype.getTopologyValidatorJob
|
|
375
|
+
* @description 获取拓扑检查分析。
|
|
376
|
+
* @param {string} id - 空间分析的 ID。
|
|
377
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
378
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
379
|
+
* @returns {Promise} Promise 对象。
|
|
380
|
+
*/
|
|
381
|
+
getTopologyValidatorJob(id, callback, resultFormat) {
|
|
382
|
+
return this._processingService.getTopologyValidatorJob(id, callback, resultFormat);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* @function ProcessingService.prototype.addTopologyValidatorJob
|
|
387
|
+
* @description 拓扑检查分析。
|
|
388
|
+
* @param {TopologyValidatorJobsParameter} params - 拓扑检查分析任务参数类。
|
|
389
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
390
|
+
* @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
|
|
391
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
392
|
+
* @returns {Promise} Promise 对象。
|
|
393
|
+
*/
|
|
394
|
+
addTopologyValidatorJob(params, callback, seconds, resultFormat) {
|
|
395
|
+
params = this._processParams(params);
|
|
396
|
+
return this._processingService.addTopologyValidatorJob(params, callback, seconds, resultFormat);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* @function ProcessingService.prototype.getTopologyValidatorJobState
|
|
401
|
+
* @description 获取拓扑检查分析的状态。
|
|
402
|
+
* @param {string} id - 拓扑检查分析的 ID。
|
|
403
|
+
* @returns {Object} 拓扑检查分析的状态。
|
|
404
|
+
*/
|
|
405
|
+
getTopologyValidatorJobState(id) {
|
|
406
|
+
return this._processingService.getTopologyValidatorJobState(id)
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* @function ProcessingService.prototype.getSummaryAttributesJobs
|
|
411
|
+
* @description 获取拓扑检查属性汇总分析的列表。
|
|
412
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
413
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
414
|
+
* @returns {Promise} Promise 对象。
|
|
415
|
+
*/
|
|
416
|
+
getSummaryAttributesJobs(callback, resultFormat) {
|
|
417
|
+
return this._processingService.getSummaryAttributesJobs(callback, resultFormat);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* @function ProcessingService.prototype.getSummaryAttributesJob
|
|
422
|
+
* @description 获取属性汇总分析。
|
|
423
|
+
* @param {string} id - 空间分析的 ID。
|
|
424
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
425
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
426
|
+
* @returns {Promise} Promise 对象。
|
|
427
|
+
*/
|
|
428
|
+
getSummaryAttributesJob(id, callback, resultFormat) {
|
|
429
|
+
return this._processingService.getSummaryAttributesJob(id, callback, resultFormat);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* @function ProcessingService.prototype.addSummaryAttributesJob
|
|
434
|
+
* @description 属性汇总分析。
|
|
435
|
+
* @param {SummaryAttributesJobsParameter} params - 属性汇总分析任务参数类。
|
|
436
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
437
|
+
* @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
|
|
438
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
439
|
+
* @returns {Promise} Promise 对象。
|
|
440
|
+
*/
|
|
441
|
+
addSummaryAttributesJob(params, callback, seconds, resultFormat) {
|
|
442
|
+
params = this._processParams(params);
|
|
443
|
+
return this._processingService.addSummaryAttributesJob(params, callback, seconds, resultFormat);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* @function ProcessingService.prototype.getSummaryAttributesJobState
|
|
448
|
+
* @description 获取属性汇总分析的状态。
|
|
449
|
+
* @param {string} id - 属性汇总分析的 ID。
|
|
450
|
+
* @returns {Object} 属性汇总分析的状态。
|
|
451
|
+
*/
|
|
452
|
+
getSummaryAttributesJobState(id) {
|
|
453
|
+
return this._processingService.getSummaryAttributesJobState(id)
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
_processFormat(resultFormat) {
|
|
457
|
+
return (resultFormat) ? resultFormat : DataFormat.GEOJSON;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
_processParams(params) {
|
|
461
|
+
if (!params) {
|
|
462
|
+
return {};
|
|
463
|
+
}
|
|
464
|
+
if (params.bounds) {
|
|
465
|
+
params.bounds = Util.toSuperMapBounds(params.bounds);
|
|
466
|
+
}
|
|
467
|
+
if (params.query) {
|
|
468
|
+
params.query = Util.toSuperMapBounds(params.query);
|
|
469
|
+
}
|
|
470
|
+
if (params.geometryQuery) {
|
|
471
|
+
params.geometryQuery = Util.toProcessingParam(params.geometryQuery);
|
|
472
|
+
}
|
|
473
|
+
if (params.geometryClip) {
|
|
474
|
+
params.geometryClip = Util.toProcessingParam(params.geometryClip);
|
|
475
|
+
}
|
|
476
|
+
return params;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/* Copyright© 2000 - 2024 SuperMap Software Co.Ltd. All rights reserved.
|
|
2
|
+
* This program are made available under the terms of the Apache License, Version 2.0
|
|
3
|
+
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
|
|
4
|
+
import { Bounds } from '@supermapgis/iclient-common/commontypes/Bounds';
|
|
5
|
+
import { Point as GeometryPoint } from '@supermapgis/iclient-common/commontypes/geometry/Point';
|
|
6
|
+
import {Util} from '../core/Util';
|
|
7
|
+
import {ServiceBase} from './ServiceBase';
|
|
8
|
+
import { QueryService as CommonQueryService } from '@supermapgis/iclient-common/iServer/QueryService';
|
|
9
|
+
import Point from 'ol/geom/Point';
|
|
10
|
+
import GeoJSON from 'ol/format/GeoJSON';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @class QueryService
|
|
14
|
+
* @category iServer Map QueryResults
|
|
15
|
+
* @classdesc 地图查询服务类。
|
|
16
|
+
* 提供:范围查询,SQL 查询,几何查询,距离查询。
|
|
17
|
+
* @modulecategory Services
|
|
18
|
+
* @extends {ServiceBase}
|
|
19
|
+
* @param {string} url - 服务地址。
|
|
20
|
+
* @param {Object} options - 参数。
|
|
21
|
+
* @param {string} [options.proxy] - 服务代理地址。
|
|
22
|
+
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
|
|
23
|
+
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
|
|
24
|
+
* @param {Object} [options.headers] - 请求头。
|
|
25
|
+
* @example
|
|
26
|
+
* new QueryService(url)
|
|
27
|
+
* .queryByBounds(param,function(result){
|
|
28
|
+
* //doSomething
|
|
29
|
+
* })
|
|
30
|
+
* @usage
|
|
31
|
+
*/
|
|
32
|
+
export class QueryService extends ServiceBase {
|
|
33
|
+
|
|
34
|
+
constructor(url, options) {
|
|
35
|
+
super(url, options);
|
|
36
|
+
this._queryService = new CommonQueryService(url, options);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @function QueryService.prototype.queryByBounds
|
|
41
|
+
* @description bounds 查询地图服务。
|
|
42
|
+
* @param {QueryByBoundsParameters} params - Bounds 查询参数类。
|
|
43
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
44
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
45
|
+
* @returns {Promise} Promise 对象。
|
|
46
|
+
*/
|
|
47
|
+
queryByBounds(params, callback, resultFormat) {
|
|
48
|
+
params = this._processParams(params);
|
|
49
|
+
return this._queryService.queryByBounds(params, callback, resultFormat);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @function QueryService.prototype.queryByDistance
|
|
54
|
+
* @description 地图距离查询服务。
|
|
55
|
+
* @param {QueryByDistanceParameters} params - Distance 查询参数类。
|
|
56
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
57
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
58
|
+
* @returns {Promise} Promise 对象。
|
|
59
|
+
*/
|
|
60
|
+
queryByDistance(params, callback, resultFormat) {
|
|
61
|
+
params = this._processParams(params);
|
|
62
|
+
return this._queryService.queryByDistance(params, callback, resultFormat);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @function QueryService.prototype.queryBySQL
|
|
67
|
+
* @description 地图 SQL 查询服务。
|
|
68
|
+
* @param {QueryBySQLParameters} params - SQL 查询参数类。
|
|
69
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
70
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
71
|
+
* @returns {Promise} Promise 对象。
|
|
72
|
+
*/
|
|
73
|
+
queryBySQL(params, callback, resultFormat) {
|
|
74
|
+
params = this._processParams(params);
|
|
75
|
+
return this._queryService.queryBySQL(params, callback, resultFormat);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @function QueryService.prototype.queryByGeometry
|
|
80
|
+
* @description 地图几何查询服务。
|
|
81
|
+
* @param {QueryByGeometryParameters} params - Geometry 查询参数类。
|
|
82
|
+
* @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
|
|
83
|
+
* @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
|
|
84
|
+
* @returns {Promise} Promise 对象。
|
|
85
|
+
*/
|
|
86
|
+
queryByGeometry(params, callback, resultFormat) {
|
|
87
|
+
params = this._processParams(params);
|
|
88
|
+
return this._queryService.queryByGeometry(params, callback, resultFormat);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
_processParams(params) {
|
|
92
|
+
if (!params) {
|
|
93
|
+
return {};
|
|
94
|
+
}
|
|
95
|
+
params.returnContent = (params.returnContent == null) ? true : params.returnContent;
|
|
96
|
+
if (params.queryParams && !Util.isArray(params.queryParams)) {
|
|
97
|
+
params.queryParams = [params.queryParams];
|
|
98
|
+
}
|
|
99
|
+
if (params.bounds) {
|
|
100
|
+
params.bounds = new Bounds(
|
|
101
|
+
params.bounds[0],
|
|
102
|
+
params.bounds[1],
|
|
103
|
+
params.bounds[2],
|
|
104
|
+
params.bounds[3]
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
if (params.geometry) {
|
|
108
|
+
if (params.geometry instanceof Point) {
|
|
109
|
+
params.geometry = new GeometryPoint(params.geometry.getCoordinates()[0], params.geometry.getCoordinates()[1]);
|
|
110
|
+
} else {
|
|
111
|
+
params.geometry = Util.toSuperMapGeometry(JSON.parse((new GeoJSON()).writeGeometry(params.geometry)));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return params;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* Copyright© 2000 - 2024 SuperMap Software Co.Ltd. All rights reserved.
|
|
2
|
+
* This program are made available under the terms of the Apache License, Version 2.0
|
|
3
|
+
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
|
|
4
|
+
import Observable from 'ol/Observable';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @class ServiceBase
|
|
8
|
+
* @category iServer Core
|
|
9
|
+
* @classdesc ol.supermap 的服务基类。
|
|
10
|
+
* @param {string} url - 服务地址。
|
|
11
|
+
* @param {Object} options - 参数。
|
|
12
|
+
* @param {string} [options.proxy] - 服务代理地址。
|
|
13
|
+
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
|
|
14
|
+
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
|
|
15
|
+
* @param {Object} [options.headers] - 请求头。
|
|
16
|
+
* @extends {ol.Observable}
|
|
17
|
+
* @usage
|
|
18
|
+
*/
|
|
19
|
+
export class ServiceBase extends Observable {
|
|
20
|
+
constructor(url, options) {
|
|
21
|
+
super(url, options);
|
|
22
|
+
this.options = options || {};
|
|
23
|
+
this.url = url;
|
|
24
|
+
this.dispatchEvent({type: 'initialized', value: this});
|
|
25
|
+
}
|
|
26
|
+
}
|