@supermapgis/iclient-ol 11.2.1 → 12.0.0-r

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 (85) hide show
  1. package/control/ChangeTileVersion.js +1 -1
  2. package/control/Logo.js +1 -1
  3. package/control/ScaleLine.js +2 -3
  4. package/control/index.js +1 -1
  5. package/core/MapExtend.js +1 -1
  6. package/core/StyleUtils.js +3 -3
  7. package/core/Util.js +4 -20
  8. package/core/index.js +1 -1
  9. package/css/index.js +1 -1
  10. package/dist/iclient-openlayers-es6.js +25314 -16089
  11. package/dist/iclient-openlayers-es6.min.js +3 -3
  12. package/dist/iclient-openlayers.css +2 -2
  13. package/dist/iclient-openlayers.js +135928 -123450
  14. package/dist/iclient-openlayers.min.css +2 -2
  15. package/dist/iclient-openlayers.min.js +3 -3
  16. package/index.js +1 -1
  17. package/mapping/BaiduMap.js +1 -2
  18. package/mapping/ImageSuperMapRest.js +68 -12
  19. package/mapping/ImageTileSuperMapRest.js +1 -1
  20. package/mapping/SuperMapCloud.js +1 -1
  21. package/mapping/Tianditu.js +1 -1
  22. package/mapping/TileSuperMapRest.js +1 -1
  23. package/mapping/WebMap.js +321 -166
  24. package/mapping/index.js +1 -1
  25. package/namespace.js +1 -1
  26. package/overlay/DataFlow.js +1 -1
  27. package/overlay/FGB.js +69 -4
  28. package/overlay/Graph.js +1 -1
  29. package/overlay/GraphMap.js +1 -1
  30. package/overlay/Graphic.js +1 -1
  31. package/overlay/HeatMap.js +1 -1
  32. package/overlay/Label.js +1 -1
  33. package/overlay/Mapv.js +1 -1
  34. package/overlay/Range.js +1 -1
  35. package/overlay/RankSymbol.js +1 -1
  36. package/overlay/Turf.js +1 -1
  37. package/overlay/Unique.js +1 -1
  38. package/overlay/VectorTileSuperMapRest.js +120 -87
  39. package/overlay/graphic/CanvasRenderer.js +1 -1
  40. package/overlay/graphic/CloverShape.js +1 -1
  41. package/overlay/graphic/Graphic.js +1 -1
  42. package/overlay/graphic/HitCloverShape.js +1 -1
  43. package/overlay/graphic/WebGLRenderer.js +1 -1
  44. package/overlay/graphic/index.js +1 -1
  45. package/overlay/index.js +1 -1
  46. package/overlay/mapv/MapvCanvasLayer.js +1 -1
  47. package/overlay/mapv/MapvLayer.js +1 -1
  48. package/overlay/mapv/index.js +1 -1
  49. package/overlay/theme/GeoFeature.js +1 -1
  50. package/overlay/theme/Theme.js +1 -1
  51. package/overlay/theme/ThemeFeature.js +1 -1
  52. package/overlay/theme/index.js +1 -1
  53. package/overlay/vectortile/DeafultCanvasStyle.js +1 -1
  54. package/overlay/vectortile/MapboxStyles.js +428 -389
  55. package/overlay/vectortile/StyleMap.js +1 -1
  56. package/overlay/vectortile/VectorTileStyles.js +1 -1
  57. package/overlay/vectortile/index.js +1 -1
  58. package/overlay/vectortile/olExtends.js +1 -1
  59. package/package.json +7 -7
  60. package/services/AddressMatchService.js +1 -1
  61. package/services/ChartService.js +1 -1
  62. package/services/DataFlowService.js +1 -1
  63. package/services/DatasetService.js +1 -1
  64. package/services/DatasourceService.js +1 -1
  65. package/services/FeatureService.js +1 -1
  66. package/services/FieldService.js +1 -1
  67. package/services/GridCellInfosService.js +1 -1
  68. package/services/ImageCollectionService.js +1 -1
  69. package/services/ImageService.js +1 -1
  70. package/services/KnowledgeGraphService.js +1 -1
  71. package/services/LayerInfoService.js +1 -1
  72. package/services/MapService.js +1 -1
  73. package/services/MeasureService.js +1 -1
  74. package/services/NetworkAnalyst3DService.js +1 -1
  75. package/services/NetworkAnalystService.js +1 -1
  76. package/services/ProcessingService.js +1 -1
  77. package/services/QueryService.js +1 -1
  78. package/services/ServiceBase.js +1 -1
  79. package/services/SpatialAnalystService.js +1 -1
  80. package/services/ThemeService.js +1 -1
  81. package/services/TrafficTransferAnalystService.js +1 -1
  82. package/services/WebPrintingJobService.js +1 -1
  83. package/services/index.js +1 -1
  84. package/mapping/webmap/config/MunicipalCenter.json +0 -1
  85. package/mapping/webmap/config/ProvinceCenter.json +0 -1
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* Copyright© 2000 - 2024 SuperMap Software Co.Ltd. All rights reserved.
1
+ /* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
2
2
  * This program are made available under the terms of the Apache License, Version 2.0
3
3
  * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
4
4
  export * from '@supermapgis/iclient-common/index.common';
@@ -1,4 +1,4 @@
1
- /* Copyright© 2000 - 2024 SuperMap Software Co.Ltd. All rights reserved.
1
+ /* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
2
2
  * This program are made available under the terms of the Apache License, Version 2.0
3
3
  * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
4
4
  import TileImage from 'ol/source/TileImage';
@@ -62,7 +62,6 @@ export class BaiduMap extends TileImage {
62
62
  .replace('{z}', tileCoord[0].toString())
63
63
  .replace('{x}', tileCoord[1].toString())
64
64
  .replace('{y}', function() {
65
- console.log(Util.getOlVersion());
66
65
  var y = ['4', '5'].indexOf(Util.getOlVersion()) > -1 ? tileCoord[2] : -tileCoord[2] - 1;
67
66
  return y.toString();
68
67
  })
@@ -1,4 +1,4 @@
1
- /* Copyright© 2000 - 2024 SuperMap Software Co.Ltd. All rights reserved.
1
+ /* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
2
2
  * This program are made available under the terms of the Apache License, Version 2.0
3
3
  * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
4
4
  import { SecurityManager } from '@supermapgis/iclient-common/security/SecurityManager';
@@ -6,8 +6,8 @@ import { Unit } from '@supermapgis/iclient-common/REST';
6
6
  import { Util as CommonUtil } from '@supermapgis/iclient-common/commontypes/Util';
7
7
  import { ServerGeometry } from '@supermapgis/iclient-common/iServer/ServerGeometry';
8
8
  import { Util } from '../core/Util';
9
- import ImageSource, { defaultImageLoadFunction } from 'ol/source/Image';
10
- import ImageWrapper from 'ol/Image';
9
+ import ImageSource from 'ol/source/Image';
10
+ import ImageWrapper, { decode } from 'ol/Image';
11
11
  import Geometry from 'ol/geom/Geometry';
12
12
  import GeoJSON from 'ol/format/GeoJSON';
13
13
  import { containsExtent, getCenter, getHeight, getWidth, getForViewAndSize } from 'ol/extent';
@@ -42,12 +42,23 @@ import { containsExtent, getCenter, getHeight, getWidth, getForViewAndSize } fro
42
42
  * @param {string} [options.tileProxy] - 代理地址。
43
43
  * @param {NDVIParameter|HillshadeParameter} [options.rasterfunction] - 栅格分析参数。
44
44
  * @param {string} [options.format = 'png'] - 瓦片表述类型,支持 "png" 、"webp"、"bmp" 、"jpg"、"gif" 等图片类型。
45
- * @param {Function} [options.imageLoadFunction] - 加载图片的方法。默认为function(imageTile, src) {imageTile.getImage().src = src;};
45
+ * @deprecated {Function} [options.imageLoadFunction] - 加载图片的方法。默认为function(imageTile, src) {imageTile.getImage().src = src;};
46
46
  * @param {string} [options.ratio=1.5] - 请求图片大小比例。 1 表示请求图片大小和地图视窗范围一致,2 表示请求图片大小是地图视窗范围的2倍,以此类推。
47
47
  * @extends {ol.source.Image}
48
48
  * @usage
49
49
  */
