@supermapgis/iclient-ol 11.2.0

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 +97 -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 +500 -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 +124963 -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 +142946 -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 +150 -0
  23. package/mapping/SuperMapCloud.js +56 -0
  24. package/mapping/Tianditu.js +152 -0
  25. package/mapping/TileSuperMapRest.js +374 -0
  26. package/mapping/WebMap.js +5485 -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 +100 -0
  35. package/overlay/Graph.js +439 -0
  36. package/overlay/GraphMap.js +140 -0
  37. package/overlay/Graphic.js +588 -0
  38. package/overlay/HeatMap.js +450 -0
  39. package/overlay/Label.js +966 -0
  40. package/overlay/Mapv.js +149 -0
  41. package/overlay/Range.js +129 -0
  42. package/overlay/RankSymbol.js +94 -0
  43. package/overlay/Turf.js +299 -0
  44. package/overlay/Unique.js +124 -0
  45. package/overlay/VectorTileSuperMapRest.js +501 -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 +64 -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 +413 -0
  55. package/overlay/mapv/index.js +5 -0
  56. package/overlay/theme/GeoFeature.js +275 -0
  57. package/overlay/theme/Theme.js +587 -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 +377 -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 +30 -0
  67. package/services/AddressMatchService.js +60 -0
  68. package/services/ChartService.js +97 -0
  69. package/services/DataFlowService.js +119 -0
  70. package/services/DatasetService.js +104 -0
  71. package/services/DatasourceService.js +76 -0
  72. package/services/FeatureService.js +260 -0
  73. package/services/FieldService.js +53 -0
  74. package/services/GeoprocessingService.js +157 -0
  75. package/services/GridCellInfosService.js +53 -0
  76. package/services/ImageCollectionService.js +93 -0
  77. package/services/ImageService.js +70 -0
  78. package/services/KnowledgeGraphService.js +96 -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 +93 -0
  83. package/services/NetworkAnalystService.js +268 -0
  84. package/services/ProcessingService.js +507 -0
  85. package/services/QueryService.js +116 -0
  86. package/services/ServiceBase.js +26 -0
  87. package/services/SpatialAnalystService.js +466 -0
  88. package/services/ThemeService.js +50 -0
  89. package/services/TrafficTransferAnalystService.js +93 -0
  90. package/services/WebPrintingJobService.js +112 -0
  91. package/services/index.js +27 -0
