@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.
Files changed (91) hide show
  1. package/README.md +56 -0
  2. package/control/ChangeTileVersion.js +438 -0
  3. package/control/Logo.js +99 -0
  4. package/control/ScaleLine.js +164 -0
  5. package/control/index.js +6 -0
  6. package/core/MapExtend.js +49 -0
  7. package/core/StyleUtils.js +1253 -0
  8. package/core/Util.js +478 -0
  9. package/core/index.js +6 -0
  10. package/css/ChangeTileVersion.css +347 -0
  11. package/css/index.js +5 -0
  12. package/dist/iclient-openlayers-es6.js +121806 -0
  13. package/dist/iclient-openlayers-es6.min.js +8 -0
  14. package/dist/iclient-openlayers.css +668 -0
  15. package/dist/iclient-openlayers.js +132335 -0
  16. package/dist/iclient-openlayers.min.css +8 -0
  17. package/dist/iclient-openlayers.min.js +8 -0
  18. package/index.js +9 -0
  19. package/mapping/BaiduMap.js +121 -0
  20. package/mapping/ImageSuperMapRest.js +252 -0
  21. package/mapping/ImageTileSuperMapRest.js +99 -0
  22. package/mapping/InitMap.js +125 -0
  23. package/mapping/SuperMapCloud.js +56 -0
  24. package/mapping/Tianditu.js +152 -0
  25. package/mapping/TileSuperMapRest.js +358 -0
  26. package/mapping/WebMap.js +5185 -0
  27. package/mapping/index.js +11 -0
  28. package/mapping/webmap/Util.js +176 -0
  29. package/mapping/webmap/config/MunicipalCenter.json +1 -0
  30. package/mapping/webmap/config/ProvinceCenter.json +1 -0
  31. package/mapping/webmap/config/SampleDataInfo.json +55 -0
  32. package/namespace.js +150 -0
  33. package/overlay/DataFlow.js +114 -0
  34. package/overlay/FGB.js +97 -0
  35. package/overlay/Graph.js +436 -0
  36. package/overlay/GraphMap.js +91 -0
  37. package/overlay/Graphic.js +587 -0
  38. package/overlay/HeatMap.js +444 -0
  39. package/overlay/Label.js +964 -0
  40. package/overlay/Mapv.js +146 -0
  41. package/overlay/Range.js +127 -0
  42. package/overlay/RankSymbol.js +94 -0
  43. package/overlay/Turf.js +298 -0
  44. package/overlay/Unique.js +123 -0
  45. package/overlay/VectorTileSuperMapRest.js +466 -0
  46. package/overlay/graphic/CanvasRenderer.js +177 -0
  47. package/overlay/graphic/CloverShape.js +133 -0
  48. package/overlay/graphic/Graphic.js +174 -0
  49. package/overlay/graphic/HitCloverShape.js +63 -0
  50. package/overlay/graphic/WebGLRenderer.js +356 -0
  51. package/overlay/graphic/index.js +9 -0
  52. package/overlay/index.js +21 -0
  53. package/overlay/mapv/MapvCanvasLayer.js +104 -0
  54. package/overlay/mapv/MapvLayer.js +410 -0
  55. package/overlay/mapv/index.js +5 -0
  56. package/overlay/theme/GeoFeature.js +275 -0
  57. package/overlay/theme/Theme.js +585 -0
  58. package/overlay/theme/ThemeFeature.js +46 -0
  59. package/overlay/theme/index.js +6 -0
  60. package/overlay/vectortile/DeafultCanvasStyle.js +125 -0
  61. package/overlay/vectortile/MapboxStyles.js +375 -0
  62. package/overlay/vectortile/StyleMap.js +252 -0
  63. package/overlay/vectortile/VectorTileStyles.js +554 -0
  64. package/overlay/vectortile/index.js +7 -0
  65. package/overlay/vectortile/olExtends.js +382 -0
  66. package/package.json +29 -0
  67. package/services/AddressMatchService.js +60 -0
  68. package/services/ChartService.js +74 -0
  69. package/services/DataFlowService.js +118 -0
  70. package/services/DatasetService.js +104 -0
  71. package/services/DatasourceService.js +76 -0
  72. package/services/FeatureService.js +196 -0
  73. package/services/FieldService.js +53 -0
  74. package/services/GeoprocessingService.js +156 -0
  75. package/services/GridCellInfosService.js +53 -0
  76. package/services/ImageCollectionService.js +92 -0
  77. package/services/ImageService.js +69 -0
  78. package/services/KnowledgeGraphService.js +82 -0
  79. package/services/LayerInfoService.js +85 -0
  80. package/services/MapService.js +85 -0
  81. package/services/MeasureService.js +77 -0
  82. package/services/NetworkAnalyst3DService.js +88 -0
  83. package/services/NetworkAnalystService.js +252 -0
  84. package/services/ProcessingService.js +478 -0
  85. package/services/QueryService.js +116 -0
  86. package/services/ServiceBase.js +26 -0
  87. package/services/SpatialAnalystService.js +432 -0
  88. package/services/ThemeService.js +50 -0
  89. package/services/TrafficTransferAnalystService.js +88 -0
  90. package/services/WebPrintingJobService.js +112 -0
  91. package/services/index.js +27 -0