50
- export class ImageSuperMapRest extends ImageSource {
50
+
51
+ function defaultImageLoadFunction(image, src) {
52
+ image.getImage().src = src;
53
+ }
54
+
55
+ function fromResolutionLike(resolution) {
56
+ if (Array.isArray(resolution)) {
57
+ return Math.min(...resolution);
58
+ }
59
+ return resolution;
60
+ }
61
+ export class ImageSuperMapRest extends ImageSource {
51
62
  constructor(options) {
52
63
  super({
53
64
  attributions: options.attributions,
@@ -150,7 +161,8 @@ import { containsExtent, getCenter, getHeight, getWidth, getForViewAndSize } fro
150
161
  this.tileProxy = options.tileProxy;
151
162
  }
152
163
  }
153
- getImageInternal(extent, resolution, pixelRatio) {
164
+
165
+ _getImageInternalParams(extent, resolution, pixelRatio) {
154
166
  resolution = this.findNearestResolution(resolution);
155
167
  const imageResolution = resolution / pixelRatio;
156
168
  const center = getCenter(extent);
@@ -160,6 +172,19 @@ import { containsExtent, getCenter, getHeight, getWidth, getForViewAndSize } fro
160
172
  const requestWidth = Math.ceil((this.ratio_ * getWidth(extent)) / imageResolution);
161
173
  const requestHeight = Math.ceil((this.ratio_ * getHeight(extent)) / imageResolution);
162
174
  const requestExtent = getForViewAndSize(center, imageResolution, 0, [requestWidth, requestHeight]);
175
+ const imageSize = [
176
+ Math.round(getWidth(requestExtent) / imageResolution),
177
+ Math.round(getHeight(requestExtent) / imageResolution)
178
+ ];
179
+ const src = this._getRequestUrl(requestExtent, imageSize);
180
+ return { imageSize, src, requestExtent, resolution, viewExtent };
181
+ }
182
+ _getImageInternalBy8(extent, resolutionVal, pixelRatio) {
183
+ const { src, resolution, requestExtent, viewExtent } = this._getImageInternalParams(
184
+ extent,
185
+ resolutionVal,
186
+ pixelRatio
187
+ );
163
188
  const image = this._image;
164
189
  if (
165
190
  image &&
@@ -170,16 +195,11 @@ import { containsExtent, getCenter, getHeight, getWidth, getForViewAndSize } fro
170
195
  ) {
171
196
  return image;
172
197
  }
173
- const imageSize = [
174
- Math.round(getWidth(requestExtent) / imageResolution),
175
- Math.round(getHeight(requestExtent) / imageResolution)
176
- ];
177
- const imageUrl = this._getRequestUrl(requestExtent, imageSize);
178
198
  this._image = new ImageWrapper(
179
199
  requestExtent,
180
200
  resolution,
181
201
  pixelRatio,
182
- imageUrl,
202
+ src,
183
203
  this._crossOrigin,
184
204
  this.imageLoadFunction_
185
205
  );
@@ -187,6 +207,42 @@ import { containsExtent, getCenter, getHeight, getWidth, getForViewAndSize } fro
187
207
  this._image.addEventListener('change', this.handleImageChange.bind(this));
188
208
  return this._image;
189
209
  }
210
+
211
+ _getImageInternal(extent, resolutionVal, pixelRatio) {
212
+ const { src, resolution, requestExtent } = this._getImageInternalParams(extent, resolutionVal, pixelRatio);
213
+ if (this.image) {
214
+ if (
215
+ ((this.wantedExtent_ && containsExtent(this.wantedExtent_, requestExtent)) ||
216
+ containsExtent(this.image.getExtent(), requestExtent)) &&
217
+ ((this.wantedResolution_ && fromResolutionLike(this.wantedResolution_) === resolution) ||
218
+ fromResolutionLike(this.image.getResolution()) === resolution)
219
+ ) {
220
+ return this.image;
221
+ }
222
+ }
223
+ this.wantedExtent_ = requestExtent;
224
+ this.wantedResolution_ = resolution;
225
+ this.loader = this.createLoader({ src, crossOrigin: this._crossOrigin });
226
+ this.image = new ImageWrapper(requestExtent, resolution, pixelRatio, this.loader);
227
+ this.image.addEventListener('change', this.handleImageChange.bind(this));
228
+ return this.image;
229
+ }
230
+
231
+ createLoader({ src, crossOrigin }) {
232
+ const loadCallback = decode;
233
+ return (extent, resolution, pixelRatio) => {
234
+ const image = new Image();
235
+ image.crossOrigin = crossOrigin;
236
+ return loadCallback(image, src).then((image) => ({ image, extent, pixelRatio }));
237
+ };
238
+ }
239
+
240
+ getImageInternal(extent, resolutionVal, pixelRatio) {
241
+ if (Number(Util.getOlVersion()) < 8) {
242
+ return this._getImageInternalBy8(extent, resolutionVal, pixelRatio);
243
+ }
244
+ return this._getImageInternal(extent, resolutionVal, pixelRatio);
245
+ }
190
246
  _getRequestUrl(extent, imageSize) {
191
247
  const params = {
192
248
  width: imageSize[0],
@@ -1,4 +1,4 @@
1
- /* Copyright© 2000 - 2024 SuperMap Software Co.Ltd. All rights reserved.
1
+ /* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
2
2
  * This program are made available under the terms of the Apache License, Version 2.0
3
3
  * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
4
4
 
@@ -1,4 +1,4 @@
1
- /* Copyright© 2000 - 2024 SuperMap Software Co.Ltd. All rights reserved.
1
+ /* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
2
2
  * This program are made available under the terms of the Apache License, Version 2.0
3
3
  * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
4
4
 
@@ -1,4 +1,4 @@
1
- /* Copyright© 2000 - 2024 SuperMap Software Co.Ltd. All rights reserved.
1
+ /* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
2
2
  * This program are made available under the terms of the Apache License, Version 2.0
3
3
  * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
4
4
 
@@ -1,4 +1,4 @@
1
- /* Copyright© 2000 - 2024 SuperMap Software Co.Ltd. All rights reserved.
1
+ /* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
2
2
  * This program are made available under the terms of the Apache License, Version 2.0
3
3
  * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
4
4
  import { SecurityManager } from '@supermapgis/iclient-common/security/SecurityManager';