Skip to content

Commit ce702f7

Browse files
committed
【update/API】 serviece 新增 crossOrigin 参数 review by songym
1 parent a12943f commit ce702f7

File tree

147 files changed

+2866
-771
lines changed

Some content is hidden

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

147 files changed

+2866
-771
lines changed

dist/classic/iclient-classic-es6.js

+65-8
Large diffs are not rendered by default.

dist/classic/iclient-classic-es6.min.js

+32-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/classic/iclient-classic.js

+62-7
Large diffs are not rendered by default.

dist/classic/iclient-classic.min.js

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/leaflet/iclient9-leaflet-es6.js

+267-72
Large diffs are not rendered by default.

dist/leaflet/iclient9-leaflet-es6.min.js

+24-24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/leaflet/iclient9-leaflet.js

+263-70
Large diffs are not rendered by default.

dist/leaflet/iclient9-leaflet.min.js

+21-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mapboxgl/iclient9-mapboxgl-es6.js

+263-69
Large diffs are not rendered by default.

dist/mapboxgl/iclient9-mapboxgl-es6.min.js

+63-63
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mapboxgl/iclient9-mapboxgl-widgets-vue.js

+462-50
Large diffs are not rendered by default.

dist/mapboxgl/iclient9-mapboxgl-widgets-vue.min.js

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mapboxgl/iclient9-mapboxgl.js

+260-68
Large diffs are not rendered by default.

dist/mapboxgl/iclient9-mapboxgl.min.js

+55-55
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/openlayers/iclient9-openlayers-es6.js

+262-73
Large diffs are not rendered by default.

dist/openlayers/iclient9-openlayers.js

+257-70
Large diffs are not rendered by default.