@@ -0,0 +1,133 @@
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
+
5
+ import RegularShape from 'ol/style/RegularShape';
6
+ import FillStyle from 'ol/style/Fill';
7
+ import StrokeStyle from 'ol/style/Stroke';
8
+ /**
9
+ * @class CloverShape
10
+ * @browsernamespace ol.style
11
+ * @category Visualization Graphic
12
+ * @classdesc 三叶草要素风格。除了基本的线颜色、线宽、填充色、填充透明度、填充形状等参数,还可以设置三叶草要素扇叶的圆心角、间隔角度、数量、半径等。
13
+ * @modulecategory Overlay
14
+ * @extends {ol.style.RegularShape}
15
+ * @param {Object} options - 三叶草形要素风格参数。
16
+ * @param {number} [options.angle=30] - 三叶草每个扇叶的圆心角,单位弧度。
17
+ * @param {number} [options.count=3] - 扇叶数量。
18
+ * @param {ol.style.Fill} [options.fill] - 填充样式。
19
+ * @param {number} [options.strokeOpacity] - 边框不透明度。
20
+ * @param {number} [options.fillOpacity] - 填充不透明度。
21
+ * @param {number} [options.radius] - 扇叶的半径,单位为像素。
22
+ * @param {ol.style.Stroke} [options.stroke] - 边框样式。
23
+ * @param {string} [options.stroke.color='#3388ff'] - 十六进制边框颜色。
24
+ * @param {number} [options.stroke.width=1] - 边框宽度。
25
+ * @usage
26
+ */
27
+ export class CloverShape extends RegularShape {
28
+
29
+ constructor(options) {
30
+ if (options.stroke) {
31
+ options.stroke.color = options.stroke.getColor() || "#3388ff";
32
+ options.stroke.width = options.stroke.getWidth() || 1;
33
+ } else {
34
+ options.stroke = new StrokeStyle({
35
+ color: "#3388ff",
36
+ width: 1
37
+ })
38
+ }
39
+ if (options.fill) {
40
+ options.fill.color = options.fill.getColor() || "#66ccff";
41
+ } else {
42
+ options.fill = new FillStyle({
43
+ color: "#66ccff"
44
+ })
45
+ }
46
+ super({
47
+ angle: options.angle || 60,
48
+ stroke: options.stroke,
49
+ fill: options.fill,
50
+ radius: options.radius || 10,
51
+ rotation: options.rotation || 0
52
+ });
53
+ this.count_ = options.count || 3;
54
+ this.strokeOpacity = options.strokeOpacity || 1;
55
+ this.fillOpacity = options.fillOpacity || 1;
56
+
57
+ this._pixelRatio = window ? window.devicePixelRatio : 1;
58
+ this._canvas = this.getImage(this._pixelRatio);
59
+ this._ctx = this._canvas.getContext('2d');
60
+ this._render();
61
+ }
62
+
63
+
64
+ _render() {
65
+ //起始角度
66
+ var sAngle = 0;
67
+ var eAngle = this.getAngle();
68
+ this.spaceAngle = 360 / this.count_ - this.getAngle();
69
+ if (this.spaceAngle < 0) {
70
+ return;
71
+ }
72
+ this._ctx.setTransform(this._pixelRatio, 0, 0, this._pixelRatio, 0, 0);
73
+ this._ctx.translate(0, 0);
74
+ this._ctx.beginPath();
75
+ for (var i = 0; i < this.count_; i++) {
76
+ this._drawSector(this._ctx, this.getAnchor()[0], this.getAnchor()[1], this.getRadius(), sAngle, eAngle);
77
+ sAngle = eAngle + this.spaceAngle;
78
+ eAngle = sAngle + this.getAngle();
79
+ }
80
+ this._fillStroke();
81
+ this._ctx.closePath();
82
+ }
83
+
84
+ /**
85
+ * @function CloverShape.prototype.drawSector
86
+ * @description 绘制扇形。
87
+ * @param {CanvasRenderingContext2D} ctx - context 对象。
88
+ * @param {number} x - 中心点 x 坐标。
89
+ * @param {number} y - 中心点 y 坐标。
90
+ * @param {number} r - 扇叶半径 r。
91
+ * @param {number} sAngle - 扇叶起始角度。
92
+ * @param {number} eAngle - 扇叶终止角度。
93
+ */
94
+ _drawSector(ctx, x, y, r, sAngle, eAngle) {
95
+ //角度转换
96
+ sAngle = sAngle / 180 * Math.PI;
97
+ eAngle = eAngle / 180 * Math.PI;
98
+ ctx.moveTo(x, y);
99
+ ctx.lineTo(x + r * Math.cos(sAngle), y + r * Math.sin(sAngle));
100
+ ctx.arc(x, y, r, sAngle, eAngle);
101
+ ctx.lineTo(x, y);
102
+ }
103
+
104
+ _fillStroke() {
105
+ if (this.getFill()) {
106
+ this._ctx.globalAlpha = this.fillOpacity;
107
+ this._ctx.fillStyle = this.getFill().color;
108
+ this._ctx.fill();
109
+ }
110
+ if (this.getStroke() && this.weight !== 0) {
111
+ this._ctx.globalAlpha = this.strokeOpacity;
112
+ this._ctx.lineWidth = this.getStroke().width;
113
+ this._ctx.strokeStyle = this.getStroke().color;
114
+ this._ctx.lineCap = this.getStroke().lineCap;
115
+ this._ctx.lineJoin = this.getStroke().lineJoin;
116
+ this._ctx.stroke();
117
+ }
118
+ }
119
+ /**
120
+ * @function CloverShape.prototype.getCount
121
+ * @description 获取扇叶数量。
122
+ */
123
+ getCount() {
124
+ return this.count_;
125
+ }
126
+ /**
127
+ * @function CloverShape.prototype.getSpaceAngle
128
+ * @description 获取扇叶间隔角度。
129
+ */
130
+ getSpaceAngle() {
131
+ return this.spaceAngle;
132
+ }
133
+ }
@@ -0,0 +1,174 @@
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
+
5
+ import BaseObject from 'ol/Object';
6
+ import Geometry from 'ol/geom/Geometry';
7
+ import Style from 'ol/style/Style';
8
+
9
+ /**
10
+ * @class OverlayGraphic
11
+ * @browsernamespace ol
12
+ * @aliasclass Graphic
13
+ * @category Visualization Graphic
14
+ * @classdesc 高效率点图层点要素类。高效率点图层中的点要素,类型为ol.geom.Point。支持获取或修改点要素的属性、样式、几何信息。
15
+ * @modulecategory Overlay
16
+ * @param {ol.geom.Point} geometry - 几何对象。
17
+ * @param {Object} [attributes] - 要素属性。
18
+ * @extends {ol.Object}
19
+ * @usage
20
+ */
21
+ export class Graphic extends BaseObject {
22
+
23
+ constructor(geometry, attributes) {
24
+ super();
25
+ if (geometry instanceof Geometry) {
26
+ this.geometry_ = geometry;
27
+ }
28
+ this.attributes = attributes;
29
+ this.setStyle();
30
+ }
31
+
32
+ /**
33
+ * @function OverlayGraphic.prototype.clone
34
+ * @description 克隆当前要素。
35
+ * @returns {OverlayGraphic} 克隆后的要素。
36
+ */
37
+ clone() {
38
+ var clone = new Graphic();
39
+ clone.setId(this.id);
40
+ clone.setGeometry(this.geometry_);
41
+ clone.setAttributes(this.attributes);
42
+ clone.setStyle(this.style_);
43
+ return clone;
44
+ }
45
+
46
+ /**
47
+ * @function OverlayGraphic.prototype.getId
48
+ * @description 获取当前 ID。
49
+ * @returns {string} ID。
50
+ */
51
+ getId() {
52
+ return this.id;
53
+ }
54
+
55
+ /**
56
+ * @function OverlayGraphic.prototype.setId
57
+ * @description 设置当前要素 ID。
58
+ * @param {string} id - 要素 ID。
59
+ */
60
+ setId(id) {
61
+ this.id = id;
62
+ }
63
+
64
+ /**
65
+ * @function OverlayGraphic.prototype.getGeometry
66
+ * @description 获取当前要素几何信息。
67
+ * @returns {ol.geom.Point} 要素几何信息。
68
+ */
69
+ getGeometry() {
70
+ return this.geometry_;
71
+ }
72
+
73
+ /**
74
+ * @function OverlayGraphic.prototype.setGeometry
75
+ * @description 设置当前要素几何信息。
76
+ * @param {ol.geom.Point} geometry - 要素几何信息。
77
+ */
78
+ setGeometry(geometry) {
79
+ this.geometry_ = geometry;
80
+ }
81
+
82
+ /**
83
+ * @function OverlayGraphic.prototype.setAttributes
84
+ * @description 设置要素属性。
85
+ * @param {Object} attributes - 属性对象。
86
+ */
87
+ setAttributes(attributes) {
88
+ this.attributes = attributes;
89
+ }
90
+
91
+ /**
92
+ * @function OverlayGraphic.prototype.getAttributes
93
+ * @description 获取要素属性。
94
+ * @returns {Object} 要素属性。
95
+ */
96
+ getAttributes() {
97
+ return this.attributes;
98
+ }
99
+
100
+ /**
101
+ * @function OverlayGraphic.prototype.getStyle
102
+ * @description 获取要素样式。
103
+ * @returns {ol.style.Image} ol.style.Image 子类样式对象。
104
+ */
105
+ getStyle() {
106
+ return this.style_;
107
+ }
108
+
109
+ /**
110
+ * @function OverlayGraphic.prototype.setStyle
111
+ * @description 设置要素样式。
112
+ * @param {ol.style.Image} style - 样式,ol.style.Image 子类样式对象。
113
+ */
114
+ setStyle(style) {
115
+ if (!this.style && !style) {
116
+ return;
117
+ }
118
+ this.style_ = style;
119
+ this.styleFunction_ = !style ?
120
+ undefined : Graphic.createStyleFunction(new Style({
121
+ image: style
122
+ }));
123
+ this.changed();
124
+ }
125
+
126
+ /**
127
+ * @function OverlayGraphic.prototype.getStyleFunction
128
+ * @description 获取样式函数。
129
+ * @returns {function} 样式函数。
130
+ */
131
+ getStyleFunction() {
132
+ return this.styleFunction_;
133
+ }
134
+
135
+ /**
136
+ * @function OverlayGraphic.createStyleFunction
137
+ * @description 新建样式函数。
138
+ * @param {Object} obj - 对象参数。
139
+ */
140
+ static createStyleFunction(obj) {
141
+ var styleFunction;
142
+ if (typeof obj === 'function') {
143
+ if (obj.length == 2) {
144
+ styleFunction = function (resolution) {
145
+ return (obj)(this, resolution);
146
+ };
147
+ } else {
148
+ styleFunction = obj;
149
+ }
150
+ } else {
151
+ var styles;
152
+ if (Array.isArray(obj)) {
153
+ styles = obj;
154
+ } else {
155
+ styles = [obj];
156
+ }
157
+ styleFunction = function () {
158
+ return styles;
159
+ };
160
+ }
161
+ return styleFunction;
162
+ }
163
+
164
+ /**
165
+ * @function OverlayGraphic.prototype.destroy
166
+ * @description 清除参数值。
167
+ */
168
+ destroy() {
169
+ this.id = null;
170
+ this.geometry_ = null;
171
+ this.attributes = null;
172
+ this.style_ = null;
173
+ }
174
+ }
@@ -0,0 +1,64 @@
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 {
5
+ CloverShape
6
+ } from './CloverShape'
7
+
8
+ /**
9
+ * @class HitCloverShape
10
+ * @browsernamespace ol.style
11
+ * @category Visualization Graphic
12
+ * @classdesc 三叶草要素高亮风格。除了基本的线颜色、线宽、填充色、填充透明度、填充形状等参数,
13
+ * 还可以设置三叶草要素扇叶的圆心角、间隔角度、数量、半径等。
14
+ * @modulecategory Overlay
15
+ * @extends {CloverShape}
16
+ * @param {Object} options - 三叶草形要素风格参数。
17
+ * @param {number} options.sAngle - 扇叶起始角度。
18
+ * @param {number} options.eAngle - 扇叶终止角度。
19
+ * @param {number} [options.angle = 30] - 三叶草每个扇叶的圆心角,单位弧度。
20
+ * @param {ol.style.Fill} [options.fill] - 填充样式。
21
+ * @param {ol.style.Stroke} [options.stroke] - 边框样式。
22
+ * @param {number} [options.strokeOpacity] - 边框透明度。
23
+ * @param {number} [options.fillOpacity] - 填充透明度。
24
+ * @param {number} [options.radius] -扇叶半径。
25
+ * @usage
26
+ */
27
+ export class HitCloverShape extends CloverShape {
28
+
29
+ constructor(options) {
30
+ super(options);
31
+ this.sAngle = options.sAngle;
32
+ this.eAngle = options.eAngle;
33
+ this._render();
34
+ }
35
+
36
+
37
+ _render() {
38
+ // draw the circle on the canvas
39
+ this._ctx.clearRect(0, 0, this.getImage().width, this.getImage().height);
40
+ // reset transform
41
+ this._ctx.setTransform(this._pixelRatio, 0, 0, this._pixelRatio, 0, 0);
42
+ this._ctx.translate(0, 0);
43
+ this._ctx.beginPath();
44
+
45
+ this._drawSector(this._ctx, this.getAnchor()[0], this.getAnchor()[1], this.getRadius(), this.sAngle, this.eAngle);
46
+ this._fillStroke();
47
+
48
+ this._ctx.closePath();
49
+ }
50
+ /**
51
+ * @function HitCloverShape.prototype.getSAngle
52
+ * @description 获取扇叶起始角度。
53
+ */
54
+ getSAngle() {
55
+ return this.sAngle;
56
+ }
57
+ /**
58
+ * @function HitCloverShape.prototype.getEAngle
59
+ * @description 获取扇叶终止角度。
60
+ */
61
+ getEAngle() {
62
+ return this.eAngle;
63
+ }
64
+ }