@@ -0,0 +1,92 @@
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 { ServiceBase } from './ServiceBase';
5
+ import CommonMatchImageCollectionService from '@supermapgis/iclient-common/iServer/ImageCollectionService';
6
+
7
+ /**
8
+ * @class ImageCollectionService
9
+ * @version 10.2.0
10
+ * @constructs ImageCollectionService
11
+ * @classdesc 影像集合服务类。
12
+ * @modulecategory Services
13
+ * @category iServer Image
14
+ * @extends {ServiceBase}
15
+ * @example
16
+ * new ImageCollectionService(url,options).getLegend(queryParams,function(result){
17
+ * //doSomething
18
+ * })
19
+ * @param {string} url - 服务地址。例如: http://{ip}:{port}/iserver/{imageservice-imageserviceName}/restjsr/
20
+ * @param {Object} options - 参数。
21
+ * @param {string} options.collectionId 影像集合(Collection)的ID,在一个影像服务中唯一标识影像集合。
22
+ * @param {string} [options.proxy] - 服务代理地址。
23
+ * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
24
+ * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
25
+ * @param {Object} [options.headers] - 请求头。
26
+ * @usage
27
+ */
28
+ export class ImageCollectionService extends ServiceBase {
29
+ constructor(url, options) {
30
+ super(url, options);
31
+ this._imageCollectionService = new CommonMatchImageCollectionService(this.url, {
32
+ collectionId: this.options.collectionId,
33
+ proxy: this.options.proxy,
34
+ withCredentials: this.options.withCredentials,
35
+ crossOrigin: this.options.crossOrigin,
36
+ headers: this.options.headers
37
+ });
38
+ }
39
+
40
+ /**
41
+ * @function ImageCollectionService.prototype.getLegend
42
+ * @param {Object} queryParams query参数。
43
+ * @param {ImageRenderingRule} [queryParams.renderingRule] 指定影像显示的风格,包含拉伸显示方式、颜色表、波段组合以及应用栅格函数进行快速处理等。不指定时,使用发布服务时所配置的风格。
44
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
45
+ * @returns {Promise} Promise 对象。
46
+ */
47
+ getLegend(queryParams, callback) {
48
+ return this._imageCollectionService.getLegend(queryParams, callback);
49
+ }
50
+
51
+ /**
52
+ * @function ImageCollectionService.prototype.getStatistics
53
+ * @description 返回当前影像集合的统计信息。包括文件数量,文件大小等信息。
54
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
55
+ * @returns {Promise} Promise 对象。
56
+ */
57
+ getStatistics(callback) {
58
+ return this._imageCollectionService.getStatistics(callback);
59
+ }
60
+
61
+ /**
62
+ * @function ImageCollectionService.prototype.getTileInfo
63
+ * @description 返回影像集合所提供的服务瓦片的信息,包括:每层瓦片的分辨率,比例尺等信息,方便前端进行图层叠加。
64
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
65
+ * @returns {Promise} Promise 对象。
66
+ */
67
+ getTileInfo(callback) {
68
+ return this._imageCollectionService.getTileInfo(callback);
69
+ }
70
+
71
+ /**
72
+ * @function ImageCollectionService.prototype.deleteItemByID
73
+ * @description 删除影像集合中的指定ID(`featureId`)的Item对象,即从影像集合中删除指定的影像。
74
+ * @param {string} featureId Feature 的本地标识符。
75
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
76
+ * @returns {Promise} Promise 对象。
77
+ */
78
+ deleteItemByID(featureId, callback) {
79
+ return this._imageCollectionService.deleteItemByID(featureId, callback);
80
+ }
81
+
82
+ /**
83
+ * @function ImageCollectionService.prototype.getItemByID
84
+ * @description 返回影像集合中的指定ID(`featureId`)的Item对象,即返回影像集合中指定的影像。
85
+ * @param {string} featureId Feature 的本地标识符。
86
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
87
+ * @returns {Promise} Promise 对象。
88
+ */
89
+ getItemByID(featureId, callback) {
90
+ return this._imageCollectionService.getItemByID(featureId, callback);
91
+ }
92
+ }
@@ -0,0 +1,69 @@
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 { ServiceBase } from './ServiceBase';
5
+ import CommonMatchImageService from '@supermapgis/iclient-common/iServer/ImageService';
6
+
7
+ /**
8
+ * @class ImageService
9
+ * @version 10.2.0
10
+ * @constructs ImageService
11
+ * @classdesc 影像服务类。
12
+ * @modulecategory Services
13
+ * @category iServer Image
14
+ * @extends {ServiceBase}
15
+ * @example
16
+ * ImageService(url,options).getCollections(function(result){
17
+ * //doSomething
18
+ * })
19
+ * @param {string} url - 服务地址。例如: http://{ip}:{port}/iserver/{imageservice-imageserviceName}/restjsr/
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
+ * @usage
26
+ */
27
+ export class ImageService extends ServiceBase {
28
+ constructor(url, options) {
29
+ super(url, options);
30
+ this._imageService = new CommonMatchImageService(this.url, {
31
+ proxy: this.options.proxy,
32
+ withCredentials: this.options.withCredentials,
33
+ crossOrigin: this.options.crossOrigin,
34
+ headers: this.options.headers
35
+ });
36
+ }
37
+
38
+ /**
39
+ * @function ImageService.prototype.getCollections
40
+ * @description 返回当前影像服务中的影像集合列表(Collections)。
41
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
42
+ * @returns {Promise} Promise 对象。
43
+ */
44
+ getCollections(callback) {
45
+ return this._imageService.getCollections(callback);
46
+ }
47
+
48
+ /**
49
+ * @function ImageService.prototype.getCollectionByID
50
+ * @description ID值等于`collectionId`参数值的影像集合(Collection)。ID值用于在服务中唯一标识该影像集合。
51
+ * @param {string} collectionId 影像集合(Collection)的ID,在一个影像服务中唯一标识影像集合。
52
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
53
+ * @returns {Promise} Promise 对象。
54
+ */
55
+ getCollectionByID(collectionId, callback) {
56
+ return this._imageService.getCollectionByID(collectionId, callback);
57
+ }
58
+
59
+ /**
60
+ * @function ImageService.prototype.search
61
+ * @description 查询与过滤条件匹配的影像数据。
62
+ * @param {ImageSearchParameter} [itemSearch] 查询参数。
63
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
64
+ * @returns {Promise} Promise 对象。
65
+ */
66
+ search(itemSearch, callback) {
67
+ return this._imageService.search(itemSearch, callback);
68
+ }
69
+ }
@@ -0,0 +1,82 @@
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 { ServiceBase } from './ServiceBase';
5
+ import { KnowledgeGraphService as CommonKnowledgeGraphService } from '@supermapgis/iclient-common/iServer/KnowledgeGraphService';
6
+ /**
7
+ * @class KnowledgeGraphService
8
+ * @category iServer KnowledgeGraph
9
+ * @classdesc 知识图谱服务类。
10
+ * @version 11.1.0
11
+ * @example
12
+ * new KnowledgeGraphService(url)
13
+ * .query(param,function(result){
14
+ * //doSomething
15
+ * })
16
+ * @extends {ServiceBase}
17
+ * @param {string} url - 服务地址。
18
+ * @param {Object} options -参数。
19
+ * @param {string} [options.proxy] - 服务代理地址。
20
+ * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
21
+ * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
22
+ * @param {Object} [options.headers] - 请求头。
23
+ * @usage
24
+ */
25
+ export class KnowledgeGraphService extends ServiceBase {
26
+ constructor(url, options) {
27
+ super(url, options);
28
+ this._knowledgeGraphService = new CommonKnowledgeGraphService(url, options);
29
+ }
30
+
31
+ /**
32
+ * @function KnowledgeGraphService.prototype.query
33
+ * @description 通过查询语句查询知识图谱数据。
34
+ * @param {string} cypherQuery - 查询条件。
35
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
36
+ * @returns {Promise} Promise 对象。
37
+ */
38
+ query(cypherQuery, callback) {
39
+ return this._knowledgeGraphService.query(cypherQuery, callback);
40
+ }
41
+
42
+ // /**
43
+ // * @function KnowledgeGraphService.prototype.getMetaData
44
+ // * @description 获取元信息(展示所有实体类型和关系类型)。
45
+ // * @param {RequestCallback} callback 回调函数。
46
+ // */
47
+ // getMetaData(callback) {
48
+ // this._knowledgeGraphService.getMetaData(callback);
49
+ // }
50
+
51
+ /**
52
+ * @function KnowledgeGraphService.prototype.getGraphMaps
53
+ * @description 获取图谱列表。
54
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
55
+ * @returns {Promise} Promise 对象。
56
+ */
57
+ getGraphMaps(callback) {
58
+ return this._knowledgeGraphService.getGraphMaps(callback);
59
+ }
60
+
61
+ /**
62
+ * @function KnowledgeGraphService.prototype.getGraphMap
63
+ * @description 获取图谱图序列化数据。
64
+ * @param {string} params 图谱名称。
65
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
66
+ * @returns {Promise} Promise 对象。
67
+ */
68
+ getGraphMap(params, callback) {
69
+ return this._knowledgeGraphService.getGraphMap(params, callback);
70
+ }
71
+
72
+ /**
73
+ * @function KnowledgeGraphService.prototype.getGraphMapData
74
+ * @description 将iServer GraphMap服务的数据格式转换为KnowledgeGraph的数据格式。
75
+ * @param {string} graphMapName - 图谱名称。
76
+ * @returns {Promise} Promise 对象。
77
+ */
78
+ async getGraphMapData(graphMapName) {
79
+ const res = await this._knowledgeGraphService.getGraphMapData(graphMapName);
80
+ return res;
81
+ }
82
+ }
@@ -0,0 +1,85 @@
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 {ServiceBase} from './ServiceBase';
5
+ import { LayerInfoService as CommonLayerInfoService } from '@supermapgis/iclient-common/iServer/LayerInfoService';
6
+ /**
7
+ * @class LayerInfoService
8
+ * @category iServer Map Layer
9
+ * @classdesc 图层信息服务类。
10
+ * @modulecategory Services
11
+ * @extends {ServiceBase}
12
+ * @example
13
+ * new LayerInfoService(url).getLayersInfo(function(result){
14
+ * //doSomething
15
+ * })
16
+ * @param {string} url - 服务地址。请求地图服务,URL 应为:
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 {boolean} [options.crossOrigin] - 是否允许跨域请求。
22
+ * @param {Object} [options.headers] - 请求头。
23
+ * @usage
24
+ */
25
+ export class LayerInfoService extends ServiceBase {
26
+
27
+ constructor(url, options) {
28
+ super(url, options);
29
+ this._layerInfoService = new CommonLayerInfoService(url, options);
30
+ }
31
+
32
+ /**
33
+ * @function LayerInfoService.prototype.getLayersInfo
34
+ * @description 获取图层信息服务。
35
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
36
+ * @returns {Promise} Promise 对象。
37
+ */
38
+ getLayersInfo(callback) {
39
+ return this._layerInfoService.getLayersInfo(callback);
40
+ }
41
+
42
+ /**
43
+ * @function LayerInfoService.prototype.getLayersLegendInfo
44
+ * @description 获取地图的图例信息。
45
+ * @version 11.1.1
46
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
47
+ * @returns {Promise} Promise 对象。
48
+ */
49
+ getLayersLegendInfo(params, callback) {
50
+ return this._layerInfoService.getLayersLegendInfo(params, callback);
51
+ }
52
+
53
+ /**
54
+ * @function LayerInfoService.prototype.setLayerInfo
55
+ * @description 设置图层信息服务。可以实现临时图层中子图层的修改。
56
+ * @param {SetLayerInfoParameters} params - 设置图层信息参数类。
57
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
58
+ * @returns {Promise} Promise 对象。
59
+ */
60
+ setLayerInfo(params, callback) {
61
+ return this._layerInfoService.setLayerInfo(params, callback);
62
+ }
63
+
64
+ /**
65
+ * @function LayerInfoService.prototype.setLayersInfo
66
+ * @description 设置图层信息服务。可以创建新的临时图层和修改现有的临时图层。
67
+ * @param {SetLayersInfoParameters} params - 设置图层信息参数类。
68
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
69
+ * @returns {Promise} Promise 对象。
70
+ */
71
+ setLayersInfo(params, callback) {
72
+ return this._layerInfoService.setLayersInfo(params, callback);
73
+ }
74
+
75
+ /**
76
+ * @function LayerInfoService.prototype.setLayerStatus
77
+ * @description 子图层显示控制服务。负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
78
+ * @param {SetLayerStatusParameters} params - 子图层显示控制参数类。
79
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
80
+ * @returns {Promise} Promise 对象。
81
+ */
82
+ setLayerStatus(params, callback) {
83
+ return this._layerInfoService.setLayerStatus(params, callback);
84
+ }
85
+ }
@@ -0,0 +1,85 @@
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 { ServiceBase } from './ServiceBase';
5
+ import { Util } from '@supermapgis/iclient-common/commontypes/Util';
6
+ import { MapService as CommonMapService } from '@supermapgis/iclient-common/iServer/MapService';
7
+ import { TilesetsService } from '@supermapgis/iclient-common/iServer/TilesetsService';
8
+ /**
9
+ * @class MapService
10
+ * @category iServer Map
11
+ * @classdesc 地图信息服务类。
12
+ * @modulecategory Services
13
+ * @extends {ServiceBase}
14
+ * @param {string} url - 服务地址。
15
+ * @param {Object} options - 参数。
16
+ * @param {string} [options.proxy] - 服务代理地址。
17
+ * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
18
+ * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
19
+ * @param {Object} [options.headers] - 请求头。
20
+ * @example
21
+ * new MapService(url).getMapInfo(function(result){
22
+ * //doSomething
23
+ * })
24
+ * @usage
25
+ */
26
+ export class MapService extends ServiceBase {
27
+ constructor(url, options) {
28
+ super(url, options);
29
+ }
30
+
31
+ /**
32
+ * @function MapService.prototype.getMapInfo
33
+ * @description 地图信息查询服务。
34
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
35
+ * @returns {Promise} Promise 对象。
36
+ */
37
+ getMapInfo(callback) {
38
+ var me = this;
39
+ var getMapStatusService = new CommonMapService(me.url, {
40
+ proxy: me.options.proxy,
41
+ withCredentials: me.options.withCredentials,
42
+ crossOrigin: me.options.crossOrigin,
43
+ headers: me.options.headers,
44
+ projection: me.options.projection
45
+ });
46
+ return getMapStatusService.processAsync(callback);
47
+ }
48
+
49
+ /**
50
+ * @function MapService.prototype.getWKT
51
+ * @description 获取WKT。
52
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
53
+ * @returns {Promise} Promise 对象。
54
+ */
55
+ getWKT(callback) {
56
+ var me = this;
57
+ var getMapStatusService = new CommonMapService(Util.urlPathAppend(me.url,'prjCoordSys.wkt'), {
58
+ proxy: me.options.proxy,
59
+ withCredentials: me.options.withCredentials,
60
+ withoutFormatSuffix: true,
61
+ crossOrigin: me.options.crossOrigin,
62
+ headers: me.options.headers,
63
+ projection: me.options.projection
64
+ });
65
+ return getMapStatusService.processAsync(callback);
66
+ }
67
+
68
+ /**
69
+ * @function MapService.prototype.getTilesets
70
+ * @description 切片列表信息查询服务。
71
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
72
+ * @returns {MapService} 获取服务信息。
73
+ * @returns {Promise} Promise 对象。
74
+ */
75
+ getTilesets(callback) {
76
+ var me = this;
77
+ var tilesetsService = new TilesetsService(me.url, {
78
+ proxy: me.options.proxy,
79
+ withCredentials: me.options.withCredentials,
80
+ crossOrigin: me.options.crossOrigin,
81
+ headers: me.options.headers
82
+ });
83
+ return tilesetsService.processAsync(callback);
84
+ }
85
+ }
@@ -0,0 +1,77 @@
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 {Util} from '../core/Util';
5
+ import {ServiceBase} from './ServiceBase';
6
+ import { MeasureService as CommonMeasureService } from '@supermapgis/iclient-common/iServer/MeasureService';
7
+ import GeoJSON from 'ol/format/GeoJSON';
8
+
9
+ /**
10
+ * @class MeasureService
11
+ * @category iServer Map Measure
12
+ * @classdesc 量算服务。
13
+ * @modulecategory Services
14
+ * @extends {ServiceBase}
15
+ * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
16
+ * @param {Object} options - 参数。
17
+ * @param {string} [options.proxy] - 服务代理地址。
18
+ * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
19
+ * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
20
+ * @param {Object} [options.headers] - 请求头。
21
+ * @usage
22
+ */
23
+ export class MeasureService extends ServiceBase {
24
+
25
+ constructor(url, options) {
26
+ super(url, options);
27
+ }
28
+
29
+ /**
30
+ * @function MeasureService.prototype.measureDistance
31
+ * @description 测距。
32
+ * @param {MeasureParameters} params - 量算参数类。
33
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
34
+ * @returns {Promise} Promise 对象。
35
+ */
36
+ measureDistance(params, callback) {
37
+ return this.measure(params, 'DISTANCE', callback);
38
+ }
39
+
40
+ /**
41
+ * @function MeasureService.prototype.measureArea
42
+ * @description 测面积。
43
+ * @param {MeasureParameters} params - 量算参数类。
44
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
45
+ * @returns {Promise} Promise 对象。
46
+ */
47
+ measureArea(params, callback) {
48
+ return this.measure(params, 'AREA', callback);
49
+ }
50
+
51
+ /**
52
+ * @function MeasureService.prototype.measure
53
+ * @description 测量。
54
+ * @param {MeasureParameters} params - 量算参数类。
55
+ * @param {string} type - 类型。
56
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
57
+ * @returns {Promise} Promise 对象。
58
+ */
59
+ measure(params, type, callback) {
60
+ var me = this;
61
+ var measureService = new CommonMeasureService(me.url, {
62
+ proxy: me.options.proxy,
63
+ withCredentials: me.options.withCredentials,
64
+ crossOrigin: me.options.crossOrigin,
65
+ headers: me.options.headers,
66
+ measureMode: type
67
+ });
68
+ return measureService.processAsync(me._processParam(params), callback);
69
+ }
70
+
71
+ _processParam(params) {
72
+ if (params && params.geometry) {
73
+ params.geometry = Util.toSuperMapGeometry(JSON.parse((new GeoJSON()).writeGeometry(params.geometry)));
74
+ }
75
+ return params;
76
+ }
77
+ }
@@ -0,0 +1,88 @@
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 {ServiceBase} from './ServiceBase';
5
+ import { NetworkAnalyst3DService as CommonNetworkAnalyst3DService } from '@supermapgis/iclient-common/iServer/NetworkAnalyst3DService';
6
+ /**
7
+ * @class NetworkAnalyst3DService
8
+ * @category iServer FacilityAnalyst3D
9
+ * @classdesc 3D 网络分析服务类。
10
+ * @modulecategory Services
11
+ * @extends {ServiceBase}
12
+ * @example
13
+ * new NetworkAnalyst3DService(url).sinksFacilityAnalyst(params,function(result){
14
+ * //doSomething
15
+ * })
16
+ * @param {string} url - 网络分析服务地址。请求网络分析服务,URL 应为:
17
+ * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
18
+ * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
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 NetworkAnalyst3DService extends ServiceBase {
27
+
28
+ constructor(url, options) {
29
+ super(url, options);
30
+ this._networkAnalyst3DService = new CommonNetworkAnalyst3DService(url, options);
31
+ }
32
+
33
+ /**
34
+ * @function NetworkAnalyst3DService.prototype.sinksFacilityAnalyst
35
+ * @description 汇查找服务
36
+ * @param {FacilityAnalystSinks3DParameters} params- 最近设施分析参数类(汇查找资源)。
37
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
38
+ * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
39
+ */
40
+ sinksFacilityAnalyst(params, callback) {
41
+ return this._networkAnalyst3DService.sinksFacilityAnalyst(params, callback);
42
+ }
43
+
44
+ /**
45
+ * @function NetworkAnalyst3DService.prototype.sourcesFacilityAnalyst
46
+ * @description 源查找服务。
47
+ * @param {FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找服务)。
48
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
49
+ * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
50
+ */
51
+ sourcesFacilityAnalyst(params, callback) {
52
+ return this._networkAnalyst3DService.sourcesFacilityAnalyst(params, callback);
53
+ }
54
+
55
+ /**
56
+ * @function NetworkAnalyst3DService.prototype.traceUpFacilityAnalyst
57
+ * @description 上游追踪资源服务。
58
+ * @param {FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类。
59
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
60
+ * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
61
+ */
62
+
63
+ traceUpFacilityAnalyst(params, callback) {
64
+ return this._networkAnalyst3DService.traceUpFacilityAnalyst(params, callback);
65
+ }
66
+
67
+ /**
68
+ * @function NetworkAnalyst3DService.prototype.traceDownFacilityAnalyst
69
+ * @description 下游追踪资源服务。
70
+ * @param {FacilityAnalystTracedown3DParameters} params - 下游追踪资源服务参数类。
71
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
72
+ * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
73
+ */
74
+ traceDownFacilityAnalyst(params, callback) {
75
+ return this._networkAnalyst3DService.traceDownFacilityAnalyst(params, callback);
76
+ }
77
+
78
+ /**
79
+ * @function NetworkAnalyst3DService.prototype.upstreamFacilityAnalyst
80
+ * @description 上游关键设施查找服务。
81
+ * @param {FacilityAnalystUpstream3DParameters} params - 上游关键设施查找服务参数类。
82
+ * @param {RequestCallback} [callback] 回调函数,该参数未传时可通过返回的promise 获取结果。
83
+ * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
84
+ */
85
+ upstreamFacilityAnalyst(params, callback) {
86
+ return this._networkAnalyst3DService.upstreamFacilityAnalyst(params, callback);
87
+ }
88
+ }