@supermapgis/iclient-ol 11.3.0 → 12.0.1-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.
- package/control/ChangeTileVersion.js +1 -1
- package/control/Logo.js +1 -1
- package/control/ScaleLine.js +2 -3
- package/control/index.js +1 -1
- package/core/MapExtend.js +1 -1
- package/core/StyleUtils.js +3 -3
- package/core/Util.js +2 -2
- package/core/index.js +1 -1
- package/css/index.js +1 -1
- package/dist/iclient-openlayers-es6.js +24483 -15526
- package/dist/iclient-openlayers-es6.min.js +3 -3
- package/dist/iclient-openlayers.css +2 -2
- package/dist/iclient-openlayers.js +136068 -123800
- package/dist/iclient-openlayers.min.css +2 -2
- package/dist/iclient-openlayers.min.js +3 -3
- package/index.js +1 -1
- package/mapping/BaiduMap.js +1 -2
- package/mapping/ImageSuperMapRest.js +68 -12
- package/mapping/ImageTileSuperMapRest.js +1 -1
- package/mapping/SuperMapCloud.js +1 -1
- package/mapping/Tianditu.js +1 -1
- package/mapping/TileSuperMapRest.js +1 -1
- package/mapping/WebMap.js +297 -125
- package/mapping/index.js +1 -1
- package/namespace.js +1 -1
- package/overlay/DataFlow.js +1 -1
- package/overlay/FGB.js +69 -4
- package/overlay/Graph.js +1 -1
- package/overlay/GraphMap.js +1 -1
- package/overlay/Graphic.js +1 -1
- package/overlay/HeatMap.js +1 -1
- package/overlay/Label.js +1 -1
- package/overlay/Mapv.js +1 -1
- package/overlay/Range.js +1 -1
- package/overlay/RankSymbol.js +1 -1
- package/overlay/Turf.js +1 -1
- package/overlay/Unique.js +1 -1
- package/overlay/VectorTileSuperMapRest.js +120 -87
- package/overlay/graphic/CanvasRenderer.js +1 -1
- package/overlay/graphic/CloverShape.js +1 -1
- package/overlay/graphic/Graphic.js +1 -1
- package/overlay/graphic/HitCloverShape.js +1 -1
- package/overlay/graphic/WebGLRenderer.js +1 -1
- package/overlay/graphic/index.js +1 -1
- package/overlay/index.js +1 -1
- package/overlay/mapv/MapvCanvasLayer.js +1 -1
- package/overlay/mapv/MapvLayer.js +1 -1
- package/overlay/mapv/index.js +1 -1
- package/overlay/theme/GeoFeature.js +1 -1
- package/overlay/theme/Theme.js +1 -1
- package/overlay/theme/ThemeFeature.js +1 -1
- package/overlay/theme/index.js +1 -1
- package/overlay/vectortile/DeafultCanvasStyle.js +1 -1
- package/overlay/vectortile/MapboxStyles.js +437 -387
- package/overlay/vectortile/StyleMap.js +1 -1
- package/overlay/vectortile/VectorTileStyles.js +1 -1
- package/overlay/vectortile/index.js +1 -1
- package/overlay/vectortile/olExtends.js +1 -1
- package/package.json +6 -6
- package/services/AddressMatchService.js +1 -1
- package/services/ChartService.js +1 -1
- package/services/DataFlowService.js +1 -1
- package/services/DatasetService.js +1 -1
- package/services/DatasourceService.js +1 -1
- package/services/FeatureService.js +1 -1
- package/services/FieldService.js +1 -1
- package/services/GridCellInfosService.js +1 -1
- package/services/ImageCollectionService.js +1 -1
- package/services/ImageService.js +1 -1
- package/services/KnowledgeGraphService.js +1 -1
- package/services/LayerInfoService.js +1 -1
- package/services/MapService.js +1 -1
- package/services/MeasureService.js +1 -1
- package/services/NetworkAnalyst3DService.js +1 -1
- package/services/NetworkAnalystService.js +1 -1
- package/services/ProcessingService.js +1 -1
- package/services/QueryService.js +1 -1
- package/services/ServiceBase.js +1 -1
- package/services/SpatialAnalystService.js +1 -1
- package/services/ThemeService.js +1 -1
- package/services/TrafficTransferAnalystService.js +1 -1
- package/services/WebPrintingJobService.js +1 -1
- package/services/index.js +1 -1
package/mapping/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 { BaiduMap } from './BaiduMap';
|
package/namespace.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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
|
|
package/overlay/DataFlow.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 { DataFlowService } from "../services/DataFlowService";
|
package/overlay/FGB.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 VectorSource from 'ol/source/Vector';
|
|
@@ -7,6 +7,9 @@ import { FetchRequest } from '@supermapgis/iclient-common/util/FetchRequest';
|
|
|
7
7
|
import { all, bbox } from 'ol/loadingstrategy';
|
|
8
8
|
import { getIntersection } from '@supermapgis/iclient-common/util/MapCalculateUtil';
|
|
9
9
|
import GeoJSON from 'ol/format/GeoJSON';
|
|
10
|
+
import throttle from 'lodash.throttle';
|
|
11
|
+
import { getUid } from 'ol/util';
|
|
12
|
+
|
|
10
13
|
/**
|
|
11
14
|
* @class FGB
|
|
12
15
|
* @browsernamespace ol.source
|
|
@@ -26,12 +29,50 @@ import GeoJSON from 'ol/format/GeoJSON';
|
|
|
26
29
|
* @param {boolean} [opt_options.useSpatialIndex] - 是否启用要素空间索引。
|
|
27
30
|
* @param {boolean} [opt_options.wrapX] - 是否平铺地图。
|
|
28
31
|
* @param {boolean} [opt_options.idField='SmID'] - 要素属性中表示唯一标识的字段,当 strategy 为 ol.loadingstrategy.bbox 时生效。
|
|
32
|
+
* @param {number} [opt_options.renderInterval=500] - 渲染间隔时间。
|
|
29
33
|
* @extends {ol.source.Vector}
|
|
30
34
|
* @usage
|
|
31
35
|
*/
|
|
36
|
+
|
|
37
|
+
class FeaturesCollection {
|
|
38
|
+
constructor() {
|
|
39
|
+
this.features = [];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
clear() {
|
|
43
|
+
this.features = [];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
push(feature) {
|
|
47
|
+
this.features.push(feature);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
isEmpty() {
|
|
51
|
+
return this.features.length === 0;
|
|
52
|
+
}
|
|
53
|
+
getArray() {
|
|
54
|
+
return this.features;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
forEach(fn) {
|
|
58
|
+
return this.features.forEach(fn);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
getLength() {
|
|
62
|
+
return this.features.length;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
remove(feature) {
|
|
66
|
+
const index = this.features.indexOf(feature);
|
|
67
|
+
if (index !== -1) {
|
|
68
|
+
this.features.splice(index, 1);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
32
73
|
export class FGB extends VectorSource {
|
|
33
74
|
constructor(options) {
|
|
34
|
-
const baseOptions = Object.assign({ strategy: bbox }, options);
|
|
75
|
+
const baseOptions = Object.assign({ strategy: bbox, useSpatialIndex: false }, options);
|
|
35
76
|
delete baseOptions.url;
|
|
36
77
|
delete baseOptions.extent;
|
|
37
78
|
delete baseOptions.idField;
|
|
@@ -42,7 +83,8 @@ export class FGB extends VectorSource {
|
|
|
42
83
|
this.extent = this.options.extent;
|
|
43
84
|
this._idField = this.options.idField || 'SmID';
|
|
44
85
|
this._validatedId = false;
|
|
45
|
-
this._checked = false;
|
|
86
|
+
this._checked = false;
|
|
87
|
+
this.renderInterval = this.options.renderInterval !== undefined ? this.options.renderInterval : 500;
|
|
46
88
|
this.setLoader(async function (extent) {
|
|
47
89
|
if (this.strategy === bbox) {
|
|
48
90
|
if (!this._validatedId) {
|
|
@@ -75,6 +117,11 @@ export class FGB extends VectorSource {
|
|
|
75
117
|
};
|
|
76
118
|
}
|
|
77
119
|
const fgb = deserialize(url, rect);
|
|
120
|
+
let featureList = [];
|
|
121
|
+
const throttleFn = throttle(() => {
|
|
122
|
+
this.addFeatures(featureList);
|
|
123
|
+
featureList = [];
|
|
124
|
+
}, this.renderInterval, { trailing: true, leading: false });
|
|
78
125
|
for await (let feature of fgb) {
|
|
79
126
|
let id = feature.properties[this._idField];
|
|
80
127
|
if (id && !this._validatedId) {
|
|
@@ -88,7 +135,8 @@ export class FGB extends VectorSource {
|
|
|
88
135
|
if (this.options.featureLoader && typeof this.options.featureLoader === 'function') {
|
|
89
136
|
feature = this.options.featureLoader(feature);
|
|
90
137
|
}
|
|
91
|
-
|
|
138
|
+
featureList.push(feature);
|
|
139
|
+
throttleFn();
|
|
92
140
|
}
|
|
93
141
|
}
|
|
94
142
|
|
|
@@ -97,4 +145,21 @@ export class FGB extends VectorSource {
|
|
|
97
145
|
return response;
|
|
98
146
|
});
|
|
99
147
|
}
|
|
148
|
+
|
|
149
|
+
bindFeaturesCollection_() {
|
|
150
|
+
this.featuresCollection_ = new FeaturesCollection();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
addFeaturesInternal(features) {
|
|
154
|
+
for (let i = 0, length = features.length; i < length; i++) {
|
|
155
|
+
const feature = features[i];
|
|
156
|
+
const featureKey = getUid(feature);
|
|
157
|
+
this.setupChangeEvents_(featureKey, feature);
|
|
158
|
+
this.featuresCollection_.push(features[i]);
|
|
159
|
+
const geometry = feature.getGeometry();
|
|
160
|
+
if (!geometry) {
|
|
161
|
+
this.nullGeometryFeatures_[featureKey] = feature;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
100
165
|
}
|
package/overlay/Graph.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 { Util as CommonUtil} from '@supermapgis/iclient-common/commontypes/Util';
|
package/overlay/GraphMap.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 Observable from 'ol/Observable';
|
package/overlay/Graphic.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 { Util } from '../core/Util';
|
package/overlay/HeatMap.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 {Util} from '../core/Util';
|
package/overlay/Label.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 { Util as CommonUtil} from '@supermapgis/iclient-common/commontypes/Util';
|
package/overlay/Mapv.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 {
|
package/overlay/Range.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 { Util as CommonUtil} from '@supermapgis/iclient-common/commontypes/Util';
|
package/overlay/RankSymbol.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 { Theme as FeatureTheme } from '@supermapgis/iclient-common/overlay/feature/Theme';
|
package/overlay/Turf.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 * as turf from '@turf/turf';
|
package/overlay/Unique.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 { Util as CommonUtil} from '@supermapgis/iclient-common/commontypes/Util';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 { Util } from '../core/Util';
|
|
@@ -29,6 +29,7 @@ import decryptTileUtil from '@supermapgis/tile-decryptor';
|
|
|
29
29
|
* @modulecategory Overlay
|
|
30
30
|
* @param {Object} options - 参数。
|
|
31
31
|
* @param {(string|undefined)} options.url - 服务地址。
|
|
32
|
+
* @param {string} [options.baseUrl] - 当传入 style 对象且 style 中包含了相对路径时,需要传入 baseUrl 来拼接资源路径。
|
|
32
33
|
* @param {(string|Object|undefined)} options.style - Mapbox Style JSON 对象或获取 Mapbox Style JSON 对象的 URL。当 `options.format` 为 {@link ol.format.MVT} 且 `options.source` 不为空时有效,优先级高于 `options.url`。
|
|
33
34
|
* @param {(string|undefined)} options.source - Mapbox Style JSON 对象中的 source 名称。当 `options.style` 设置时有效。当不配置时,默认为 Mapbox Style JSON 的 `sources` 对象中的第一个。
|
|
34
35
|
* @param {(string|Object)} [options.attributions='Tile Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权描述信息。
|
|
@@ -80,6 +81,10 @@ export class VectorTileSuperMapRest extends VectorTile {
|
|
|
80
81
|
me.withCredentials = options.withCredentials;
|
|
81
82
|
me.headers = options.headers || {};
|
|
82
83
|
me._tileType = options.tileType || 'ScaleXY';
|
|
84
|
+
me.baseUrl = options.baseUrl;
|
|
85
|
+
if(options.tileGrid){
|
|
86
|
+
this.hasTileGrid = true;
|
|
87
|
+
}
|
|
83
88
|
this.vectorTileStyles = new VectorTileStyles();
|
|
84
89
|
this._initialized(options);
|
|
85
90
|
|
|
@@ -140,10 +145,10 @@ export class VectorTileSuperMapRest extends VectorTile {
|
|
|
140
145
|
if (!tileCoord) {
|
|
141
146
|
return undefined;
|
|
142
147
|
} else {
|
|
143
|
-
|
|
148
|
+
return me._tileUrl
|
|
144
149
|
.replace(zRegEx, tileCoord[0].toString())
|
|
145
150
|
.replace(xRegEx, tileCoord[1].toString())
|
|
146
|
-
|
|
151
|
+
.replace(yRegEx, function () {
|
|
147
152
|
var y = ['4', '5'].indexOf(Util.getOlVersion()) > -1 ? -tileCoord[2] - 1 : tileCoord[2];
|
|
148
153
|
return y.toString();
|
|
149
154
|
})
|
|
@@ -169,7 +174,7 @@ export class VectorTileSuperMapRest extends VectorTile {
|
|
|
169
174
|
var height = Number(tileUrl.match(regHeight)[2]);
|
|
170
175
|
var me = this;
|
|
171
176
|
tile.setLoader(function (extent, resolution, projection) {
|
|
172
|
-
FetchRequest.get(tileUrl, null, {headers:me.headers})
|
|
177
|
+
FetchRequest.get(tileUrl, null, { headers: me.headers })
|
|
173
178
|
.then(function (response) {
|
|
174
179
|
if (tile.getFormat() instanceof GeoJSON) {
|
|
175
180
|
return response.json();
|
|
@@ -254,49 +259,49 @@ export class VectorTileSuperMapRest extends VectorTile {
|
|
|
254
259
|
}
|
|
255
260
|
xhr.withCredentials = me.withCredentials;
|
|
256
261
|
for (const key in me.headers) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
262
|
+
if (me.headers.hasOwnProperty(key)) {
|
|
263
|
+
xhr.setRequestHeader(key, me.headers[key]);
|
|
264
|
+
}
|
|
260
265
|
}
|
|
261
266
|
xhr.onload = function () {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
267
|
+
if (!xhr.status || (xhr.status >= 200 && xhr.status < 300)) {
|
|
268
|
+
const type = format.getType();
|
|
269
|
+
let source = void 0;
|
|
270
|
+
if (type === 'json' || type === 'text') {
|
|
271
|
+
source = xhr.responseText;
|
|
272
|
+
} else if (type === 'xml') {
|
|
273
|
+
source = xhr.responseXML;
|
|
274
|
+
if (!source) {
|
|
275
|
+
source = new DOMParser().parseFromString(xhr.responseText, 'application/xml');
|
|
276
|
+
}
|
|
277
|
+
} else if (type === 'arraybuffer') {
|
|
278
|
+
source = xhr.response;
|
|
279
|
+
}
|
|
280
|
+
if (source) {
|
|
281
|
+
source = me._decryptMvt(source);
|
|
282
|
+
if (['4', '5'].indexOf(Util.getOlVersion()) > -1) {
|
|
283
|
+
success.call(
|
|
284
|
+
this,
|
|
285
|
+
format.readFeatures(source, { featureProjection: projection }),
|
|
286
|
+
format.readProjection(source),
|
|
287
|
+
format.getLastExtent()
|
|
288
|
+
);
|
|
289
|
+
} else {
|
|
290
|
+
success.call(
|
|
291
|
+
this,
|
|
292
|
+
format.readFeatures(source, {
|
|
293
|
+
extent: extent,
|
|
294
|
+
featureProjection: projection
|
|
295
|
+
}),
|
|
296
|
+
format.readProjection(source)
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
} else {
|
|
300
|
+
failure.call(this);
|
|
301
|
+
}
|
|
294
302
|
} else {
|
|
295
|
-
|
|
303
|
+
failure.call(this);
|
|
296
304
|
}
|
|
297
|
-
} else {
|
|
298
|
-
failure.call(this);
|
|
299
|
-
}
|
|
300
305
|
}.bind(this);
|
|
301
306
|
xhr.onerror = function () {
|
|
302
307
|
failure.call(this);
|
|
@@ -307,37 +312,65 @@ export class VectorTileSuperMapRest extends VectorTile {
|
|
|
307
312
|
}
|
|
308
313
|
|
|
309
314
|
async _initialized(options) {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
if (options.
|
|
326
|
-
|
|
315
|
+
if (options.format instanceof MVT && options.style) {
|
|
316
|
+
let style = options.style;
|
|
317
|
+
if (Object.prototype.toString.call(options.style) == '[object String]') {
|
|
318
|
+
var url = SecurityManager.appendCredential(options.style);
|
|
319
|
+
const response = await FetchRequest.get(url, null, {
|
|
320
|
+
withCredentials: options.withCredentials,
|
|
321
|
+
headers: options.headers
|
|
322
|
+
});
|
|
323
|
+
this.baseUrl = url;
|
|
324
|
+
style = await response.json();
|
|
325
|
+
}
|
|
326
|
+
await this._fillByStyleJSON(style, options);
|
|
327
|
+
} else {
|
|
328
|
+
this._fillByRestMapOptions(options.url, options);
|
|
329
|
+
}
|
|
330
|
+
if (options.format instanceof MVT) {
|
|
331
|
+
if (options.decrypt) {
|
|
332
|
+
await this._verifyVectorTileIsEncrypt(options);
|
|
333
|
+
}
|
|
334
|
+
this.setState('ready');
|
|
327
335
|
}
|
|
328
|
-
this.setState('ready');
|
|
329
|
-
}
|
|
330
336
|
}
|
|
331
337
|
|
|
332
|
-
_fillByStyleJSON(style,
|
|
338
|
+
async _fillByStyleJSON(style, options) {
|
|
339
|
+
let { source, withCredentials } = options
|
|
333
340
|
if (!source) {
|
|
334
341
|
source = Object.keys(style.sources)[0];
|
|
335
342
|
}
|
|
343
|
+
//ToDo 支持多个tiles地址
|
|
336
344
|
if (style.sources && style.sources[source]) {
|
|
337
|
-
|
|
338
|
-
this.
|
|
345
|
+
let newUrl;
|
|
346
|
+
let paramUrl = this.baseUrl && this.baseUrl.split('?')[1];
|
|
347
|
+
if (style.sources[source].tiles) {
|
|
348
|
+
newUrl = style.sources[source].tiles[0];
|
|
349
|
+
if (!CommonUtil.isAbsoluteURL(newUrl)) {
|
|
350
|
+
newUrl = CommonUtil.relative2absolute(newUrl, this.baseUrl);
|
|
351
|
+
}
|
|
352
|
+
if (paramUrl) {
|
|
353
|
+
newUrl = CommonUtil.urlAppend(newUrl, paramUrl);
|
|
354
|
+
}
|
|
355
|
+
} else if (style.sources[source].url) {
|
|
356
|
+
let tiles = style.sources[source].url;
|
|
357
|
+
if (!CommonUtil.isAbsoluteURL(tiles)) {
|
|
358
|
+
tiles = CommonUtil.relative2absolute(tiles, this.baseUrl);
|
|
359
|
+
}
|
|
360
|
+
const response = await FetchRequest.get(tiles, {}, { withCredentials, withoutFormatSuffix: true });
|
|
361
|
+
const sourceInfo = await response.json();
|
|
362
|
+
let tileUrl = sourceInfo.tiles[0];
|
|
363
|
+
if (!CommonUtil.isAbsoluteURL(tileUrl)) {
|
|
364
|
+
tileUrl = CommonUtil.relative2absolute(tileUrl, tiles);
|
|
365
|
+
}
|
|
366
|
+
newUrl = SecurityManager.appendCredential(tileUrl);
|
|
367
|
+
if (paramUrl) {
|
|
368
|
+
newUrl = CommonUtil.urlAppend(newUrl, paramUrl);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
this._tileUrl = SecurityManager.appendCredential(newUrl);
|
|
339
372
|
}
|
|
340
|
-
if (style.metadata && style.metadata.indexbounds) {
|
|
373
|
+
if (!this.hasTileGrid && style.metadata && style.metadata.indexbounds) {
|
|
341
374
|
const indexbounds = style.metadata.indexbounds;
|
|
342
375
|
var max = Math.max(indexbounds[2] - indexbounds[0], indexbounds[3] - indexbounds[1]);
|
|
343
376
|
const defaultResolutions = [];
|
|
@@ -390,32 +423,32 @@ export class VectorTileSuperMapRest extends VectorTile {
|
|
|
390
423
|
}
|
|
391
424
|
|
|
392
425
|
async _verifyVectorTileIsEncrypt(options) {
|
|
393
|
-
|
|
394
|
-
|
|
426
|
+
try {
|
|
427
|
+
let serviceUrl = options.url || typeof options.style === 'string' && options.style;
|
|
395
428
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
429
|
+
if (!serviceUrl && Object.prototype.toString.call(options.style) == '[object Object]') {
|
|
430
|
+
const firstSource = Object.keys(options.style.sources)[0];
|
|
431
|
+
serviceUrl = options.style.sources[firstSource].tiles[0];
|
|
432
|
+
}
|
|
433
|
+
const res = await getServiceKey(serviceUrl);
|
|
434
|
+
if (res) {
|
|
435
|
+
this.decryptOptions = {
|
|
436
|
+
key: res.serviceKey,
|
|
437
|
+
algorithm: res.algorithm,
|
|
438
|
+
decrypt: typeof options.decrypt === 'boolean' ? undefined : options.decrypt,
|
|
439
|
+
decryptCompletedFunction: options.decryptCompletedFunction
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
} catch (error) {
|
|
443
|
+
console.error(error);
|
|
408
444
|
}
|
|
409
|
-
} catch (error) {
|
|
410
|
-
console.error(error);
|
|
411
|
-
}
|
|
412
445
|
}
|
|
413
446
|
|
|
414
447
|
_decryptMvt(mvtData) {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
448
|
+
if (this.decryptOptions) {
|
|
449
|
+
return decryptTileUtil({ ...this.decryptOptions, arrayBuffer: mvtData });
|
|
450
|
+
}
|
|
451
|
+
return mvtData;
|
|
419
452
|
}
|
|
420
453
|
|
|
421
454
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 { Util as CommonUtil } from '@supermapgis/iclient-common/commontypes/Util';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 -
|
|
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 -
|
|
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 {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 { Util as CommonUtil } from "@supermapgis/iclient-common/commontypes/Util";
|
package/overlay/graphic/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 {Graphic as OverlayGraphic} from './Graphic';
|
package/overlay/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 {DataFlow} from './DataFlow';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 -
|
|
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 {
|
package/overlay/mapv/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 {MapvCanvasLayer} from './MapvCanvasLayer';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 { Bounds } from '@supermapgis/iclient-common/commontypes/Bounds';
|
package/overlay/theme/Theme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 {Util} from '../../core/Util';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 { GeoJSON as GeoJSONFormat } from '@supermapgis/iclient-common/format/GeoJSON';
|
package/overlay/theme/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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 {GeoFeature} from './GeoFeature';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright© 2000 -
|
|
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
|
/**
|