@@ -7,43 +7,8 @@ describe('maplibregl_MapExtendSymbol', () => {
7
7
// var populationUrl = GlobeParameter.populationURL;
8
8
var testDiv , map ;
9
9
var originalTimeout ;
10
- // 尝试解决方法来源 https://github.com/jestjs/jest/issues/1256
11
- var createMap = ( ) => {
12
- return new Promise ( ( resolve ) => {
13
- var map = new maplibregl . Map ( {
14
- container : 'map' ,
15
- style : {
16
- "version" : 8 ,
17
- "sources" : {
18
- /* "raster-tiles": {
19
- "type": "raster",
20
- "tiles": [url + '/zxyTileImage.png?z={z}&x={x}&y={y}'],
21
- "tileSize": 256
22
- },
23
- "全国人口密度空间分布图": {
24
- "tiles": [
25
- populationUrl + "/tileFeature.mvt?z={z}&x={x}&y={y}"
26
- ],
27
- "type": "vector"
28
- } */
29
- } ,
30
- "layers" : [ /* {
31
- "id": "simple-tiles",
32
- "type": "raster",
33
- "source": "raster-tiles",
34
- "minzoom": 0,
35
- "maxzoom": 22
36
- } */ ]
37
- } ,
38
- center : [ 116.40 , 39.79 ] ,
39
- zoom : 3
40
- } ) ;
41
- map . on ( 'load' , function ( ) {
42
- resolve ( map ) ;
43
- } ) ;
44
- } )
45
- }
46
- beforeAll ( async ( done ) => {
10
+
11
+ beforeAll ( ( done ) => {
47
12
new maplibregl . supermap . WebSymbol ( ) . init ( ) ;
48
13
testDiv = document . createElement ( "div" ) ;
49
14
testDiv . setAttribute ( "id" , "map" ) ;
@@ -53,9 +18,39 @@ describe('maplibregl_MapExtendSymbol', () => {
53
18
testDiv . style . width = "500px" ;
54
19
testDiv . style . height = "500px" ;
55
20
document . body . appendChild ( testDiv ) ;
56
- map = await createMap ( ) ;
57
- done ( ) ;
58
- } ) ;
21
+ map = new maplibregl . Map ( {
22
+ container : 'map' ,
23
+ style : {
24
+ "version" : 8 ,
25
+ "sources" : {
26
+ /* "raster-tiles": {
27
+ "type": "raster",
28
+ "tiles": [url + '/zxyTileImage.png?z={z}&x={x}&y={y}'],
29
+ "tileSize": 256
30
+ },
31
+ "全国人口密度空间分布图": {
32
+ "tiles": [
33
+ populationUrl + "/tileFeature.mvt?z={z}&x={x}&y={y}"
34
+ ],
35
+ "type": "vector"
36
+ } */
37
+ } ,
38
+ "layers" : [ /* {
39
+ "id": "simple-tiles",
40
+ "type": "raster",
41
+ "source": "raster-tiles",
42
+ "minzoom": 0,
43
+ "maxzoom": 22
44
+ } */ ]
45
+ } ,
46
+ center : [ 116.40 , 39.79 ] ,
47
+ zoom : 3
48
+ } ) ;
49
+ map . on ( 'load' , function ( ) {
50
+ done ( ) ;
51
+ } ) ;
52
+
53
+ } , 50000 ) ;
59
54
beforeEach ( ( ) => {
60
55
originalTimeout = jasmine . DEFAULT_TIMEOUT_INTERVAL ;
61
56
jasmine . DEFAULT_TIMEOUT_INTERVAL = 50000 ;
0 commit comments