Skip to content

Commit a6f7175

Browse files
committed
[UT] fix UT (websymbol)
revuew by yangtt
1 parent 87b6bfc commit a6f7175

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/mapboxgl/overlay/symbol/MapExtendSymbol.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { FetchRequest } from "@supermap/iclient-common/util/FetchRequest";
1010
* @description 扩展了 mapboxgl.Map 对图层相关的操作。
1111
* @private
1212
*/
13-
export var MapExtendSymbol = (function () {
13+
function MapExtendSymbol(){
1414
/**
1515
* 获取symbol管理
1616
* @param {*} map
@@ -257,5 +257,5 @@ export var MapExtendSymbol = (function () {
257257
}
258258
}
259259

260-
})();
261-
260+
}
261+
export default MapExtendSymbol

src/mapboxgl/overlay/symbol/WebSymbol.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This program are made available under the terms of the Apache License, Version 2.0
33
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
44
import mapboxgl from "mapbox-gl";
5-
import './MapExtendSymbol';
5+
import MapExtendSymbol from './MapExtendSymbol';
66
/**
77
* @class WebSymbol
88
* @classdesc SuperMap iClient for MapboxGL 支持 Web 符号库,扩展了 [MapboxGL](https://docs.mapbox.com/mapbox-gl-js/api/) 的 API。
@@ -188,5 +188,6 @@ export class WebSymbol {
188188
*/
189189
init(config) {
190190
mapboxgl.Map.prototype.basePath = config?.basePath ?? this.defaultBasePath;
191+
MapExtendSymbol();
191192
}
192193
}

test/mapboxgl/overlay/symbol/MapExtendSymbolSpec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import mapboxgl from 'mapbox-gl';
2-
import "../../../../src/mapboxgl/overlay/symbol/MapExtendSymbol";
2+
import MapExtendSymbol from "../../../../src/mapboxgl/overlay/symbol/MapExtendSymbol";
33
import { FetchRequest } from '../../../../src/common/util/FetchRequest';
44

55
describe('MapExtendSymbol', () => {
@@ -8,6 +8,7 @@ describe('MapExtendSymbol', () => {
88
var testDiv, map;
99
var originalTimeout;
1010
beforeAll((done) => {
11+
MapExtendSymbol();
1112
testDiv = document.createElement("div");
1213
testDiv.setAttribute("id", "map");
1314
testDiv.style.styleFloat = "left";

test/tool/GlobeParameter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@
3737
webPrintingURL: "http://localhost:9876/iserver/services/webprinting/rest/webprinting/v1",
3838
imageServiceURL: "http://localhost:9876/iserver/imageservice-imageserviceName/restjsr",
3939
chartServiceURL: "http://localhost:9876/iserver/services/map-ChartW/rest/maps/海图",
40+
populationURL: "http://localhost:9876/iserver/services/map-Population/rest/maps/PopulationDistribution"
4041
}

0 commit comments

Comments
 (0)