src/classic/services/AddressMatchService.js

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {AddressMatchService as CommonAddressMatchService} from '@supermap/iclien
1212
* @extends {SuperMap.CommonServiceBase}
1313
* @param {string} url - 服务地址。
1414
* @param {Object} options - 参数。
15+
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
1516
*/
1617
export class AddressMatchService extends CommonServiceBase {
1718

@@ -31,6 +32,7 @@ export class AddressMatchService extends CommonServiceBase {
3132
var addressMatchService = new CommonAddressMatchService(me.url, {
3233
proxy: me.proxy,
3334
withCredentials: me.withCredentials,
35+
crossOrigin: me.crossOrigin,
3436
serverType: me.serverType,
3537
eventListeners: {
3638
scope: me,
@@ -52,6 +54,7 @@ export class AddressMatchService extends CommonServiceBase {
5254
var addressMatchService = new CommonAddressMatchService(me.url, {
5355
proxy: me.proxy,
5456
withCredentials: me.withCredentials,
57+
crossOrigin: me.crossOrigin,
5558
serverType: me.serverType,
5659
eventListeners: {
5760
scope: me,

src/classic/services/ProcessingService.js

+28
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {SummaryAttributesJobsService} from '@supermap/iclient-common/iServer/Sum
2727
* })
2828
* @param {string} url - 分布式分析服务地址。
2929
* @param {Object} options - 可选参数。
30+
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
3031
*/
3132
export class ProcessingService extends CommonServiceBase {
3233

@@ -55,6 +56,7 @@ export class ProcessingService extends CommonServiceBase {
5556
var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
5657
proxy: me.proxy,
5758
withCredentials: me.withCredentials,
59+
crossOrigin:me.crossOrigin,
5860
serverType: me.serverType,
5961
eventListeners: {
6062
scope: me,
@@ -79,6 +81,7 @@ export class ProcessingService extends CommonServiceBase {
7981
var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
8082
proxy: me.proxy,
8183
withCredentials: me.withCredentials,
84+
crossOrigin:me.crossOrigin,
8285
serverType: me.serverType,
8386
eventListeners: {
8487
scope: me,
@@ -103,6 +106,7 @@ export class ProcessingService extends CommonServiceBase {
103106
var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
104107
proxy: me.proxy,
105108
withCredentials: me.withCredentials,
109+
crossOrigin:me.crossOrigin,
106110
eventListeners: {
107111
scope: me,
108112
processCompleted: callback,
@@ -138,6 +142,7 @@ export class ProcessingService extends CommonServiceBase {
138142
var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
139143
proxy: me.proxy,
140144
withCredentials: me.withCredentials,
145+
crossOrigin:me.crossOrigin,
141146
serverType: me.serverType,
142147
eventListeners: {
143148
scope: me,
@@ -162,6 +167,7 @@ export class ProcessingService extends CommonServiceBase {
162167
var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
163168
proxy: me.proxy,
164169
withCredentials: me.withCredentials,
170+
crossOrigin:me.crossOrigin,
165171
serverType: me.serverType,
166172
eventListeners: {
167173
scope: me,
@@ -186,6 +192,7 @@ export class ProcessingService extends CommonServiceBase {
186192
var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
187193
proxy: me.proxy,
188194
withCredentials: me.withCredentials,
195+
crossOrigin:me.crossOrigin,
189196
eventListeners: {
190197
scope: me,
191198
processCompleted: callback,
@@ -221,6 +228,7 @@ export class ProcessingService extends CommonServiceBase {
221228
var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
222229
proxy: me.proxy,
223230
withCredentials: me.withCredentials,
231+
crossOrigin:me.crossOrigin,
224232
serverType: me.serverType,
225233
eventListeners: {
226234
scope: me,
@@ -245,6 +253,7 @@ export class ProcessingService extends CommonServiceBase {
245253
var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
246254
proxy: me.proxy,
247255
withCredentials: me.withCredentials,
256+
crossOrigin:me.crossOrigin,
248257
serverType: me.serverType,
249258
eventListeners: {
250259
scope: me,
@@ -271,6 +280,7 @@ export class ProcessingService extends CommonServiceBase {
271280
var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
272281
proxy: me.proxy,
273282
withCredentials: me.withCredentials,
283+
crossOrigin:me.crossOrigin,
274284
eventListeners: {
275285
scope: me,
276286
processCompleted: callback,
@@ -306,6 +316,7 @@ export class ProcessingService extends CommonServiceBase {
306316
var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
307317
proxy: me.proxy,
308318
withCredentials: me.withCredentials,
319+
crossOrigin:me.crossOrigin,
309320
serverType: me.serverType,
310321
eventListeners: {
311322
scope: me,
@@ -330,6 +341,7 @@ export class ProcessingService extends CommonServiceBase {
330341
var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
331342
proxy: me.proxy,
332343
withCredentials: me.withCredentials,
344+
crossOrigin:me.crossOrigin,
333345
serverType: me.serverType,
334346
eventListeners: {
335347
scope: me,
@@ -354,6 +366,7 @@ export class ProcessingService extends CommonServiceBase {
354366
var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
355367
proxy: me.proxy,
356368
withCredentials: me.withCredentials,
369+
crossOrigin:me.crossOrigin,
357370
eventListeners: {
358371
scope: me,
359372
processCompleted: callback,
@@ -389,6 +402,7 @@ export class ProcessingService extends CommonServiceBase {
389402
var vectorClipJobsService = new VectorClipJobsService(me.url, {
390403
proxy: me.proxy,
391404
withCredentials: me.withCredentials,
405+
crossOrigin:me.crossOrigin,
392406
serverType: me.serverType,
393407
eventListeners: {
394408
scope: me,
@@ -413,6 +427,7 @@ export class ProcessingService extends CommonServiceBase {
413427
var vectorClipJobsService = new VectorClipJobsService(me.url, {
414428
proxy: me.proxy,
415429
withCredentials: me.withCredentials,
430+
crossOrigin:me.crossOrigin,
416431
serverType: me.serverType,
417432
eventListeners: {
418433
scope: me,
@@ -439,6 +454,7 @@ export class ProcessingService extends CommonServiceBase {
439454
var vectorClipJobsService = new VectorClipJobsService(me.url, {
440455
proxy: me.proxy,
441456
withCredentials: me.withCredentials,
457+
crossOrigin:me.crossOrigin,
442458
serverType: me.serverType,
443459
eventListeners: {
444460
scope: me,
@@ -475,6 +491,7 @@ export class ProcessingService extends CommonServiceBase {
475491
var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
476492
proxy: me.proxy,
477493
withCredentials: me.withCredentials,
494+
crossOrigin:me.crossOrigin,
478495
serverType: me.serverType,
479496
eventListeners: {
480497
scope: me,
@@ -499,6 +516,7 @@ export class ProcessingService extends CommonServiceBase {
499516
var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
500517
proxy: me.proxy,
501518
withCredentials: me.withCredentials,
519+
crossOrigin:me.crossOrigin,
502520
serverType: me.serverType,
503521
eventListeners: {
504522
scope: me,
@@ -524,6 +542,7 @@ export class ProcessingService extends CommonServiceBase {
524542
var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
525543
proxy: me.proxy,
526544
withCredentials: me.withCredentials,
545+
crossOrigin:me.crossOrigin,
527546
serverType: me.serverType,
528547
eventListeners: {
529548
scope: me,
@@ -560,6 +579,7 @@ export class ProcessingService extends CommonServiceBase {
560579
var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
561580
proxy: me.proxy,
562581
withCredentials: me.withCredentials,
582+
crossOrigin:me.crossOrigin,
563583
serverType: me.serverType,
564584
eventListeners: {
565585
scope: me,
@@ -584,6 +604,7 @@ export class ProcessingService extends CommonServiceBase {
584604
var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
585605
proxy: me.proxy,
586606
withCredentials: me.withCredentials,
607+
crossOrigin:me.crossOrigin,
587608
serverType: me.serverType,
588609
eventListeners: {
589610
scope: me,
@@ -609,6 +630,7 @@ export class ProcessingService extends CommonServiceBase {
609630
var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
610631
proxy: me.proxy,
611632
withCredentials: me.withCredentials,
633+
crossOrigin:me.crossOrigin,
612634
serverType: me.serverType,
613635
eventListeners: {
614636
scope: me,
@@ -645,6 +667,7 @@ export class ProcessingService extends CommonServiceBase {
645667
var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
646668
proxy: me.proxy,
647669
withCredentials: me.withCredentials,
670+
crossOrigin:me.crossOrigin,
648671
serverType: me.serverType,
649672
eventListeners: {
650673
scope: me,
@@ -669,6 +692,7 @@ export class ProcessingService extends CommonServiceBase {
669692
var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
670693
proxy: me.proxy,
671694
withCredentials: me.withCredentials,
695+
crossOrigin:me.crossOrigin,
672696
serverType: me.serverType,
673697
eventListeners: {
674698
scope: me,
@@ -694,6 +718,7 @@ export class ProcessingService extends CommonServiceBase {
694718
var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
695719
proxy: me.proxy,
696720
withCredentials: me.withCredentials,
721+
crossOrigin:me.crossOrigin,
697722
serverType: me.serverType,
698723
eventListeners: {
699724
scope: me,
@@ -730,6 +755,7 @@ export class ProcessingService extends CommonServiceBase {
730755
var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
731756
proxy: me.proxy,
732757
withCredentials: me.withCredentials,
758+
crossOrigin:me.crossOrigin,
733759
serverType: me.serverType,
734760
eventListeners: {
735761
scope: me,
@@ -754,6 +780,7 @@ export class ProcessingService extends CommonServiceBase {
754780
var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
755781
proxy: me.proxy,
756782
withCredentials: me.withCredentials,
783+
crossOrigin:me.crossOrigin,
757784
serverType: me.serverType,
758785
eventListeners: {
759786
scope: me,
@@ -779,6 +806,7 @@ export class ProcessingService extends CommonServiceBase {
779806
var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
780807
proxy: me.proxy,
781808
withCredentials: me.withCredentials,
809+
crossOrigin:me.crossOrigin,
782810
serverType: me.serverType,
783811
eventListeners: {
784812
scope: me,

src/common/iManager/iManagerServiceBase.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@ import {FetchRequest} from '../util/FetchRequest';
1010
* @classdesc iManager 服务基类(有权限限制的类需要实现此类)。
1111
* @category iManager
1212
* @param {string} url - iManager 首页地址,如:http://localhost:8390/imanager。
13+
* @param {Object} options - 服务参数。
14+
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
1315
*/
1416
export class IManagerServiceBase {
1517

16-
constructor(url) {
18+
constructor(url,options) {
1719
if (url) {
1820
var end = url.substr(url.length - 1, 1);
1921
this.serviceUrl = end === "/" ? url.substr(0, url.length - 2) : url;
2022
}
23+
this.options = options || {};
2124
this.CLASS_NAME = "SuperMap.iManagerServiceBase";
2225
}
2326

@@ -41,6 +44,7 @@ export class IManagerServiceBase {
4144
if (!requestOptions.hasOwnProperty("withCredentials")) {
4245
requestOptions['withCredentials'] = true;
4346
}
47+
requestOptions['crossOrigin'] = this.options.crossOrigin;
4448
var token = SecurityManager.imanagerToken;
4549
if (token) {
4650
if (!requestOptions.headers) {

src/common/iPortal/iPortalService.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ import {IPortalServiceBase} from './iPortalServiceBase';
1212
* @extends {SuperMap.iPortalServiceBase}
1313
* @param {string} seviceUrl - 服务地址。
1414
* @param {Object} params - 服务请求参数。
15-
*
15+
* @param {boolean} [params.withCredentials=false] - 请求是否携带 cookie。
16+
* @param {boolean} [params.crossOrigin] - 请求是否携带 cookie。 *
1617
*/
1718
export class IPortalService extends IPortalServiceBase {
1819

1920

2021

2122
constructor(serviceUrl, params) {
22-
super(serviceUrl);
23+
super(serviceUrl, params);
2324
params = params || {};
2425
this.addedMapNames = null;
2526
this.addedSceneNames = null;

src/common/iPortal/iPortalServiceBase.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { FetchRequest } from '../util/FetchRequest';
1414
* @param {string} url - iPortal 服务地址。
1515
* @param {Object} options - 可选参数。
1616
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
17+
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
1718
*/
1819
export class IPortalServiceBase {
1920

@@ -23,6 +24,7 @@ export class IPortalServiceBase {
2324
this.serverType = ServerType.iPortal;
2425
this.CLASS_NAME = "SuperMap.iPortalServiceBase";
2526
this.withCredentials = options.withCredentials || false;
27+
this.crossOrigin = options.crossOrigin
2628
}
2729

2830
/**
@@ -35,7 +37,7 @@ export class IPortalServiceBase {
3537
* @returns {Promise} 返回包含请求结果的 Promise 对象。
3638
*/
3739

38-
request(method, url, param, requestOptions = { withCredentials: this.withCredentials }) {
40+
request(method, url, param, requestOptions = {crossOrigin: this.crossOrigin, withCredentials: this.withCredentials }) {
3941
url = this.createCredentialUrl(url);
4042
return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
4143
return response.json();

src/common/iServer/AddressMatchService.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ import {GeoDecodingParameter} from './GeoDecodingParameter';
1313
* @classdesc 地址匹配服务,包括正向匹配和反向匹配。
1414
* @param {string} url - 地址匹配服务地址。
1515
* @param {Object} options - 参数。
16+
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
1617
*/
1718
export class AddressMatchService extends CommonServiceBase {
1819

1920
constructor(url, options) {
2021
super(url, options);
22+
this.options = options || {}
2123
this.CLASS_NAME = "SuperMap.AddressMatchService";
2224
}
2325

@@ -62,7 +64,7 @@ export class AddressMatchService extends CommonServiceBase {
6264

6365
processAsync(url, params) {
6466
var me = this;
65-
FetchRequest.get(url, params,{proxy: me.proxy}).then(function (response) {
67+
FetchRequest.get(url, params,{crossOrigin:me.crossOrigin, proxy: me.proxy}).then(function (response) {
6668
return response.json();
6769
}).then(function (result) {
6870
if (result) {

src/common/iServer/AreaSolarRadiationService.js

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {Util} from '../commontypes/Util';
1313
* @param {string} url - 服务的访问地址。如:</br>http://localhost:8090/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst。</br>
1414
* @param {Object} options - 参数。</br>
1515
* @param {Object} options.eventListeners - 需要被注册的监听器对象。
16+
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
1617
* @extends {SuperMap.SpatialAnalystBase}
1718
* @example 例如:
1819
* (start code)

src/common/iServer/BufferAnalystService.js

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {GeometryBufferAnalystParameters} from './GeometryBufferAnalystParameters
1616
* @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
1717
* @param {Object} options - 参数。</br>
1818
* @param {Object} options.eventListeners - 需要被注册的监听器对象。
19+
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
1920
* @extends {SuperMap.SpatialAnalystBase}
2021
* @example 例如:
2122
* (start code)

src/common/iServer/BuffersAnalystJobsService.js

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {BuffersAnalystJobsParameter} from './BuffersAnalystJobsParameter';
1212
* @extends {SuperMap.ProcessingServiceBase}
1313
* @param {string} url - 服务地址。
1414
* @param {Object} options - 参数。
15+
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
1516
*/
1617
export class BuffersAnalystJobsService extends ProcessingServiceBase {
1718
constructor(url, options) {

src/common/iServer/BurstPipelineAnalystService.js

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {BurstPipelineAnalystParameters} from './BurstPipelineAnalystParameters';
1515
* 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
1616
* @param {Object} options - 参数。
1717
* @param {Object} options.eventListeners - 需要被注册的监听器对象。
18+
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
1819
*/
1920
export class BurstPipelineAnalystService extends NetworkAnalystServiceBase {
2021

src/common/iServer/ChartFeatureInfoSpecsService.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ import {CommonServiceBase} from './CommonServiceBase';
1818
* 发送请求格式类似于:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图/chartFeatureInfoSpecs.json"。
1919
* @param {Object} options - 参数。
2020
* @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
21-
* @param {SuperMap.ServerType} options.serverType - 服务器类型,iServer|iPortal|Online。
22-
* @param {SuperMap.DataFormat} options.format - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为"ISERVER","GEOJSON"。
21+
* @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,iServer|iPortal|Online。
22+
* @param {SuperMap.DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为"ISERVER","GEOJSON"。
23+
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
2324
*/
2425
export class ChartFeatureInfoSpecsService extends CommonServiceBase {
2526

src/common/iServer/ChartQueryService.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ import {GeoJSON} from '../format/GeoJSON';
2020
* @param {string} url - 地图查询服务访问地址。如:"http://192.168.168.35:8090/iserver/services/map-ChartW/rest/maps/海图"。
2121
* @param {Object} options - 参数。
2222
* @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
23-
* @param {SuperMap.ServerType} options.serverType - 服务器类型,iServer|iPortal|Online。
24-
* @param {SuperMap.DataFormat} options.format - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为"ISERVER","GEOJSON"。
23+
* @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,iServer|iPortal|Online。
24+
* @param {SuperMap.DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为"ISERVER","GEOJSON"。
25+
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
2526
* @example
2627
* 下面示例显示了如何进行海图属性查询:
2728
* var nameArray = ["GB4X0000_52000"];

0 commit comments

Comments
 (0)